[jboss-user] [jBPM] - How to access a processInstance within a work item

Tobias Wittur do-not-reply at jboss.com
Sun Aug 28 23:15:59 EDT 2011


Tobias Wittur [http://community.jboss.org/people/tob1as] created the discussion

"How to access a processInstance within a work item"

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

--------------------------------------------------------------
Hello,

I know usually a signal is invoked upon the knowledgeSession, and all processInstances that are registered on this session and listen to the messageType, will be notified. E.g.
ksession.signalEvent("Message-StartProcessMessage", params);


However, how can I signal a specific process instance from within a work Item?

I know how to get to the ProcessInstanceId, but how would I have to go on?

> public class CustomerServiceTaskHandler implements WorkItemHandler {
> 
>     public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {
>  System.out.println(workItem.getProcessInstanceId());
> 
>           try{
> ...
>           }catch(Exception ex){
>  myProcessInstance.signal('AbortTheCurrentInstance');
>           }
> 
>     }
> 
>     public void abortWorkItem(WorkItem workItem, WorkItemManager manager) {
>     }
>  }


Best regards,

Tobias
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/623382#623382]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110828/71575e5f/attachment.html 


More information about the jboss-user mailing list