[jboss-user] [jBPM] - Re: How to expose a jbpm workflow as web service.

lalit jangra do-not-reply at jboss.com
Thu Sep 16 07:09:40 EDT 2010

lalit jangra [http://community.jboss.org/people/agentsmith0009] created the discussion

"Re: How to expose a jbpm workflow as web service."

To view the discussion, visit: http://community.jboss.org/message/562140#562140

Hi All,

You can use the following code to trigger a workflow in java.

     * Method to trigger workflow dynamically.
    public void exposeWorkflowAsWebService(){
        JbpmContext jbpmContext = null;
            System.out.println("Invoking a workflow");
            jbpmContext = JbpmConfiguration.getInstance().createJbpmContext();
            ProcessInstance processInstance = jbpmContext.newProcessInstance("NotificationWorkflow");
            while (!processInstance.isTerminatedImplicitly()) {
        }catch (Exception e) {
            System.out.println("Error while invoking workflow : "+e.getMessage());
        }finally {        
            System.out.println("Finally closing jbpmContext.");

This java code can be exposed as web service & used as needed.

Reply to this message by going to Community

Start a new discussion in jBPM at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100916/db36954c/attachment-0001.html 

More information about the jboss-user mailing list