2 Replies Latest reply on Apr 26, 2016 6:16 AM by Sergei Makarov

    After creating .wid file in jbpm6 project within Eclipse cannot longer open .bpmn

    Sergei Makarov Newbie

      Hello,

       

      would like to register my own Task with WorkItemHandler, with simple Start->Task->End, but have always follows error: "Task node 'Task'[2] has no work name" in jbpm6.1.0.Final and Task node 'Task'[2] has no task type" in jbpm6.3.0.Final accordingly. I believe, that registring my own Task through WorkDefinition File can resolve my problem, but as i just add .wid file in META-INF, cannot longer open my .bpmn/.bpmn2 file. Registring .wid file with drools.rules.conf doesn't resolve the problem.

       

      Maybe you know how can i register task type another way. Appreciate your help.

       

      Eclipse: Luna, jbpm6, bpmn-modeller: 1.6

        • 1. Re: After creating .wid file in jbpm6 project within Eclipse cannot longer open .bpmn
          Abhijit Humbe Master

          What exception you are facing while opening BPMN process ? Can you share sample project with us ?

          • 2. Re: After creating .wid file in jbpm6 project within Eclipse cannot longer open .bpmn
            Sergei Makarov Newbie

            there is no any error, that't the point, just gray canvas on the place of modeler. There error "no task type" persists.

            Have you any idea, how i could  define a Task Type otherwise?

             

            Snippet of .bpmn model

             

            </bpmn2:startEvent>

                <bpmn2:task id="Task_1" name="Task">

                  <bpmn2:extensionElements>

                    <tns:metaData name="elementname">

                      <tns:metaValue><![CDATA[Task]]></tns:metaValue>

                    </tns:metaData>

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

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

                  </bpmn2:extensionElements>

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

                  <bpmn2:outgoing>SequenceFlow_3</bpmn2:outgoing>

                  <bpmn2:ioSpecification id="InputOutputSpecification_2">

                    <bpmn2:inputSet id="InputSet_1" name="Input Set 1"/>

                    <bpmn2:outputSet id="_OutputSet_2" name="Output Set 2"/>

                  </bpmn2:ioSpecification>

                </bpmn2:task>

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

                <bpmn2:endEvent id="EndEvent_1" name="End Event 1">

                  <bpmn2:extensionElements>

                    <tns:metaData name="elementname">

                      <tns:metaValue><![CDATA[End Event 1]]></tns:metaValue>

                    </tns:metaData>

                  </bpmn2:extensionElements>

                  <bpmn2:incoming>SequenceFlow_3</bpmn2:incoming>

                </bpmn2:endEvent>

             

            jUnitTest.java

             

            import com.sample.ItemHandler;

             

            public class Hello_WorldJUnitTest extends JbpmJUnitTestCase {

             

                @Test

                public void test() {

                    KieSession ksession = createKnowledgeSession("sample.bpmn");

                    ksession.getWorkItemManager().registerWorkItemHandler("Task", new ItemHandler());

                    ProcessInstance processInstance = ksession.startProcess("com.sample.bpmn.hello");

                    // if necessary, complete request for service task ""

                    // do your checks here

                    // for example, assertProcessInstanceCompleted(processInstance.getId(), ksession);

                }

            }

             

            CustomItemHandler.java

             

             

            public class ItemHandler implements WorkItemHandler {

                Map<String, Object> param = new HashMap<String, Object>();

                WorkItem wi;

                @Override

                public void abortWorkItem(WorkItem arg0, WorkItemManager arg1) {

                    System.out.println("Work is aborted");

                }

             

                @Override

                public void executeWorkItem(WorkItem arg0, WorkItemManager arg1) {

                    System.out.println("You are welcome!");

                    arg1.completeWorkItem(arg0.getId(), param);

                }

               

            }