How To invoke a Siebel Business Service
By neel | January 25, 2008
In this post I will elaborate how we can invoke a business service in various ways. But first just an overview of what business service is.
Business Service (BS): Is a place where you write to code to implement business rules and process.
We can also write the code at BusComp and Applet level but that makes our code and business logic to be
- Distributed
- Difficult to manage
- Cannot be reused
Siebel Business service has a slight more overhead than the code at Applet or BusComp level but it helps us to make our code
- Centralized
- Easier to manage
- Can be reused
So general rule of thumb to select where to write the code is
If same business rules are applicable on more than one entity then we write a generalized code at BS level.
You can create business services in
Siebel Tools: Code change is SRF dependent.
Siebel Client: Code change is SRF independent.
You can read more on both kinds of business services in the following post.
We can invoke a business Service through
- Runtime Events
- eScript
- User Property
- Runtime Events
To call a business service through runtime events
Enter the following information in the Action Set that you are creating
Business Service: Business Service Name
Business Service Method: Method Name
Business Service Context: “Input Argument”, “Value”
And based on the Event that you choose this business service will be invoked
- eScript
You can use the following Code to invoke a business service from escript
var svc = TheApplication().GetService(”BS Name”);
var Input = TheApplication().NewPropertySet();
var Output = TheApplication().NewPropertySet();
Input.SetProperty(”Type”,this.GetFieldValue(”Status”)); // Input Agruments
svc.InvokeMethod(”BSMethod”, Input, Output);
- User Property
You can use named method property to invoke a business service from BC but this method is rarely used as it including complex conditions in the User property might not be possible. But it can come quite handy if you just want to invoke BS based on simple conditions
Name: Named Method 1
Value: “New Record”, “INVOKESVC”, “BS Name”, “BS Method”, “‘Input Agrument’”, “Value”, “‘Input Argument 2’”, “Value”
To see details of this user property read the following post
Related Posts
Categories: How - To |
Subscribe by Email
January 25th, 2008 at 6:10 am
Hi
You can also use the Workflow process to invoke a business service as per the usage.
January 27th, 2008 at 11:49 am
Hi ple give me more information about Business services i need step by step with example… It’s U have possible ple do help….
Thanks
Siva
January 28th, 2008 at 5:25 am
January 28th, 2008 at 5:25 am
Thanks for pointing that out.. I missed that one.. will include it
February 1st, 2008 at 6:23 am
Hi Neel can U tell What type of input and output arguments can take in Business services… in which input and out put arguments are avaliable..ple help me
February 1st, 2008 at 8:26 am
if you want to pass any other value then you have to set it as property.
Will soon write a post explaining the process of calling BS from script
February 12th, 2008 at 5:06 am
Believe we can even use RCR to invoke a Business service.
However Neel,dint understood,what did you mean by enitiy mentioned in your thumb rule which seems to be an criteria to implement a business service. Plz elaborate on this.
and if a person,would like to start off from the basic of scripts,what would you advice.
Thanks in advance
Soj
April 15th, 2008 at 2:07 am
Hi,
I have seen example of invoking a BS, but cant seem to find any example which gives step by step procedure to write a small BS, and then invoke it from eScript.
i have a BS to sum two numbers, how do i access the two arguments inside the BS which are passed to it ?
April 15th, 2008 at 8:47 pm
http://siebelunleashed.com/business-service-and-input-arguments/
I believe this should put you on its way… I will still put a step by step post to invoke a business service through escript
May 13th, 2008 at 1:38 pm
How to invoke a business service with a method which doesnt have any arguments(thru script)?
for eg:
var svc = TheApplication().GetService(”BS Name”);
var Input = TheApplication().NewPropertySet();
var Output = TheApplication().NewPropertySet();
Input.SetProperty(”Type”,this.GetFieldValue(”Status”)); // Input Agruments
svc.InvokeMethod(”BSMethod”, Input, Output);
here we are passing input and out put args rt? what if if u dont have any arguments in the BS method?
May 14th, 2008 at 7:46 am
taking your example
var svc = TheApplication().GetService(”BS Name”);
var Input = TheApplication().NewPropertySet();
var Output = TheApplication().NewPropertySet();
//Input.SetProperty(”Type”,this.GetFieldValue(”Status”)); // Input Agruments
svc.InvokeMethod(”BSMethod”, Input, Output);
commenting the setproperty line will result in calling business service without any input arguments.
July 9th, 2008 at 12:27 pm
Actually you do not need to pass a property set if you are using Script Assist in 8.0
var svc = TheApplication().GetService(”BS Name”);
var status = svc.(”Type”, this.GetFieldValue(”Status”));
By typing svc. will give you a dropdown of all the functions available in the BusSrv you are calling.