AnsweredAssumed Answered

Process with WebService Task never ends

Question asked by dankre on Mar 25, 2011
Latest reply on Mar 28, 2011 by jbarrez
Hi,

during my tests with webservices, I noticed that the started process never ends. If I check what the process is actually doing, it is still at the webservice task. So, after calling the webservice, the task is not completed automatically. Am I doing something wrong?

You can reproduce it with the activiti-cxf-examples. Remove the receiveTask from WebServiceTaskTest.testWebServiceInvocation.bpmn20.xml



  <process id="webServiceInvocation">

    <startEvent id="theStart" />

    <sequenceFlow id="flow1" sourceRef="theStart" targetRef="webService" />

    <serviceTask id="webService"
                 name="Web service invocation"
                 implementation="##WebService"
                 operationRef="tns:incOperation" />

    <sequenceFlow id="flow2" sourceRef="webService" targetRef="theEnd" />

    <endEvent id="theEnd" />

  </process>


Add a check to WebServiceTaskTest.java



    @Deployment
    public void testWebServiceInvocation() throws Exception {
       
       assertEquals(-1, counter.getCount());
       
       ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("webServiceInvocation");
       waitForJobExecutorToProcessAllJobs(10000L, 250L);

       assertTrue(processInstance.isEnded());
       
       assertEquals(0, counter.getCount());
    }


Regards
Daniel

Outcomes