Skip to main content

How to access the EntityService from a custom plugin?

  1 post   Feedicon  
Replies: 0 - Last Post: July 06, 2011 21:23
by: Ralph
showing 1 - 1 of 1
Posted: July 06, 2011 21:23 by Ralph
In contrast to earlier documentation it is quite simple to access the EntityService or WorkflowService from a custom plugin class.
There is no need to make a jndi lookup.
You can simply fetch an instance of the workflowService from the WorkflowContext.

See code example below:

public void init(WorkflowContext actx) throws Exception {
        super.init(actx);
        // check for an instance of WorkflowService
        if (actx instanceof WorkflowService) {
                // yes we are running in a WorkflowService EJB
                WorkflowService ws=(WorkflowService)actx;
                // get latest model version....
                String slw=ws.getModelService().getLatestVersion();
                .....
        }
}


see also:
http://www.imixs.org/jee/plugin/overview.html

==
Ralph
Replies: 0 - Last Post: July 06, 2011 21:23
by: Ralph
 
 
Close
loading
Please Confirm
Close