Skip expression in Flowable modeler-UI

Hi,

i am trying to set the skip expression in flowable modeler ui.

My scenario:
i have a variable “MODE” which has some value. Now when i reach the particular service task, i would like to check this variable “MODE” and see if it is equating to a some string, i.e in the skip expression attribute of the service task i would give the expression as:
${MODE == “simulation”}

Additionally, according to the documentation, i have also set the process variable
_ACTIVITI_SKIP_EXPRESSION_ENABLED to boolean value “true”.
How-ever, i tried executing the process, but the service task gets executed as before without a skip expression, where-as with this definition of skip expression defined in the flowable modeler ui for a service task, i would have expected the service task to be skipped.

Could you kindly let me know where am i going wrong here ? (answer preferably from flowable modeler ui perspecive please).

Hi @Param

How do you set the variables?

With the following example the method myService.doSomething() is not called.

Set variables and start process:

Map<String, Object> varMap = new HashMap<>();
varMap.put("mode", "simulation");
varMap.put("_ACTIVITI_SKIP_EXPRESSION_ENABLED", true);
runtimeService.startProcessInstanceByKey("myProcess", varMap).getId();

Service Task within process:

<serviceTask id="serviceTask1" activiti:expression="{myService.doSomething()}" activiti:skipExpression="${mode == 'simulation'}"/>

Regards,
Simon

Hi Simon,

Thanks for your response.
I work only on the modeler UI and looking for a solution on the modeler UI perspective as i am not a JAVA developer :frowning:
I set the process variables in the flowable modeler UI, using the process attribute “Data Objects” and here i initialize
MODE and _ACTIVITI_SKIP_EXPRESSION_ENABLED, as seen in the screenshot below slight_smile:

And to add a skip expression, i select the relevant service task and add the expression as {$MODE == “simulation”} and you can see that in the below screenshot:

I have nothing on the service task Expression field, but we have a JAVA class defined in the “class” attribute and parameters defined in “class fields” attribute, will be executed for performing some activity in the background.
Hope this explains my scenario in a better way.

Regards,
Param

Looking at the code, that should work. Is there a way you could paste your (simplified) xml so we can try?

Which interface does the class you reference in the service task implement? JavaDelegate of ActivityBehavior?

Hi @Param ,
I landed in same situation. Were you able to fix the problem? If so, can you please let me know how?