cancel
Showing results for 
Search instead for 
Did you mean: 

To invoke a method Expression

abhilashs
Champ in-the-making
Champ in-the-making
Hi,

I am trying to invoke a method Expression. But I am not able to call the method from the Delegate. And its giving : org.activiti.engine.ActivitiIllegalArgumentException: Field definition uses unexisting field 'testService' on class com.activiti.test.bpm.WebserviceTask

I need to know how exactly the method is invoked from the Service Task using the Expression? Should the method be in same Service Task or elsewhere?

Expression configured in BPMN:
  <serviceTask id="webService_task_id" name="WebService Task" activiti:class="com.activiti.test.bpm.WebserviceTask">
      <extensionElements>
        <activiti:field name="testService">
          <activiti:expression><![CDATA[testService.testMethod()]]></activiti:expression>
        </activiti:field>
      </extensionElements>
    </serviceTask>

Thanks
Abhilash S
1 REPLY 1

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Abhilash,

ReflectionUtils did not find any field with the name testService in the class WebserviceTask. That's the cause of the error.
Can you create jUnit test?
https://forums.activiti.org/content/sticky-how-write-unit-test

Regards
Martin