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]

_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to