How do I listen for custom event and only move forward if certain conditions are met

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-19-2017 10:08 AM
I have a simple process with a a receive task. ( I am ok with any other task type).
I want the receive task to move forward only if an event is received with event type CUSTOM and message="Move Forward"
How do I create a listener for this scenario and how do I throw event using Java API along with message variable.
- Labels:
-
Alfresco Process Services
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-20-2017 03:48 AM
Have you tried in the way that it is described in the documentation? -> Activiti User Guide ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2017 12:30 AM
Hi Mauricio -
I have been scratching my head on this. I have read all of these. Nowhere I see an event ExecutionListener that says "oh the message I got is not the one I care about so I will not the wait task to move forward". How can an ExecutionListener prevent a task from moving forward depending what message variable it receives?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2017 12:15 AM
Hi, Sude Bhat‌
You can use the event listeners to and set a custom variable value i.e. message="Move Forward" as and check the forward if value is same then do what you want,
Refer this documentation , How to create Activiti Event Listener with Spring Boot Example - JavaSampleApproach
Thanks,
Kalpesh,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2017 12:35 AM
Hi Kalpesh -
But in this case, the right approach would be to use ExecutionListner right? I read ActivitiEventListener can be only defined at the process level.
I am at "Receive Task" and I want Receive Task to only move forward if I get message="Move Forward". So I have to put the logic in Receive Task right?
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2017 08:20 AM
Yes.
