DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Trending

  • The Observability Gap: Why Your Monitoring Strategy Isn't Ready for What's Coming Next
  • WebSockets, gRPC, and GraphQL in the Core
  • Scaling Teams, Scaling Systems: Unlocking Developer Productivity With Platform Engineering
  • Engineering Complexity: Implied vs. Induced Complexity

Dynamic Signaling for Managing Communication Between Two Separate BPMN Flows

This post explains how to implement Dynamic Signaling in BPMN processes or event sub-processes to execute particular process instances or threads.

By 
Radhika K user avatar
Radhika K
·
Mar. 24, 22 · Tutorial
Likes (3)
Comment
Save
Tweet
Share
2.4K Views

Join the DZone community and get the full member experience.

Join For Free

This document explains how to implement Dynamic Signaling in BPMN processes or event sub-processes to execute particular process instances or threads.

Problem Statement:

  • A signal event is generally used to communicate between two separate BPMN flows.
  • However, the signal event has a global scope. It will broadcast the event to all related sub-flows and handlers.

Whenever BPMN interacts with multiple requests, it is difficult for the process engine to identify the exact instance to process. There is also the possibility of the thrown signal getting caught by all active handlers and multiple requests at a time, which may lead to wrong execution. 

Solution:

The above-mentioned issue can be overcome with Dynamic Signaling.

  • It is possible to map the signal in a dynamic way so that BPMN will broadcast the signal for a particular or specific process instance, based on the configured signal name.
  • Dynamic catch signal event configured name will receive that signal and proceed to next task.
  • Configured signal name can be anything from process variable, which is unique for that process instance.  An example is “business key,” which usually is unique against each process instance. In business key, we can pass any process variable or entity id like orderId.

Ex.: The signal name could be Signal_dynamic_${orderId}.

Steps To Follow:

Create BPMN with throw signal event:       Create BPMN with throw signal event

Add Signal Name as Signal_dynamic_${businessKey}  example Signal_dynamic_${orderId}.

Create another BPMN with catch signal.

Add same signal name as throw event - Signal_dynamic_${orderId}.

Add same signal name as Throw event - Signal_dynamic_${orderId}

Now, deploy both the files in the Camunda server. Open Camunda Cockpit and check if you have both the processes present in Cockpit.

Open Camunda Cockpit and check if you have both the processes present in CockpitNow start the process with the catch signal event.

Pass orderId = 1:

Pass orderId = 1

Pass orderId = 2:

Pass orderId = 2

It will create two instances with different orderIds as follows:

Two instances with different orderIds

Now start another BPMN with throw signal event, and pass orderId as a variable, passing it as orderId = 2.Start another BPMN with throw signal event

Check the first process with the catch signal event. It will catch signal with orderId = 2, and proceed to the next task.

Check the first process with the catch signal event

Our first process instance with orderId = 1 will remain at the same position.

 first process instance with orderId = 1 will remain at the same position

Opinions expressed by DZone contributors are their own.

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook