ProcessDefinition definition = instance.getProcessDefinition();
if(definition==null)
throw new UEngineException("Can't find the definition for instance '" + instance.getInstanceId() + "'");
Activity activity = definition.getActivity(tracingTag);
if(activity==null)
throw new UEngineException("No such activity with tracing tag : " + tracingTag + " in definition '" + definition.getId() + "'");
Class[] actualParameterTypes = new Class[parameterTypes.length+1];
actualParameterTypes[0] = ProcessInstance.class;
System.arraycopy(parameterTypes, 0, actualParameterTypes, 1, parameterTypes.length);
Object[] actualParameters = new Object[parameterTypes.length+1];
actualParameters[0] = instance;
System.arraycopy(parameters, 0, actualParameters, 1, parameterTypes.length);
return (Serializable)activity.getClass().getMethod(actionName, actualParameterTypes).invoke(activity, actualParameters);
}catch(Exception e){
e.printStackTrace();
throw new RemoteException("ProcessManagerError:"+e.getMessage(), e);
}