[jboss-dev-forums] [jBPM Development] - Re: Web Service client in Jbpm 5.4
abraham arellano
do-not-reply at jboss.com
Thu Jul 4 03:00:01 EDT 2013
abraham arellano [https://community.jboss.org/people/aarellano] created the discussion
"Re: Web Service client in Jbpm 5.4"
To view the discussion, visit: https://community.jboss.org/message/826337#826337
--------------------------------------------------------------
Hi all,
Finally I found a way to solve my problem with my architecture.
Steps:
- I create in GUVNOR a new WorkItemDefinition in the package where my process is defined. Then the "Service Tasks" Tab is available in the Process Designer. (I could not set an image to the Service Task due some error to find it)
- I set in the designer the Service Task where I need it.
- In my Web Application I create a class that handles the Service Task and should implements *org.drools.runtime.process.WorkItemHandler*
- In the new class define the action in the *executeWorkItem* method. To complete the task from here this code is needed:
+public void executeWorkItem(WorkItem workItem, WorkItemManager workManager) {+
+ System.out.println("+++++++++++++ in the SubviewRevisionValidatorHandler ++++++++++++++++");+
+* You can define a WebService client as in my case or the logic that you need*
+
+ workManager.completeWorkItem(workItem.getId(), param);+
+}+
- In my Web Application (that start the process) I set this lines before start a process where the first param is the name that you provide in Guvnor to the service and the second param is the new class in you App:
+ksession.getWorkItemManager().registerWorkItemHandler("ServiceTaskName", new ServiceTaskItemHandler());+
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/826337#826337]
Start a new discussion in jBPM Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2035]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20130704/521306f8/attachment.html
More information about the jboss-dev-forums
mailing list