logo

NJP

ServiceNow Things to Know 90: broadcastEvent in Workflow

Import · Jan 24, 2024 · article

Hello Everyone,

Explanation - The broadcast event sends the specified event (message) into the workflow context to pass along to the executing activities.

The typical use of this method is to enable activities that wait for some action to occur before proceeding.

Syntax — broadcastEvent(String contextId, String eventName)

For Example —

//where the current is a task record with a workflow context

var wf = new Workflow().getRunningFlows(current);while(wf.next()) {new Workflow().broadcastEvent(wf.sys_id, ‘resume’);

}

If my content helped you in anyway, please mark this content as BOOKMARK, SUBSCRIBE & HELPFUL

Best Regards,

Prashant Kumar (LearnIT)

YouTube Channel LearnIT: https://www.youtube.com/@learnitwithprashant

Blog LearnIT: https://medium.com/@LearnITbyPrashant

Prashant Kumar LinkedIn: https://www.linkedin.com/in/learnitbyprashant/

ServiceNow Community Prashant Kumar - https://www.servicenow.com/community/user/viewprofilepage/user-id/19635

View original source

https://www.servicenow.com/community/developer-blog/servicenow-things-to-know-90-broadcastevent-in-workflow/ba-p/2802818