# Can I add wait state in BpmnParseListener?

**URL:** <https://forum.camunda.io/t/can-i-add-wait-state-in-bpmnparselistener/52881>\
**Category:** Camunda 7 Topics\
**Created:** [June 3, 2024, 11:59am UTC](https://forum.camunda.io/t/can-i-add-wait-state-in-bpmnparselistener/52881 "2024-06-03T11:59:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![UMeAndTheSilence](https://forum.camunda.io/letter_avatar_proxy/v4/letter/u/b782af/32.png) [@UMeAndTheSilence](https://forum.camunda.io/u/UMeAndTheSilence)\
**Post date:** [June 3, 2024, 11:59am UTC](https://forum.camunda.io/t/can-i-add-wait-state-in-bpmnparselistener/52881/1 "2024-06-03T11:59:04Z")

</div>

I want to add wait state after service tasks of certatin java delegate, without having to explicitly add wait state like task/message when non-developer drawing bpmn, is it possible?  
I already did learn to add AbstractBpmnParseListener for adding async continuation, but still couldn’t figure out how to add wait state, which actually make process engine to wait.  
Scenario: some of my service tasks are always followed by user tasks that always configured the same way.

---

<div class="post-metadata">

**Author:** ![UMeAndTheSilence](https://forum.camunda.io/letter_avatar_proxy/v4/letter/u/b782af/32.png) [@UMeAndTheSilence](https://forum.camunda.io/u/UMeAndTheSilence)\
**Post date:** [August 9, 2024, 7:13am UTC](https://forum.camunda.io/t/can-i-add-wait-state-in-bpmnparselistener/52881/2 "2024-08-09T07:13:07Z")

</div>

By extending **AbstractBpmnActivityBehavior** like _ReceiveTask_ which only leave(execution) in signal, I managed to create a “DoSthAndWaitTask” which can execute business logic then response, until users make another request signals it and the process instance moves on.  
I also managed to make gateway “wait" by “activity.setActivityBehavior(new MyCustomMenuGatewayBehavior())” in start execution listener.

---

<div class="post-metadata">

**Author:** ![system](https://forum.camunda.io/uploads/default/original/3X/5/8/58d50142eacca605d35cb1ef9e6b86ae85f49436.png) [@system](https://forum.camunda.io/u/system)\
**Post date:** [August 21, 2024, 7:08am UTC](https://forum.camunda.io/t/can-i-add-wait-state-in-bpmnparselistener/52881/3 "2024-08-21T07:08:01Z")

</div>

Closed on August 21, 2024, 7:08am UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
