-
1. Re: How to signal process event from a custom WorkItemHandler?
swiderski.maciej Dec 5, 2012 2:34 AM (in response to thomas.setiabudi)in general I would recommend to signal it using intermediate throwing signal event. But if you need to do it from within the work item handler you need to use ksession for that. So, when you register your handler make sure to inject ksession into it and the use it to signalEvent.
HTH
-
2. Re: How to signal process event from a custom WorkItemHandler?
thomas.setiabudi Dec 5, 2012 2:51 AM (in response to swiderski.maciej)Hi Maciej,
Thank you for your answer.
If I were to make a custom WorkItemHandler and need to inject ksession to it, that means instead of registering my workitemhandler in
jbpm-installer\jboss-as-7.1.1.Final\standalone\deployments\jbpm-gwt-console-server.war\WEB-INF\classes\META-INF\CustomWorkItemHandlers.conf
I would need to inject it in
\jbpm-installer\jboss-as-7.1.1.Final\standalone\deployments\jbpm-gwt-console-server.war\WEB-INF\classes\default.session.template
and change this part
workItemHandlers = ["Human Task" : "new my.custom.workitemhandler.humantask.hornetq.CustomHTHornetQWIH(\"jbpmConsoleHTHandler\", taskClient, ksession, org.jbpm.task.utils.OnErrorAction.LOG)", "Service Task" : "new org.jbpm.process.workitem.bpmn2.ServiceTaskHandler(ksession)"],
to
workItemHandlers = ["Human Task" : "new my.custom.workitemhandler.humantask.hornetq.CustomHTHornetQWIH(\"jbpmConsoleHTHandler\", taskClient, ksession, org.jbpm.task.utils.OnErrorAction.LOG)", "Service Task" : "new org.jbpm.process.workitem.bpmn2.ServiceTaskHandler(ksession)", "MyCustomTask" : "new my.custom.workitem.handler.myWorkItemHandler(kession)"],
and then register a .wid for MyCustomTask.
will that works?
Regards,
Thomas Setiabudi
-
3. Re: How to signal process event from a custom WorkItemHandler?
swiderski.maciej Dec 5, 2012 3:23 AM (in response to thomas.setiabudi)you don't have to change the default.* files inside the jbpm-gwt-console-server.war as you can simply make a copy of these files and drop them in configuration directory (for AS7 it is jboss_home/standalone/configuration), e.g. rename copied default.session.template to session.template and add your modification. Console when loading first checks if there is a custom file in config dire and if so load it instead of default ones. More on this can be found in documentation as well.
Yes, it should work as you described
HTH
-
4. Re: How to signal process event from a custom WorkItemHandler?
thomas.setiabudi Dec 5, 2012 12:16 PM (in response to swiderski.maciej)Allright,
Thank you Maciej
Regards,
Thomas Setiabudi