Selected variables to pass through the tasks

Hello,

I’ve been trying to find a way to define which variables are able to pass throw a task to another, but I haven’t been successful.

Our main problem is that we would like to exclude some variables from a task to another, due to security, however, we would like to do this by the bpmn modeler, something related to Input/Output values, without removing it manually. Our bpmn is a bit complex, so we need to block some variables in many parts of the flow, nevertheless we do not think that do it manually, using programming language, is a nice way, it looks like we are using too much code that will not be reused.

I would be delighted to know if you have any suggestions ?

Thanks

Best Regards,

Heloisa Carbone

You could simply remove the variables programmatically when you don’t need them rather than doing input/output

execution.removeVariable('SomeVar');

Yes, however we would like to have a more structural way to do this, because we have many variables that can’t follow the flow, and in the most parts, we use the same functions to do validations and process things, so it would be better to put in the bpmn the variables that couldn’t proceed due to the generalization that we already have, otherwise the project will start to be not so reusable…

Hi @Heloisa_Carbone,

you can add the variables to delete in properties to the activities (https://docs.camunda.org/manual/7.10/reference/bpmn20/custom-extensions/extension-elements/#properties) and use a global execution listener (https://docs.camunda.org/manual/7.10/user-guide/process-applications/process-application-event-listeners/).

Have a look at this example for a possible implementation: https://github.com/camunda/camunda-bpm-examples/tree/master/process-engine-plugin/bpmn-parse-listener#create-a-bpmn-parse-listener-implementation

This example moves the listener to the engine level, so it’s available on all process models in all process applications.

Hope this helps, Ingo

1 Like