Saturday, December 18, 2010

Canceling a running composite in SOA Suite 11g

Simple scenario -

An order XYZ is being processed in a composite that includes the following
File Adapter(read) --> Mediator --> BPEL --> human workflow --> DB

In the meantime the customer cancels the order XYZ by calling the call center.
The order db is updated accordingly via the call center app, but now we
need to kill the soa composite instance that's still running.

I could create a composite sensor based on the unique Order ID.
The info is then written to the SOA_INFRA table composite_sensor_value

From this table I can then get the COMPOSITE_INSTANCE_ID value.
I can save this pair - Order ID and COMPOSITE_INSTANCE_ID to the DB.

Now we know which composite is processing Order ID XYZ.

Regarding cancelling the running process -

We can use the COMPOSITE_INSTANCE_ID to query
the cube_instance table.

e.g. select * from cube_instance where cmpst_id = xxx;

I can then do the usual purge.

But how should we model this from an architectural perspective?
My OCS colleague, Markus, suggested a generic composite that takes care of
the "cancellation" of all running SOA composite instances.

So we could have the user cancellation call to the call center triggering an event that our generic composite processes.

So essentially we have the following -

1. Create an event via the EDN-Framework.
1.1. The payload contains the info required (orderID, CompositeID etc.) to
find the appropriate running instance.

2. Event is picked up by a Mediator which routes on to a BPEL process that does
the actual purging.

Example to follow after the holidays.

Wednesday, December 8, 2010

Human Workflow API Part 3 - ITaskQueryService.AssignmentFilter

leading on from the previous post...

We have a couple of roles in HW.
For example, the user that actually does the "approving" e.g. jverne.

Also we have the process owner e.g. cdickens.

We can leverage the Java API to process the HW tasks from both perspectives.

We just need to set the ITaskQueryService.AssignmentFilter appropriately.

//Query a list of tasks assigned to jcooper
List tasks = querySvc.queryTasks(ctx,
optionalInfo, // Payload
null, //No keywords
null, //No custom predicate
null, //No special ordering
0, //Do not page the query result