To move from API EJB to API SDK you just have to use the workflow module (IWorkflowModule). This object has a certain number of "getter" methods enabling to take as entries several natures of objects and to convert it in objects API SDK.
//recovering an application public ICatalog getCatalog( Object object ) throws WorkflowModuleException; //recovering a resource template public IResourceDefinition getResourceDefinition( Object object ) throws WorkflowModuleException; //recovering an property public IProperty getProperty( Object object ) throws WorkflowModuleException; //recovering a process public IWorkflowContainer getWorkflowContainer( Object object ) throws WorkflowModuleException; //recovering a process version public IWorkflow getWorkflow( Object object ) throws WorkflowModuleException; //recovering a task public ITask getTask( Object object ) throws WorkflowModuleException; //recovering an action public IAction getAction( Object object ) throws WorkflowModuleException; //recovering a role public IRole getRole( Object object ) throws WorkflowModuleException;
//recovering a resource public IResource getResource( Object object ) throws WorkflowModuleException; //recovering a document public IWorkflowInstance getWorkflowInstance( Object object ) throws WorkflowModuleException; //recovering an active task public ITaskInstance getTaskInstance( Object object ) throws WorkflowModuleException; //recovering an element of an attachment field public IAttachment getAttachment( Object object ) throws WorkflowModuleException; //recovering a user of a user activity public IOperator getOperator( Object object ) throws WorkflowModuleException; //recovering a user public IUser getUser( Object object ) throws WorkflowModuleException;
Example of recovering a IWorkflowInstance object from a Treatment object
public IWorkflowInstance system_getWorkflowInstance( IWorkflowModule module, Treatment treatment ) throws WorkflowModuleException { return module.getWorkflowInstance( treatment ); }
To move from the API SDK to the API EJB, you just have to use each one of the SDK objects and to call them on the method getNativeObject(). This one retrieves,based on the below table, the corresponding native object.
Example of recovering a Treatment object from a workflow instance
public Treatment system_getTreatment( IWorkflowInstance workflowInstance ) throws WorkflowModuleException { return ( (Treatment)workflowInstance.getNativeObject() ); }