11 Replies Latest reply on Aug 28, 2011 11:02 PM by Tihomir Surdilovic

    Issues oryx to jbpm

    Tobias Wittur Newbie

      Hi,

       

      I guess I will put any issues that I encounter with oryx to jbpm in here.

       

      Here the bpmn2:definitions attribute id created by oryx is rejected by java.

       

       

      <bpmn2:definitions

      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

      xmlns="http://www.omg.org/bpmn20"

      xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL"

      xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"

      xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"

      xmlns:di="http://www.omg.org/spec/DD/20100524/DI"

      xmlns:drools="http://www.jboss.org/drools"

      id="3de41b27-cc04-4287-9a88-87b0a5ed6a66"

      xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"

      name="TestingStartEnd"

      targetNamespace="http://www.omg.org/bpmn20">

       

       

      package TestingBPMN;
      
      import java.util.HashMap;
      import java.util.Map;
      
      import org.drools.KnowledgeBase;
      import org.drools.builder.KnowledgeBuilder;
      import org.drools.builder.KnowledgeBuilderFactory;
      import org.drools.builder.ResourceType;
      import org.drools.io.ResourceFactory;
      import org.drools.logger.KnowledgeRuntimeLogger;
      import org.drools.logger.KnowledgeRuntimeLoggerFactory;
      import org.drools.runtime.StatefulKnowledgeSession;
      import org.drools.runtime.process.WorkflowProcessInstance;
      import org.jbpm.process.workitem.wsht.WSHumanTaskHandler;
      import org.jbpm.bpmn2.handler.SendTaskHandler;
      import org.jbpm.bpmn2.handler.ServiceTaskHandler;
      /**
       * This is a sample file to launch a process.
       */
      public class ProcessTest {
      
          public static final void main(String[] args) {
              try {
      
                  KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
                  kbuilder.add(ResourceFactory.newClassPathResource("TestingBPMN/TestingBPMN2.bpmn2"), ResourceType.BPMN2);
                  KnowledgeBase kbase = kbuilder.newKnowledgeBase();
      
                  StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
      
      
      
              } catch (Throwable t) {
                  t.printStackTrace();
              }
          }
      }
      
      
      
        • 1. Re: Issues oryx to jbpm
          Tobias Wittur Newbie

          Here I am making a simple mistake in oryx and the entire xml is lost.

           

          • 2. Re: Issues oryx to jbpm
            Tobias Wittur Newbie

            Here I modelled a message based process start in oryx. After manually shifting xml tags around, the process finally runs in eclipse:

             

            • 3. Re: Issues oryx to jbpm
              Tobias Wittur Newbie

              In this video, I am trying to model a service Task including:

               

              • an interface
              • an operation
              • a message

               

              The XML that is shown is basically what I want to reproduce in oryx. Unfortunately, after saving my process, all the entries are gone and also not produced in the output xml.

               

               

              Any hints about what I am doing wrong.

              • 4. Re: Issues oryx to jbpm
                Tihomir Surdilovic Master

                Hi Tobias, wow presenting your errors via videos is really cool! Thank you very much.

                 

                Issue #1: This issue goes back to the eclipse.bpmn2 ecore model which does not make sure the id property of the definitions node is of type xsd:NCName. I am working on fixing this in their ecore model and should have done soon.

                 

                Issue #2: Yes this is also a known Issue which I'm working on in Guvnor. When saving the process Guvnor gets the process JSON from the canvas (via JavaScript) and sends it over to Designer to convert it to BPMN2 format. If Designer is not able to to parse the JSON (because of simple issues or larger) it sends back a blank string to Guvnor, thus your process BPMN2 is gone. Best thing I can advise you until this is fixed to make sure you view the source becore saving your process changes. View source actually does the same steps (except saving bpmn2 in Guvnor) so you will see any possible errors without loosing them in Guvnor.

                We will also add a validation button to the toolbar which will allow you to view any errors/warnings before saving your process. Should have that done in about 3-5 weeks.

                 

                Issue #3: Again this goes to the eclipse.bpmn2 ecore model. If you look at Semantic.xsd it defines a sequence for the process element:

                 

                <xsd:element name="process" type="tProcess" substitutionGroup="rootElement"/>
                <xsd:complexType name="tProcess">
                <xsd:complexContent>
                <xsd:extension base="tCallableElement">
                <xsd:sequence>
                <xsd:element ref="auditing" minOccurs="0" maxOccurs="1"/>
                <xsd:element ref="monitoring" minOccurs="0" maxOccurs="1"/>
                <xsd:element ref="property" minOccurs="0" maxOccurs="unbounded"/>
                <xsd:element ref="laneSet" minOccurs="0" maxOccurs="unbounded"/>
                <xsd:element ref="flowElement" minOccurs="0" maxOccurs="unbounded"/>
                <xsd:element ref="artifact" minOccurs="0" maxOccurs="unbounded"/>
                <xsd:element name="supports" type="xsd:QName" minOccurs="0" maxOccurs="unbounded"/>
                </xsd:sequence>
                <xsd:attribute name="processType" type="tProcessType" default="none"/>
                <xsd:attribute name="isClosed" type="xsd:boolean" default="false"/>
                <xsd:attribute name="definitionalCollaborationRef" type="xsd:QName" use="optional"/>
                </xsd:extension>
                </xsd:complexContent>
                </xsd:complexType>

                 

                however when generating bpmn2 eclipse.bpmn2 does not seem to follow this sequence correctly. I'll look into this and will provide more info soon.

                 

                Issue #4: What Designer version are you testing with? Please show the bpmn2 shown in the xml editor of your video.

                 

                Thanks again for reporting all this

                1 of 1 people found this helpful
                • 5. Re: Issues oryx to jbpm
                  Tobias Wittur Newbie

                  I am using.

                   

                  Version: 1.0.0.054. I ll have to rebuild the BPMN. I ll provide it soon.

                  • 6. Re: Issues oryx to jbpm
                    Tobias Wittur Newbie

                    What I want to create in issue 4 looks as follows:

                     

                    • Message Based Start
                    • Script Node that prints the given message
                    • Service Task that invokes a handler
                    • End Node that throws the message

                    Capture4.PNG

                    On execution I get:

                    java.lang.IllegalArgumentException: No interfaces found

                     

                    So now I want to model:

                    • An operation
                    • An operation interface
                    • An operation message

                     

                    Something like this:

                     

                    <!--The Service Node Extract-->
                     <serviceTask id="_5" name="requestBadge" operationRef="webServiceRequestOperation" implementation="Other" >
                    
                    
                    <!--The Interface with operation-->
                      <interface id="webServiceRequestOperationInterface" name="presentation.webServiceInvokationClass">
                        <operation id="webServiceRequestOperation" name="invoke">
                          <inMessageRef>webserviceInvokationMessage</inMessageRef>
                        </operation>
                      </interface>
                    
                    <!--The message definition-->
                    <message id="webserviceInvokationMessage" itemRef="webserviceInvokationMessageType" />
                    <itemDefinition id="webserviceInvokationMessageType" structureRef="java.lang.Object" />
                    

                    Unfortunately, I was not successful modelling it with guvnor. Maybe I was entering it into the wrong fields? Everytime I fill out the fields in the video. It does not save it. So it is hard to debug anything. How do I define a message in guvnor?

                     

                     

                    The xml of the entire process is below, however without the interface, operation and message:

                     

                     

                    <?xml version="1.0" encoding="UTF-8"?>
                    <bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.omg.org/bpmn20" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:drools="http://www.jboss.org/drools" id="presentationValidId" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd" name="presentationProcessName" targetNamespace="http://www.omg.org/bpmn20">
                    
                        <!--Definitions-->
                      <bpmn2:itemDefinition id="_xItem"/>
                      <bpmn2:itemDefinition id="StartProcessMessageType"/>
                      <bpmn2:message id="StartProcessMessage" itemRef="StartProcessMessageType"/>
                      <bpmn2:itemDefinition id="EndProcessMessageType"/>
                      <bpmn2:message id="EndProcessMessage" itemRef="EndProcessMessageType"/> 
                      
                      <bpmn2:process id="presentationProcessId" drools:packageName="defaultPackage" drools:version="1" name="presentationProcessName" isExecutable="true">
                      
                        <!--Properties-->
                        <bpmn2:property id="x" itemSubjectRef="_xItem"/>
                        
                        <!--Message Based Start Node-->
                        <bpmn2:startEvent id="_AEE9964B-88A8-4C49-A23B-5D926317D0A7" name="Start Node">
                          <bpmn2:outgoing>_24D09853-59E4-4959-A8AE-FAD8CCC6B421</bpmn2:outgoing>
                          <bpmn2:dataOutput id="_AEE9964B-88A8-4C49-A23B-5D926317D0A7_Result" name="Result"/>
                          <bpmn2:dataOutputAssociation id="_sxGCoc7VEeCdCM8nk2gPTw">
                            <bpmn2:sourceRef>_AEE9964B-88A8-4C49-A23B-5D926317D0A7_Result</bpmn2:sourceRef>
                            <bpmn2:targetRef>x</bpmn2:targetRef>
                          </bpmn2:dataOutputAssociation>
                          <bpmn2:outputSet id="_sxGCoM7VEeCdCM8nk2gPTw">
                            <bpmn2:dataOutputRefs>_AEE9964B-88A8-4C49-A23B-5D926317D0A7_Result</bpmn2:dataOutputRefs>
                          </bpmn2:outputSet>
                          <bpmn2:messageEventDefinition id="_sxGpsM7VEeCdCM8nk2gPTw" drools:msgref="StartProcessMessage" messageRef="StartProcessMessage"/>
                        </bpmn2:startEvent>
                        
                        <!-- Script Task Printing-->
                        <bpmn2:scriptTask id="_7F49A4F7-2F98-4876-8972-F377446A6E38" name="Print Variables" scriptFormat="">
                          <bpmn2:incoming>_24D09853-59E4-4959-A8AE-FAD8CCC6B421</bpmn2:incoming>
                          <bpmn2:outgoing>_6CC0CC3F-9C91-45DF-93B2-58C7B1FDBD4D</bpmn2:outgoing>
                          <bpmn2:script>System.out.println(&quot;x: &quot;+x);</bpmn2:script>
                        </bpmn2:scriptTask>
                        
                        <!-- Message Throw End Event-->
                        <bpmn2:endEvent id="_4554B5DB-7555-474D-9D79-97D5FFAA22E4" name="End Node">
                          <bpmn2:incoming>_A11E7551-122B-4239-B1D7-055A583B475D</bpmn2:incoming>
                          <bpmn2:dataInput id="_4554B5DB-7555-474D-9D79-97D5FFAA22E4_Parameter" name="Parameter"/>
                          <bpmn2:dataInputAssociation id="_sxGpss7VEeCdCM8nk2gPTw">
                            <bpmn2:sourceRef>x</bpmn2:sourceRef>
                            <bpmn2:targetRef>_4554B5DB-7555-474D-9D79-97D5FFAA22E4_Parameter</bpmn2:targetRef>
                          </bpmn2:dataInputAssociation>
                          <bpmn2:inputSet id="_sxGpsc7VEeCdCM8nk2gPTw">
                            <bpmn2:dataInputRefs>_4554B5DB-7555-474D-9D79-97D5FFAA22E4_Parameter</bpmn2:dataInputRefs>
                          </bpmn2:inputSet>
                          <bpmn2:messageEventDefinition id="_sxGps87VEeCdCM8nk2gPTw" drools:msgref="EndProcessMessage" messageRef="EndProcessMessage"/>
                        </bpmn2:endEvent>
                        
                        
                        <bpmn2:sequenceFlow id="_24D09853-59E4-4959-A8AE-FAD8CCC6B421" sourceRef="_AEE9964B-88A8-4C49-A23B-5D926317D0A7" targetRef="_7F49A4F7-2F98-4876-8972-F377446A6E38"/>
                        
                        
                        <!--Service Task-->
                        <bpmn2:serviceTask id="_875157AA-39C3-429B-89D9-62ED5CF272DB" name="Webservice Request">
                          <bpmn2:incoming>_6CC0CC3F-9C91-45DF-93B2-58C7B1FDBD4D</bpmn2:incoming>
                          <bpmn2:outgoing>_A11E7551-122B-4239-B1D7-055A583B475D</bpmn2:outgoing>
                          <bpmn2:ioSpecification id="_sxGptM7VEeCdCM8nk2gPTw">
                            <bpmn2:dataInput id="_875157AA-39C3-429B-89D9-62ED5CF272DB_ParamInput" name="Param"/>
                            <bpmn2:dataOutput id="_875157AA-39C3-429B-89D9-62ED5CF272DB_ResultOutput" name="Result"/>
                            <bpmn2:inputSet id="_sxGptc7VEeCdCM8nk2gPTw">
                              <bpmn2:dataInputRefs>_875157AA-39C3-429B-89D9-62ED5CF272DB_ParamInput</bpmn2:dataInputRefs>
                            </bpmn2:inputSet>
                            <bpmn2:outputSet id="_sxGpts7VEeCdCM8nk2gPTw">
                              <bpmn2:dataOutputRefs>_875157AA-39C3-429B-89D9-62ED5CF272DB_ResultOutput</bpmn2:dataOutputRefs>
                            </bpmn2:outputSet>
                          </bpmn2:ioSpecification>
                          <bpmn2:dataInputAssociation id="_sxGpt87VEeCdCM8nk2gPTw">
                            <bpmn2:sourceRef>x</bpmn2:sourceRef>
                            <bpmn2:targetRef>_875157AA-39C3-429B-89D9-62ED5CF272DB_ParamInput</bpmn2:targetRef>
                          </bpmn2:dataInputAssociation>
                          <bpmn2:dataOutputAssociation id="_sxGpuM7VEeCdCM8nk2gPTw">
                            <bpmn2:sourceRef>_875157AA-39C3-429B-89D9-62ED5CF272DB_ResultOutput</bpmn2:sourceRef>
                            <bpmn2:targetRef>x</bpmn2:targetRef>
                          </bpmn2:dataOutputAssociation>
                        </bpmn2:serviceTask>
                        
                        <bpmn2:sequenceFlow id="_6CC0CC3F-9C91-45DF-93B2-58C7B1FDBD4D" sourceRef="_7F49A4F7-2F98-4876-8972-F377446A6E38" targetRef="_875157AA-39C3-429B-89D9-62ED5CF272DB"/>
                        <bpmn2:sequenceFlow id="_A11E7551-122B-4239-B1D7-055A583B475D" sourceRef="_875157AA-39C3-429B-89D9-62ED5CF272DB" targetRef="_4554B5DB-7555-474D-9D79-97D5FFAA22E4"/>
                        
                      </bpmn2:process>
                    
                      <bpmndi:BPMNDiagram id="_sxGpuc7VEeCdCM8nk2gPTw">
                        <bpmndi:BPMNPlane id="_sxGpus7VEeCdCM8nk2gPTw" bpmnElement="presentationProcessId">
                          <bpmndi:BPMNShape id="_sxGpu87VEeCdCM8nk2gPTw" bpmnElement="_AEE9964B-88A8-4C49-A23B-5D926317D0A7">
                            <dc:Bounds height="30.0" width="30.0" x="102.0" y="124.0"/>
                          </bpmndi:BPMNShape>
                          <bpmndi:BPMNShape id="_sxGpvM7VEeCdCM8nk2gPTw" bpmnElement="_7F49A4F7-2F98-4876-8972-F377446A6E38">
                            <dc:Bounds height="80.0" width="100.0" x="181.0" y="99.0"/>
                          </bpmndi:BPMNShape>
                          <bpmndi:BPMNShape id="_sxGpvc7VEeCdCM8nk2gPTw" bpmnElement="_4554B5DB-7555-474D-9D79-97D5FFAA22E4">
                            <dc:Bounds height="28.0" width="28.0" x="567.0" y="282.0"/>
                          </bpmndi:BPMNShape>
                          <bpmndi:BPMNEdge id="_sxGpvs7VEeCdCM8nk2gPTw" bpmnElement="_24D09853-59E4-4959-A8AE-FAD8CCC6B421">
                            <di:waypoint xsi:type="dc:Point" x="117.0" y="139.0"/>
                            <di:waypoint xsi:type="dc:Point" x="231.0" y="139.0"/>
                          </bpmndi:BPMNEdge>
                          <bpmndi:BPMNShape id="_sxGpv87VEeCdCM8nk2gPTw" bpmnElement="_875157AA-39C3-429B-89D9-62ED5CF272DB">
                            <dc:Bounds height="80.0" width="100.0" x="276.0" y="243.0"/>
                          </bpmndi:BPMNShape>
                          <bpmndi:BPMNEdge id="_sxGpwM7VEeCdCM8nk2gPTw" bpmnElement="_6CC0CC3F-9C91-45DF-93B2-58C7B1FDBD4D">
                            <di:waypoint xsi:type="dc:Point" x="231.0" y="139.0"/>
                            <di:waypoint xsi:type="dc:Point" x="326.0" y="139.0"/>
                            <di:waypoint xsi:type="dc:Point" x="326.0" y="283.0"/>
                          </bpmndi:BPMNEdge>
                          <bpmndi:BPMNEdge id="_sxGpwc7VEeCdCM8nk2gPTw" bpmnElement="_A11E7551-122B-4239-B1D7-055A583B475D">
                            <di:waypoint xsi:type="dc:Point" x="326.0" y="283.0"/>
                            <di:waypoint xsi:type="dc:Point" x="473.0" y="283.0"/>
                            <di:waypoint xsi:type="dc:Point" x="473.0" y="299.0"/>
                            <di:waypoint xsi:type="dc:Point" x="581.0" y="296.0"/>
                          </bpmndi:BPMNEdge>
                        </bpmndi:BPMNPlane>
                      </bpmndi:BPMNDiagram>
                    </bpmn2:definitions>
                    
                    • 7. Re: Issues oryx to jbpm
                      Tihomir Surdilovic Master

                      Regarding Issue 4: I recently added support for interfaces - https://issues.jboss.org/browse/JBPM-3321.

                      This will be in the next Designer release, but for now can you try with unofficial one (latest build from master) - http://people.redhat.com/tsurdilo/oryx/latest/ and let me know if that helps.

                      • 8. Re: Issues oryx to jbpm
                        Tihomir Surdilovic Master

                        Issue #1 now fixed in master.

                        • 9. Re: Issues oryx to jbpm
                          Tihomir Surdilovic Master

                          I understand the reason behind issue #3 now. It has to do with how EMF spits out elements when there is node inheritance going on. For example if in your ecore model you have

                           

                          NodeA -> NodeB (extends node B)

                                a

                                b

                           

                          NodeB (abstract = true)

                               x

                               y

                           

                          the output XML becomes:

                          <A>

                            <x/>

                            <y/>

                            <a/>

                            <b/>

                          </A>

                           

                          instead of

                           

                          <A>

                            <a/>

                            <b/>

                            <x/>

                            <y/>

                          </A>

                           

                          Looking into EMF docs to see if there is any setting that may help here. For now please disable schema validation when testing in Eclipse env.

                          • 10. Re: Issues oryx to jbpm
                            Tobias Wittur Newbie

                            Tihomir Surdilovic wrote:

                             

                            Regarding Issue 4: I recently added support for interfaces - https://issues.jboss.org/browse/JBPM-3321.

                            This will be in the next Designer release, but for now can you try with unofficial one (latest build from master) - http://people.redhat.com/tsurdilo/oryx/latest/ and let me know if that helps.

                             

                            Where exactly would I find the interfaces?

                             

                            In the shapes repository on the left or upon click on a service task within the properties on the right?

                            • 11. Re: Issues oryx to jbpm
                              Tihomir Surdilovic Master

                              Interface property of the Service task in the right-hand-side properties window.

                              1 of 1 people found this helpful