<img height="1" width="1" style="display:none;" alt="" src="https://dc.ads.linkedin.com/collect/?pid=287945&amp;fmt=gif">

FlowWright Enterprise Service Bus (ESB)

FlowWright has a powerful ESB that is similar to a traditional publisher-subscriber model, but a one that improves that model to improve performance.  FlowWright utilizes Event definition and Event handler definitions to create a bridge between Events and Event handlers.

event handler v1.png

Once Events and Event handlers are defined within FlowWright using the Configuration Manager, Event handlers can be assigned to Events.  A single Event may have any number of Event handlers assigned to that Event.  The same Event handler can be also attached to multiple events.

Events can be published using the .Net API or the Web service API.

event handler v2.png

Once an Event is published to the ESB, assigned event handlers will act on the Event.

Creating a new Event handler.

A new Event handler can be implemented using the interface deEventHandler.  The interface has one simple method called “execute” that needs to be implemented.  Below is code for a sample event handler:

public class clsWriteTextFileHandler : deIEventHandler

{

  public void execute(deEventContext oContext)

   {

      try

      {

         Hashtable oEventParms = oContext.getEventParameters(); 

         string sTempFileName = new FileInfo(Path.GetTempFileName()).Name; 

         string sFilePath = Path.Combine("c:\\temp", sTempFileName); 

         foreach (DictionaryEntry oItem in oEventParms)

         {

            File.AppendAllText(sFilePath, string.Format("{0} - {1}", oItem.Key.ToString(), oItem.Value.ToString()));

         }

        oContext.markEventProcessed(deEventServiceBus.eventStatus.executed, "");

      }

      catch (Exception ex)

      {

         oContext.markEventProcessed(deEventServiceBus.eventStatus.error, ex.Message);

      }

   }

}

The above code writes all parameters of the event to a text file, it’s a simple event handler that demonstrates the configuration and execution of the event.  After compiling the event handler to a DLL.  Let’s configure the event and the event handler using the Configuration Manager. 

Configuring the Event Definition

Open FlowWright Configuration Manager and click the “Enterprise Service Bus” tab.

event handler v3.png

Click the “Manage Event Definitions” button to define the event.

event handler v4.png

Enter values for Event category and event name and click the “Create Event Definition” button to define the event.  The defined Event should be rendered in the below table.

 event handler v5.png

 

Configuring the Event handler definition

Navigate to the ESB screen and select the “Manage Event Handler Definitions” button to define an Event handler.

event handler v6.png

Enter the following information to define the new Event handler:

event handler v7.png

Once the Event handler definition is created, it should render as follows:

event handler v8.png

 

Publishing events

The following code shows how to publish an Event to the FlowWright ESB. 

//create the Event service bus object

deEventServiceBus oEvt = new deEventServiceBus(sConnStr, "admin"); 

//get the ID of the event definition

string sEventID = oEvt.getEventDefinitionID("WriteFileWithEventParameters"); 

//create a list of event parameters to pass in

Hashtable oInParms = new Hashtable();

oInParms["data1"] = "Data Elements";

oInParms["verified"] = "yes"; 

//publish the event

bool bFlag = oEvt.publishEvent(sEventID, "TestApp", oInParms, deEventServiceBus.eventPriority.high);

Read the full documation step-by step HERE 

 A small sampling of the Workflow Technology for BPM Solutions contained within our FlowWright product offering can be found here: 

Free 30 Day Trial of FlowWright

 

Still Need Help? Talk To A Team Member!