Custom Event

Learn how to trigger customer events outside of PopFlow.

Last published at: May 12th, 2022

Purpose

This article will cover how to implement an extension to allow for a PopFlow Workflow to be triggered via a Oracle Webbui B2C Workspace (button, link, etc.).


When to use

The Webbui PopFlow Solution enables an ability to invoke a PopFlow Workflow via an outside system trigger event, such as a button on a workspace. OpenMethods Clients have used this feature to streamline processes such as allowing for Agents to trigger an external system lookup into ordering systems or to escalate an incident to a 3rd party system.


How to implement

The steps to implement are:

  1. Configure a PopFlow Workflow within PopFlow Studio.
  2. Configure and implement an Oracle extension (downloadable from this article)
  3. Configure Oracle B2C Platform with the appropriate trigger mechanisms.


1. Create PopFlow Workflow

Please see article on how to create a Custom Event PopFlow Workflow.


2. Download, modify and deploy the Oracle B2C extension

  1. Download the extension: om_custom_trigger.zip
  2. Modify the extension for your deployment environment. The only part that should be modified is the config object. This contains an array of events to listen to and the data fields to capture when executing a PopFlow.


Each configuration object is made up of 3 parts:

  • oracleEvent - This is the event that is being listened to within the OSvC workspace.
  • popflowEvent - This is the name of the PopFlow that should be invoked when an event is detected.
  • fields - These are the fields that should be captured.


Delete

Info

Use Oracle’s BUI field mappings for more information on how to get the field names. Field Name Mappings


New DOM event listeners (6.9.10 +)

What has changed

New functionality has been added in the configuration section of the om_custom_trigger.html. You can now find a new configurable property called domBindingTypes.

The new property will allow the extension to bind to DOM events when interacting with the Workspace Control. Once bound, the propagated events will now be detected by PopFlow. This in turn can execute any PopFlow workflow.

How does it work

Lets take the following configuration as an example

let configs = [
    {
        "fields": ["Incident.Subject"],
        "popflowEvent": "Custom Event 1",
        "domBindingTypes": ["focus"] // <== the new property
    }
];


When the extension is installed an configured properly, the extension will bind to the Workspace controls defined in the fields property. In this case we are binding to the Incident.Subject control. 


The type of bindings will be defined in the domBindingTypes. In this example, we want to trigger a PopFlow when a focus event is propagated on the Workspace control. 

Demonstration of the focus event firing



This will in turn run the PopFlow defined in the popflowEvent property. 

What type of DOM bindings can I do?

Any type of DOM bindings are allowed, but the recommended ones are focus, blur, change, and click.


Text
let config = [{
	"oracleEvent": "Event1", // modify to the triggered named event in the Oracle workspace
	"popflowEvent": "Custom Event1", // modify to the custom event you want to trigger in PopFlow 
	"fields": ["Incident.IId", "Contact.Email.Addr", "Contact.CId"] // modify this to add or remove workspace keys that you want to capture a value for popflow to use
}];
  1. In your Oracle B2C instance, go to Site Configuration > Add-In manager. Install the om_custom_trigger.html as a Workspace Extension.


3. Configure Oracle

  1. Add it to the workspace - In order for the extension to work properly, you will need to add it to the workspace that you intend to use. Find the workspace and drag the extension onto the workspace using the Insert Control > Agent Browser UI Extensions options via the ribbon options.
  2. Add the event - An event needs to be added to the workspace that matches the oracleEvent value. In this example, we are going to add this event via a button.
  3. In the workspace, add a button dragging it onto the workspace via the Insert Control in the ribbon.
  4. Then click on the button and go to Rules in the ribbon.
  5. Click on Add Rule.
  6. Add the A button is clicked rule and click on Next.
  7. You can add a condition if needed, but in this example, we will not need one. Click on Next.
  8. Now add the Fire a named event action.
  9. In the bottom panel, click on the named event link. Add the event value used in the oracleEvent configuration. Click OK and then click Finish.


You have now just added a button that will fire an event. You can now test the workspace and the button. If wired correctly, it will trigger the configured PopFlow to run.


Troubleshooting

  • Double-check that the casing of the event name and PopFlow name match exactly to what is configured / created.
  • Be sure that the extension is installed and on the correct workspace.
  • Make sure that the CRM profile has access to the workspace or has the workspace assigned to them.

Related Articles

  • Incident Save

    Integration Specific Information The information in this article is specific to t...

  • Click To Dial

    "Click-to-Dial" functionality automatically dials a telephone number through an a...

  • Provisioning

    Assumptions: Web applications are deployed. Config Server has been provisioned. C...

  • OM Custom Trigger update

    What has changed New functionality has been added in the configuration section of...