Alternatives to skipExpression?

Hi there,

I’m on my way to migrate Activiti to Camunda in our Information System and 99% of things are fine. But there is an Activiti feature we used a lot and, before changing all our BPMN, I want to be sure there is no other alternative in Camunda.

Activiti feature was : activiti:skipExpression. This expression is totally ignored by Camunda Process Engine.

This feature seems to be out of the scope right now : Operating Camunda 7 | Camunda Platform 8 Docs

In this post, a basic (and legit !) alternative is submitted by someone : How to skip a task in camunda?

But I’m just asking myself : is there another viable workaround who avoid me to change every BPMN in our system ?

Thanks a lot,
Matthieu

Hi Matthieu, you may want to think about using process instance modification APIs to skip tasks. With process modification you can move the process as needed. For more information see: https://docs.camunda.org/manual/latest/user-guide/process-engine/process-instance-modification/

I’m thinking it could be used in a listener at the start of a task. I’ll have a look at it to see if it’s feasible

Joe

Here’s an example though it seems to create two tasks which disappear when one is completed, still need to investigate. The code is as follows:
execution.getProcessEngineServices().getRuntimeService().createProcessInstanceModification(execution.getProcessInstanceId()).startAfterActivity(execution.getCurrentActivityId()).cancelActivityInstance(execution.getActivityInstanceId()).execute()

Hi Joe,

Thanks a lot for this workaround. I’m a beginner with Camunda and I was not aware of all possibilities with process modification who could replace well the old “attribute”.

I’ll do my tests but it seems very clear to me.

Thanks again,
Matthieu

Hi Matthieu,
Trying to modify a process from within a process can lead to unpredictable behavior which is what I discovered earlier in the thread so it should not be your course of action. Using the APIs outside the context of the process will work. I’m imagining a service that could be called from an activity and that service could then modify the process instance via REST, say. Make sense?

Joe

Hi Joe,

Yes, I understand well what you explained and it make sense to me.

Thanks again,
Matthieu