Tuesday, December 8, 2015

IBM BPM Constructing Undercover Agents

An undercover agent is what we would normally call a Listener.   It listens for a message or a timeout, and then provides an event that can affect a process.

There are two types of UCAs, Content and Message.


A Message UCA can be implemented on a Variable or on a Service.


A UCAService is just an integration service that defines the datatypes that will be implemented by the UCA.

A Variable - I'm not sure, and I need to look into

It also has a queue name.  I'm not sure why there are 4 queues to choose from.

--
A Content UCA works with an Enterprise Content Manager and raises a notification if something happens in the ECM that needs action in the Process Server.

IBM BPM Outgoing Web Services

Outgoing web services are pretty easy.  First define your servers in the Process App Settings page.  Give it a name, and provide the WSDL.  You can override the WSDL endpoint here. Remember your data mapping.



 Then from within a task flow you can use a Webservice node to call the endpoint:

IBM BPM Incoming Web Service Integration

Start with your process, having defined some variables.  (I have a Customer variable and associated data type).  Drop a "Start Event" into the system swimlane and change its implementation type to Message.


Make the triggering mechanism UCA (Undercover Agent) and click New to create a new UCA.
 



















In the New Dialog, give your UCA a name and make sure the Schedule Type is set to On Event:







In the UCA Properties make sure the schedule type is set to On Event.  Change the implementation to Service, and then click New to define a new UCAService.


Name it appropriately:




Just connect the start and end nodes in the service diagram, and provide your input/output variables.




And then map them of course.

Then create WebServiceHandler and provide it with input and output variables as required.  It's going to accept input from your web service and invoke the UCAService like this.  The input variable will be exposed in the WSDL interface.  I use INit and OutNit to pre and post process around invoking the UCA.  I just like having fun with those names.



And then create a WebService impl and assign this WebServiceHandler to it to define the Inputs and Outputs.  You can copy the WSDL now and test with SoapUI or another tool, or call this web service from another IBM BPM Process.