AnsweredAssumed Answered

Activiti Wait and Trigger implementation

Question asked by saurabh.biet on Jul 26, 2016
Latest reply on Jul 28, 2016 by saurabh.biet
I am reading and learning Activiti. While doing the same I tried to incorporate a workflow where:
1. Start event triggers an EMAIL having 2 links approve and reject
2. Once user approves/reject, I want to update the status of the same in database.
3. Irrespective of approve/reject downstream service is notified about the same.

Workflow diagram:

So far, what I understood, I created a service-task which is responsible for generating the email. - WORKS FINE (I am using downstream service of mine to generate the email with approve and reject buttons).

After this I add a Boundary-Signal to the task so that the workflow waits (I assumed that the state is persisted to H2).

When the user clicks on approve/reject buttons, I get the call on my REST service and get the activiti execution-id.

I tried to trigger the signal so that the workflow can start but failed to do so.

I tried the following code:

getRuntimeService().signalEventReceived("Approve Or Reject Signal", request.getExecutionId(), activitiContext);

But the above statement ends up in an error "org.activiti.engine.ActivitiObjectNotFoundException: Cannot find execution with id '9'"

I have 2 questions:
1. Am I doing anything wrong here?
2. I tried to browse and got to know that "receive-task" should be used but failed to find any example of how it can be used?

Any help will be appreciated.