Runtime Events and Custom Business Services

This is for all of you who work with Runtime Events and Action Sets in Siebel CRM.

Action Sets allow you to define one or more actions to be executed when the associated event occurs. There are three action types:

  • Attribute Set: Set a profile attribute
  • InvokeMethod: Invoke a method on the event object
  • BusService: Call a business service method
There are many examples in bookshelf which describe creating an action set to call a built-in business service such as Workflow Process Manager.

However when it comes to calling your custom written business service method, then you find a note that you have to use the "Context" property to pass the arguments.

What happens when the action is executed is that the Siebel framework creates a property set which contains information about the runtime event and the content of the context field as a string.

We can use the EAI XML Write to File business service and its WritePropSet method to send the input property set to a file. This is what the file looks like when your business service is called from an action set:

click to enlarge

The action set passes the following information:
  • Object Name: The name of the object experiencing the event
  • Business Component Name: The current active BC
  • Context: The content of the Business Service Context field
  • Action Set: The name of the action set
  • Event Type: The type of event (BusComp, Applet or Application)
  • EventId: The ROW_ID of the event
  • Sub Event: The content of the Sub Event field (usually a method or field name)
  • Action: The name of the action
  • Event Name: The name of the event such as PreWriteRecord, etc....
The developer can now write appropriate code to peruse this information in the business service. Usually you would be most interested in the Context property which normally contains something like the following:

"Param1", "Value1", "Param2", "Value2"

This is how it is used for standard business services like Workflow Process Manager. Note that the syntax contains strings in double quotes and they are separated by a comma and a space. Of course, for your custom written business service, you could use any other syntax but this may not be "close to the standard" and could cause problems in larger projects where other developers would not be aware of a different context string syntax.

So basically you have to split the string into the distinct values. Here is a code snippet which gives you the general idea:

//read the string from the input property set
var context_string = Inputs.GetProperty("Context");

//the split method creates a char array, we use comma and space as the delimiter
var context_array = context_string.split(", ");

//now we can get the parameters and values, the odd indexes contain the values
//use for() loops for larger arrays...
var param1 = context_array[1];
var param2 = contaxt_array[3];

//use the replace() function to cleanse the double quotes from the string
//the replace() function uses regular expressions which are a little tricky
//see examples here
param1 = param1.replace(/\"/g,'');
param2 = param2.replace(/\"/g,'');

happy scripting ;-)

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

The intention of this blog is to share findings about Siebel CRM and Oracle Business Intelligence Enterprise Edition (Oracle BI EE formerly known as Siebel Analytics) from technical and other (sometimes unprecedented) perspectives.

Search

Archives
« July 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  
       
Today