7 Replies Latest reply on Nov 25, 2013 1:31 AM by Maciej Swiderski

    Error when creating a new service task

    Aboalkhair Sous Newbie

      Hello,

       

      I'm creating a process which contains a service task as following:

      1. Create a new process.
      2. Add a service task.
      3. Create Java Interface.
      4. Import the interface to the process.
      5. In Service task, I put one of the interface method as an operation.

       

      When I try to save the process, it gives me error " No messages found".

      What do I miss in this process??

       

      I'm using JBPM 6.0.

      Any help will be appreciated.

       

      Best regards,

      A. Sous.

        • 1. Re: Error when creating a new service task
          Maciej Swiderski Master

          on service task you need to reference operation.

           

          would be good if you could attache the bpmn2 file here so we could take a look at that.

           

          HTH

          • 2. Re: Error when creating a new service task
            Aboalkhair Sous Newbie

            Hello,

            Thanks for your reply..

             

            Here is the xml I use when getting the error mentioned above:

             

            <?xml version="1.0" encoding="UTF-8"?>

            <bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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:tns="http://www.jboss.org/drools" xmlns="http://www.jboss.org/drools" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd http://www.jboss.org/drools drools.xsd http://www.bpsim.org/schemas/1.0 bpsim.xsd" id="Definition" expressionLanguage="http://www.mvel.org/2.0" targetNamespace="http://www.jboss.org/drools" typeLanguage="http://www.java.com/javaTypes">

              <bpmn2:itemDefinition id="ItemDefinition_1" itemKind="Physical" structureRef="java.lang.String"/>

              <bpmn2:interface id="Interface_1" implementationRef="defaultPackage.InterfaceI" name="InterfaceI">

                <bpmn2:operation id="Operation_1" implementationRef="print1" name="print1">

                  <bpmn2:inMessageRef>InterfaceI_print1_str</bpmn2:inMessageRef>

                  <bpmn2:outMessageRef>InterfaceI_print1_Result</bpmn2:outMessageRef>

                </bpmn2:operation>

                <bpmn2:operation id="Operation_2" implementationRef="print2" name="print2">

                  <bpmn2:inMessageRef>InterfaceI_print1_Result</bpmn2:inMessageRef>

                  <bpmn2:outMessageRef>InterfaceI_print1_str</bpmn2:outMessageRef>

                </bpmn2:operation>

              </bpmn2:interface>

              <bpmn2:message id="InterfaceI_print1_str" itemRef="ItemDefinition_1" name="InterfaceI_print1_str"/>

              <bpmn2:message id="InterfaceI_print1_Result" itemRef="ItemDefinition_1" name="InterfaceI_print1_Result"/>

              <bpmn2:process id="com.sample.bpmn" tns:version="1" tns:packageName="defaultPackage" tns:adHoc="false" name="Sample Process" isExecutable="true" processType="Private">

                <bpmn2:extensionElements>

                  <tns:import name="defaultPackage.InterfaceI"/>

                  <tns:import name="java.lang.String"/>

                </bpmn2:extensionElements>

                <bpmn2:property id="StringVar" itemSubjectRef="ItemDefinition_1"/>

                <bpmn2:startEvent id="_1" name="">

                  <bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing>

                </bpmn2:startEvent>

                <bpmn2:serviceTask id="ServiceTask_1" name="Service Task 1" isForCompensation="true" implementation="##unspecified" operationRef="Operation_2">

                  <bpmn2:extensionElements>

                    <tns:onEntry-script scriptFormat="http://www.java.com/java">

                      <tns:script></tns:script>

                    </tns:onEntry-script>

                    <tns:onExit-script scriptFormat="http://www.java.com/java">

                      <tns:script></tns:script>

                    </tns:onExit-script>

                  </bpmn2:extensionElements>

                  <bpmn2:incoming>SequenceFlow_1</bpmn2:incoming>

                  <bpmn2:outgoing>SequenceFlow_2</bpmn2:outgoing>

                </bpmn2:serviceTask>

                <bpmn2:sequenceFlow id="SequenceFlow_1" tns:priority="1" sourceRef="_1" targetRef="ServiceTask_1"/>

                <bpmn2:endEvent id="EndEvent_1" name="">

                  <bpmn2:incoming>SequenceFlow_2</bpmn2:incoming>

                </bpmn2:endEvent>

                <bpmn2:sequenceFlow id="SequenceFlow_2" tns:priority="1" sourceRef="ServiceTask_1" targetRef="EndEvent_1"/>

              </bpmn2:process>

              <bpmndi:BPMNDiagram id="BPMNDiagram_1">

                <bpmndi:BPMNPlane id="BPMNPlane_Process_1" bpmnElement="com.sample.bpmn">

                  <bpmndi:BPMNShape id="BPMNShape_StartEvent_1" bpmnElement="_1">

                    <dc:Bounds height="36.0" width="36.0" x="45.0" y="45.0"/>

                  </bpmndi:BPMNShape>

                  <bpmndi:BPMNShape id="BPMNShape_ServiceTask_1" bpmnElement="ServiceTask_1">

                    <dc:Bounds height="50.0" width="110.0" x="186.0" y="38.0"/>

                  </bpmndi:BPMNShape>

                  <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_1" bpmnElement="SequenceFlow_1" sourceElement="BPMNShape_StartEvent_1" targetElement="BPMNShape_ServiceTask_1">

                    <di:waypoint xsi:type="dc:Point" x="81.0" y="63.0"/>

                    <di:waypoint xsi:type="dc:Point" x="186.0" y="63.0"/>

                  </bpmndi:BPMNEdge>

                  <bpmndi:BPMNShape id="BPMNShape_EndEvent_1" bpmnElement="EndEvent_1">

                    <dc:Bounds height="36.0" width="36.0" x="364.0" y="45.0"/>

                  </bpmndi:BPMNShape>

                  <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_2" bpmnElement="SequenceFlow_2" sourceElement="BPMNShape_ServiceTask_1" targetElement="BPMNShape_EndEvent_1">

                    <di:waypoint xsi:type="dc:Point" x="296.0" y="63.0"/>

                    <di:waypoint xsi:type="dc:Point" x="364.0" y="63.0"/>

                  </bpmndi:BPMNEdge>

                </bpmndi:BPMNPlane>

              </bpmndi:BPMNDiagram>

            </bpmn2:definitions>

             

            pic1.PNG

             

            I'm using Eclipse tool..

             

            Best regards,

            A. Sous.

            • 3. Re: Error when creating a new service task
              Maciej Swiderski Master

              looks like the issue is caused by the order of elements in xml. message elements are after interface element. Would you mind moving these elements manually (by editing xml) to be before interface? Currently the parser is order sensitive so it might be because of that.

               

              HTH

              • 4. Re: Error when creating a new service task
                Aboalkhair Sous Newbie

                Thanks for your reply Maciej.

                It gives me a new error when putting the message elements before the interface element (Error importing the interface):

                 

                pic2.PNG

                 

                Please, suggest me another solution..

                 

                Best regards,

                A. Sous.

                • 5. Re: Error when creating a new service task
                  Maciej Swiderski Master

                  is the error only when modeling or when running the process you get that error too?

                   

                  HTH

                  • 6. Re: Error when creating a new service task
                    Aboalkhair Sous Newbie

                    The error appears when I try to save the changes. I also try to create a unit test, but it doesn't work because of this error.

                    pc3.PNG

                    • 7. Re: Error when creating a new service task
                      Maciej Swiderski Master

                      just noticed one thing - interface name and implementationRef in your process definition. When defining java interface in there make sure that the name of interface is actually FQCN of the interface to invoke. For simple java invocation the implemnetationRef is not used, it is only used for WebService based service tasks.

                       

                      P.S.

                      One thing to check for BPMN2 modeler in eclipse, when you go to Eclipse preferences and find the BPMN2 settings, please make sure that you have selected jBPM as the engine as that will slightly change the feature set of the modeler.

                       

                      HTH