BPM:how to create a task modifying a field of an entity #1698

I implemented the BMP solution. It works perfectly. I need when modifying a field of an entity to generate a control task. How can I do that

Thank you.

I would like to implement something like this

bpmn

Hi,

Do I understand you task right and what you need is to move the execution from the “emitir contratos” task to the “analizar costos” task when some entity field changes?

If so, then you can try the following:

  1. Create some managed bean that constructs a signal event to the particular process instance: http://www.activiti.org/userguide/index.html?_ga=1.152601968.81805794.1491806686#bpmnSignalEventDefinition. The activiti RuntimeService can be injected to your bean.

  2. Create an entity listener: https://doc.cuba-platform.com/manual-6.4/entity_listeners.html

  3. In the listener invoke the bean method that throws an event.

Thanks

Yes this is my question.

I understand that I have to invoke the signal from the listener.

   RuntimeService.signalEventReceived(String signalName, String executionId);

Now my question is how can I get the executionId associated with the entity.

Thanks

Thanks

Yes this is my question.

I understand that I have to invoke the signal from the listener.

RuntimeService.signalEventReceived(String signalName, String executionId);
Copy to clipboard

Now my question is how can I get the executionId associated with the entity.

Thanks

You must find the corresponding ProcTask entity instance. It has an actExecutionId field. That’s what you’re looking for. Just in case, here is the data model: https://doc.cuba-platform.com/bpm-6.4/datamodel.html