Event Subscription

The Event Subscription control listens to be called by a control's event or a function, then grabs the event data that was published and performs the logic provided in the On Published Event.  Note that the event is published using the bpmext.ui.publishEvent() method.

Like almost all SPARK controls, you can trigger events that are fired when the user interacts with the control (see the Event and Methods sections below and the Event Handling article for more information).

Events can be published via two mechanisms: 1) view.ui.publishEvent(eventName, payloadData), 2) bpmext.ui.publishEvent(eventName, payload, persistence) if persistence is set to true, event listeners will fire, even if they load after the event actually fires (only available through bpmext)


Event Name Name of the subscribed-to event

On Published Event Logic that happens when specified event has occured


There are two Masked Text controls where the user enters in their credit card number and the Event Subscription will verify if the numbers match.

The code in the On Published Event is as follows:

 if(${CCN}.getText() == ${VerifyCCN}.getText() && (${CCN}.getText() != "" && ${VerifyCCN}.getText() != "")){${Input_Group1}.setIcon("check"); ${Tooltip1}.setText("Numbers Match"); ${Tooltip1}.setColorStyle("S"); ${Input_Group1}.setColorStyle("S") } else {${Tooltip1}.setText("Numbers Don't Match");  ${Tooltip1}.setColorStyle("E"); ${Input_Group1}.setIcon("close"); ${Input_Group1}.setColorStyle("G") }

the text that is green are the control ids for the Masked Text, Tooltip, and Input Group controls:

1st Masked Text control id is CCN and has an On Change event:

 2nd Masked Text control id is VerifyCCN and has an On Change event:

The 2nd Masked Text control is inside of a Tooltip control which is inside of an Input Group control.

This is the result when the credit card numbers match...

And when they don't match...

Note: In order to publish an event, you need to call ui.publishEvent.  The Event Subscription control will read the publication and you can handle the name and data accordingly through the On Published Event.


With the Event Subscription control, there is 1 type of event handler:

  • On Published Event When the event has published

You can use JavaScript logic to affect the effects of the control, depending on the event. More information on using these controls can be found in the Event Handling article.


For detailed information on the available methods for this control, access the JS Doc file.


  • Author: Courtney Silva
  • Date Created: June 29, 2015
  • Date Modified: August 3, 2015
Was this article helpful?
0 out of 0 found this helpful