Invoke a workflow using Siebel server script
2011-10-13 15:15
204 查看
There are a number of ways that a workflow can be invoked using Siebel server script. This article will describe these alternatives and provide an example of each using Siebel eScript.
1. Call synchronous server request
2. Call asynchronous server request
3. Call workflow as a business service
In the following sections I will expand on the above methods.
1. Call synchronous server request
This method makes a request to invoke a task for the workflow to be invoked by the Workflow Process Manager Siebel component. When the request is made for the workflow to be executed, the script will wait for the workflow to completed prior to continuing (hence
synchronous).
When the synchronous server request is submitted the request is routed to a siebel server which has the Workflow Process Manager component enabled and online. A new job/task is created for the workflow job, this task record will be displayed in the Administration
- Server Management > Jobs view.
Using this method, the workflow will be invoked by the SADMIN user. This means that the any records modified by the workflow will show as modified/created by SADMIN.
Using this method, the workflow will be invoked on a server that has the Workflow Process Manager component enabled and online. This is a useful method in the case where the Siebel enterprise has a number of Siebel servers and a single Siebel server is dedicated
to execute workflows. This may be handy if the workflow generates external files where it is important that these are always stored on the same server.
Here is an example of making a syncronous server request to call a workflow using Siebel eScript:
var svcServerRequest;
var psWorkflowChildIn;
var psWorkflowIn;
var psWorkflowOut;
try
{
svcServerRequest = TheApplication().GetService(
"Synchronous Server Requests");
psWorkflowChildIn = TheApplication().NewPropertySet();
psWorkflowIn = TheApplication().NewPropertySet();
psWorkflowOut = TheApplication().NewPropertySet();
psWorkflowChildIn.SetProperty("ProcessName", "My Workflow Process");
with (psWorkflowIn)
{
SetProperty("Component", "WfProcMgr");
AddChild(psWorkflowChildIn);
}
svcServerRequest.InvokeMethod("SubmitRequest", psWorkflowIn,
psWorkflowOut);
}
catch(e)
{
TheApplication().RaiseErrorText(e.toString());
}
finally
{
svcServerRequest = null;
}
2. Call asynchronous server request
This method is the same as that for calling a synchronous server request, however after the call is made to execute the asynchronous server request, the script does not wait for the workflow to complete, it continues immediately and does not wait for the workflow.
Here is an example of making an asynchronous server request to call a workflow using Siebel eScript:
var svcServerRequest;
var psWorkflowChildIn;
var psWorkflowIn;
var psWorkflowOut;
try
{
svcServerRequest = TheApplication().GetService(
"Asynchronous Server Requests");
psWorkflowChildIn = TheApplication().NewPropertySet();
psWorkflowIn = TheApplication().NewPropertySet();
psWorkflowOut = TheApplication().NewPropertySet();
psWorkflowChildIn.SetProperty("ProcessName", "My Workflow Process");
with (psWorkflowIn)
{
SetProperty("Component", "WfProcMgr");
AddChild(psWorkflowChildIn);
}
svcServerRequest.InvokeMethod("SubmitRequest", psWorkflowIn,
psWorkflowOut);
}
catch(e)
{
TheApplication().RaiseErrorText(e.toString());
}
finally
{
svcServerRequest = null;
}
3. Call workflow as a business service
This method executes the workflow in real time within the current application object manager instance. This method executes the workflow as though it was executing a business service.
Using this method, the workflow will always be executed syncronously. The workflow will be executed within the instance of the user session, therefore the workflow will be executed as the user logged in hence inheriting all the security settings of the user
logged in.
Here is an example of calling a workflow as a business service within the application object manager instance using Siebel eScript:
var svcWorkflow;
var psWFInputs;
var psWFOutputs;
try
{
svcWorkflow = TheApplication().GetService(
"Workflow Process Manager");
psWFInputs = TheApplication().NewPropertySet();
psWFOutputs = TheApplication().NewPropertySet();
psWFInputs.SetProperty("ProcessName", "My Workflow Process");
svcWorkflow.InvokeMethod("RunProcess", psWFInputs, psWFOutputs);
}
catch(e)
{
TheApplication().RaiseErrorText(e.toString());
}
finally
{
svcWorkflow = null;
}
1. Call synchronous server request
2. Call asynchronous server request
3. Call workflow as a business service
In the following sections I will expand on the above methods.
1. Call synchronous server request
This method makes a request to invoke a task for the workflow to be invoked by the Workflow Process Manager Siebel component. When the request is made for the workflow to be executed, the script will wait for the workflow to completed prior to continuing (hence
synchronous).
When the synchronous server request is submitted the request is routed to a siebel server which has the Workflow Process Manager component enabled and online. A new job/task is created for the workflow job, this task record will be displayed in the Administration
- Server Management > Jobs view.
Using this method, the workflow will be invoked by the SADMIN user. This means that the any records modified by the workflow will show as modified/created by SADMIN.
Using this method, the workflow will be invoked on a server that has the Workflow Process Manager component enabled and online. This is a useful method in the case where the Siebel enterprise has a number of Siebel servers and a single Siebel server is dedicated
to execute workflows. This may be handy if the workflow generates external files where it is important that these are always stored on the same server.
Here is an example of making a syncronous server request to call a workflow using Siebel eScript:
var svcServerRequest;
var psWorkflowChildIn;
var psWorkflowIn;
var psWorkflowOut;
try
{
svcServerRequest = TheApplication().GetService(
"Synchronous Server Requests");
psWorkflowChildIn = TheApplication().NewPropertySet();
psWorkflowIn = TheApplication().NewPropertySet();
psWorkflowOut = TheApplication().NewPropertySet();
psWorkflowChildIn.SetProperty("ProcessName", "My Workflow Process");
with (psWorkflowIn)
{
SetProperty("Component", "WfProcMgr");
AddChild(psWorkflowChildIn);
}
svcServerRequest.InvokeMethod("SubmitRequest", psWorkflowIn,
psWorkflowOut);
}
catch(e)
{
TheApplication().RaiseErrorText(e.toString());
}
finally
{
svcServerRequest = null;
}
2. Call asynchronous server request
This method is the same as that for calling a synchronous server request, however after the call is made to execute the asynchronous server request, the script does not wait for the workflow to complete, it continues immediately and does not wait for the workflow.
Here is an example of making an asynchronous server request to call a workflow using Siebel eScript:
var svcServerRequest;
var psWorkflowChildIn;
var psWorkflowIn;
var psWorkflowOut;
try
{
svcServerRequest = TheApplication().GetService(
"Asynchronous Server Requests");
psWorkflowChildIn = TheApplication().NewPropertySet();
psWorkflowIn = TheApplication().NewPropertySet();
psWorkflowOut = TheApplication().NewPropertySet();
psWorkflowChildIn.SetProperty("ProcessName", "My Workflow Process");
with (psWorkflowIn)
{
SetProperty("Component", "WfProcMgr");
AddChild(psWorkflowChildIn);
}
svcServerRequest.InvokeMethod("SubmitRequest", psWorkflowIn,
psWorkflowOut);
}
catch(e)
{
TheApplication().RaiseErrorText(e.toString());
}
finally
{
svcServerRequest = null;
}
3. Call workflow as a business service
This method executes the workflow in real time within the current application object manager instance. This method executes the workflow as though it was executing a business service.
Using this method, the workflow will always be executed syncronously. The workflow will be executed within the instance of the user session, therefore the workflow will be executed as the user logged in hence inheriting all the security settings of the user
logged in.
Here is an example of calling a workflow as a business service within the application object manager instance using Siebel eScript:
var svcWorkflow;
var psWFInputs;
var psWFOutputs;
try
{
svcWorkflow = TheApplication().GetService(
"Workflow Process Manager");
psWFInputs = TheApplication().NewPropertySet();
psWFOutputs = TheApplication().NewPropertySet();
psWFInputs.SetProperty("ProcessName", "My Workflow Process");
svcWorkflow.InvokeMethod("RunProcess", psWFInputs, psWFOutputs);
}
catch(e)
{
TheApplication().RaiseErrorText(e.toString());
}
finally
{
svcWorkflow = null;
}
相关文章推荐
- MySQL and Sql Server:Getting metadata using sql script (SQL-92 standard)
- staging server, source congtrol, deply workflow using git
- How to check the MS SQL Server job run status by using Script
- Using SQLCMD to deploy sql script on SQLServer
- Siebel Tools: How To Invoke Script from a Siebel Button At the Business Component and Applet Levels
- Siebel Tools: How To Invoke Script from a Siebel Button At the Business Component and Applet Levels
- Generate sql script using sql server publishing wizard
- staging server, source congtrol, deply workflow using git
- Siebel Tools: How to program Browser Script & Server Script
- LotusScript Class to do client or server side FTP on Win32 platform. FTP using script and wininet.dll.
- Siebel Tools: How to program Browser Script & Server Script
- Script:诊断MTS shared server
- debug your program using gdbserver in arm platform
- 详解PHP中$_SERVER函数的QUERY_STRING和REQUEST_URI、SCRIPT_NAME、PHP_SELF
- Ultra-fast ASP.NET: Build Ultra-Fast and Ultra-Scalable Websites Using ASP.NET and SQL Server
- 2010年8月26日周四_understanding ArcGIS Server_using an ArcGIS Server service_8.3
- Using Apache James as Mail Server for testing Mail
- Siebel Server 8.1 Install
- Setting Up Git Server Using Gitosis
- (转)Inno Setup Script Silently install .NET 3.5 and Sql Server Express