-
15. Re: Sanity Check 0.7.0 Final - Visual Editor BPM Implementation
jeffdelong Mar 20, 2013 11:48 PM (in response to rcernich)I don't have enough context to comment on these screenshots. What does the process definition look like and the other property panels for this task? A few more screenshots would be helpful.
-
16. Re: Sanity Check 0.7.0 Final - Visual Editor BPM Implementation
rcernich Mar 21, 2013 10:44 AM (in response to jeffdelong)Hey Jeff,
The first pair of screen shots are the same page, the ony difference is that in the first, a couple of the sections are collapsed and in the second they are expanded. As you can see, there is only one other page associated with the selected element, which is the standard "Description" page that is available for all nodes. These properties are available on a SwitchYard "ServiceTask." As for the process definition, it's simply Start->ServiceTask->End. The process also has an interface definition (ExampleService) that was imported from a Java type (enhancement to the bpmn editor), along with operations, message references and item definitions for the types used.
The second screen shot is what you get when you select a custom "SwitchYard Service" Task. This is the original integration with jBPM. We've kept it around because it allows you to dynamically specify the service to invoke using process variables. The other property pages are the standard "Description" and "I/O Parameters." The former is the standard that comes with all tasks, while the latter is where you define DataInput, DataOutput and associations for them. Once again, the process is simply Start->Task->End.
I hope to have this commited in the next few days.
Hope that helps,
Rob
-
17. Re: Sanity Check 0.7.0 Final - Visual Editor BPM Implementation
rcernich Mar 22, 2013 10:33 AM (in response to rcernich)Hey folks,
So, with the new ServiceTask support, here's the basic workflow:
- On the process properties, select the "Interfaces" tab. There is a new buton, "Import." Import the interface associated with the service reference.
- Drag the "SwitchYard Service Task" tool from the palette to your canvas.
- On the "SwitchYard Service Task" tab, select the operation you wish to invoke in the drop list.
- Map the Input, Output and Fault values as necessary. The input can be either and expression or variable mapping. Output and Fault must map back to a process variable.
- Wire the task into your process and test.
For the "SwitchYard Dynamic Service Task," the process is a little different.
- Drag the "SwitchYard Dynamic Service Task" tool from the palette to your canvas.
- On the "SwitchYard Dynamic Service Task" tab, map values for the "Service Name" and "Operation Name"
- On the "I/O Parameters" tab, create a DataInput whose name matches the value in "ContentInputName" (contentInput by default) and a DataOutput (if necessary) whose name matches the value in "ContentOutputName" (contentOutput by default).
- Wire the task into your process an test.
(The dyanmic task looks like it has fewer steps, but step 1 and 2 are covered by step two in the service task and creating the I/O parameters is a bit more intensive than step 3 makes it sound.)
I'll update this thread once a build is available.
Best,
Rob
-
18. Re: Sanity Check 0.7.0 Final - Visual Editor BPM Implementation
jeffdelong Mar 25, 2013 7:08 PM (in response to rcernich) -
19. Re: Sanity Check 0.7.0 Final - Visual Editor BPM Implementation
jeffdelong Mar 26, 2013 7:43 PM (in response to jeffdelong)So the instructions here don't match
https://docs.jboss.org/author/display/SWITCHYARD/BPM#BPM-UsingthestandardBPMN2ServiceTask
In particular, I don't see a way to specify
implementation="##SwitchYard"
When I try to deploy by switchyard application I get
java.lang.IllegalArgumentException: Could not parse knowledge."}}}}
-
20. Re: Sanity Check 0.7.0 Final - Visual Editor BPM Implementation
jeffdelong Mar 26, 2013 9:40 PM (in response to jeffdelong)I updated to the latest versions of the SY and BPMN2 plugins, and the SwitchYard Service and SwitchYard Dynamic Service Task appear in the palette:
Now your instructions make more sense, although I am uncertain why I should use the SwitchYard Service vs the Service Task and how this would impact portability? The SwitchYard Service creates:
<serviceTask id="ServiceTask_2" tns:icon="org.switchyard.tools.ui.editor.SwitchYard.16" name="PolicyQuoteEntityService" implementation="##SwitchYard" operationRef="Operation_2">
I don't understand the icon attribute.
I was expecting to use the Service Task and have to select ##SwitchYard from a list of choices (the other being ##WebService, which appears is not yet supported in BPMN2 Editor).
In any case I still get java.lang.IllegalArgumentException: Could not parse knowledge."
Unfortunate that Drools cannot give a more meaningful error message.
-
21. Re: Sanity Check 0.7.0 Final - Visual Editor BPM Implementation
dward Mar 27, 2013 9:45 AM (in response to jeffdelong)Jeff, can I please see your BPMN2 and switchyard.xml files?
-
22. Re: Sanity Check 0.7.0 Final - Visual Editor BPM Implementation
rcernich Mar 27, 2013 1:27 PM (in response to jeffdelong)Hey Jeff,
jBPM doesn't like if the item definitions aren't declared before the messages before the interfaces. Open the bpmn in a text editor and reorder the elements so you have item definitions followed by messages followed by interfaces followed by the process.
Hope that helps,
Rob
-
23. Re: Sanity Check 0.7.0 Final - Visual Editor BPM Implementation
dward Mar 27, 2013 1:30 PM (in response to dward)Jeff,
Looking at your switchyard.xml, I see a couple things:
1. Your error, "Could not parse knowledge", is most likely because your PolicyQuoteCalculation component has no resources defined inside its manifest:
<sca:component name="PolicyQuoteCalculation">
<rules:implementation.rules>
<rules:manifest/>
</rules:implementation.rules>
...
should be:
<sca:component name="PolicyQuoteCalculation">
<rules:implementation.rules>
<rules:manifest>
<rules:resources>
<rules:resource location="PolicyQuoteCalculation.drl" type="DRL"/>
</rules:resources>
</rules:manifest>
</rules:implementation.rules>
...
2. You should remove this block completely:
<bpm:workItemHandlers>
<bpm:workItemHandler class="org.switchyard.component.bpm.work.SwitchYardServiceWorkItemHandler" name="SwitchYard Service"/>
</bpm:workItemHandlers>
Not only did that WIH change package ( s/work/service/ ), but you don't need to register it yourself anymore. It gets auto-registered by the runtime. You only have to include it in config if you want to override the WIH with that name.
Best regards,
David
-
24. Re: Sanity Check 0.7.0 Final - Visual Editor BPM Implementation
jeffdelong Mar 27, 2013 1:42 PM (in response to dward)Thanks, will change and test out. I have been upgrading models (SY and BPMN) from previous versions of tooling so certain elements either got removed or are no longer relevant.
-
25. Re: Sanity Check 0.7.0 Final - Visual Editor BPM Implementation
jeffdelong Mar 27, 2013 6:23 PM (in response to jeffdelong)I made both sets of changes (those suggested by Rob and those suggested by David) and my service deploys.
When I execute the process I get an exception:
16:10:17,807 INFO [org.drools.audit.WorkingMemoryConsoleLogger] (http--127.0.0.1-8080-1) BEFORE PROCESS NODE TRIGGERED node:PolicyQuoteEntityService[id=3] process:PolicyQuoteProcess[id=org.acme.insurance.PolicyQuoteProcess]
16:10:17,902 ERROR [org.switchyard.component.bpm.service.SwitchYardServiceWorkItemHandler] (http--127.0.0.1-8080-1) Fault encountered: ServiceReference [{urn:org.acme.insurance:PolicyQuoteProcessService:0.0.1-SNAPSHOT}org.acme.insurance.PolicyQuoteEntityService.PolicyQuoteEntityService] == null: org.switchyard.exception.SwitchYardException: ServiceReference [{urn:org.acme.insurance:PolicyQuoteProcessService:0.0.1-SNAPSHOT}org.acme.insurance.PolicyQuoteEntityService.PolicyQuoteEntityService] == null
at org.switchyard.component.common.knowledge.service.SwitchYardServiceInvoker.invoke(SwitchYardServiceInvoker.java:108) [switchyard-component-common-knowledge-0.8.0.Final.jar:0.8.0.Final]
at org.switchyard.component.bpm.service.SwitchYardServiceWorkItemHandler.executeWorkItem(SwitchYardServiceWorkItemHandler.java:140) [switchyard-component-bpm-0.8.0.Final.jar:0.8.0.Final]
at org.switchyard.component.bpm.service.SwitchYardServiceTaskHandler.executeWorkItem(SwitchYardServiceTaskHandler.java:73) [switchyard-component-bpm-0.8.0.Final.jar:0.8.0.Final]
at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.internalExecuteWorkItem(JPAWorkItemManager.java:53) [drools-persistence-jpa-6.0.0.Alpha6.jar:6.0.0.Alpha6]
at org.jbpm.workflow.instance.node.WorkItemNodeInstance.internalTrigger(WorkItemNodeInstance.java:107) [jbp
-
26. Re: Sanity Check 0.7.0 Final - Visual Editor BPM Implementation
dward Mar 28, 2013 10:33 AM (in response to jeffdelong)When using the serviceTask, switchyard uses the BPMN2's interface implementationRef as the name to lookup as the switchyard service reference.
This is what you have in your BPMN2 file (see implementationRef attribute):
<interface id="Interface_2" implementationRef="org.acme.insurance.PolicyQuoteEntityService.PolicyQuoteEntityService" name="PolicyQuoteEntityService">
<operation id="Operation_2" implementationRef="storePolicyQuote" name="storePolicyQuote">
<inMessageRef>PolicyQuoteEntityService_storePolicyQuote_policyquote</inMessageRef>
<outMessageRef>PolicyQuoteEntityService_storePolicyQuote_Result</outMessageRef>
</operation>
</interface>
However, in your switchyard.xml, you only have just "PolicyQuoteEntityService" (see the name attribute):
<sca:reference name="PolicyQuoteEntityService">
<sca:interface.java interface="org.acme.insurance.PolicyQuoteEntityService.PolicyQuoteEntityService"/>
</sca:reference>
So, obviously these two attributes do not match, which leads us to an option, and a question:
1) Change one of those attributes to match the other.
2) I was told that the switchyard service name (more specifically, the switchyard service reference name) should be looked up using the BPMN2 interface element's implementationRef attribute. Is this not correct? Should it instead match on the BPMN2 interface element's name attribute?
-
27. Re: Sanity Check 0.7.0 Final - Visual Editor BPM Implementation
dward Mar 28, 2013 10:48 AM (in response to dward)I might be wrong about what I just said... These are input parameters that must be available to the serviceTask. On your serviceTask, I don't see a
"interfaceImplementationRef" paramater defined at all.... The task handler will look for that first, and if it can't fine that, will default to looking for an "Interface" parameter. You could try setting one of those to "PolicyQuoteEntityService". Sorry for the confusion!
-
28. Re: Sanity Check 0.7.0 Final - Visual Editor BPM Implementation
jeffdelong Mar 28, 2013 12:11 PM (in response to dward)I will try that but the BPMN file is being created by the BPMN2 Editor, so if I have to manually configure there is a problem with the Editor.
-
29. Re: Sanity Check 0.7.0 Final - Visual Editor BPM Implementation
rcernich Mar 28, 2013 12:41 PM (in response to jeffdelong)Hey guys,
I think we need to rework the component to use "Interface" and "Operation" as the keys instead of "interfaceImplementationRef" and...
Jeff, all you should have to do is change the implementation ref on the interface definition to match the SwitchYard service name (PolicyQuoteEntityService).
Hope that helps.
Rob