Wednesday, April 20, 2011

Runtime Workflow

I heard this question from my colleague ..
Q) Workflow Process manager is down in the server .There is an Run time which will call the workflow on an particular event .Now the Question : If the event happened will the workflow will execute or will it fail . If yes how how it will be executing .

-->Some Hints
calling workflow from Run time

run-time environment is available both as a business service and as a server component.

The two Workflow business services are:

Workflow Process Manager
Workflow Process Manager (Server Request)
When the Workflow Process Manager business service is called, the workflow process is run in the object manager of the application called. When the Workflow Process Manager (Server Request) business service is called, the workflow process is run in the server component called Workflow Process Manager.


The Workflow Process Manager server components act as the application object manager to run workflows.
The Workflow Process Manager server components are specialized server components configured and tuned to run workflow processes. Like all server components, the Workflow Process Manager server components provide a multi-threaded environment.

The Workflow Process Manager uses the Siebel Object Manager framework and runs workflows as a business service.
The Workflow Process Manager hosts the Business Object layer and the Data Object layer. It is a scalable architecture with the ability to run multiple object managers and multiple tasks for each object manager.
NOTE: The name Workflow Process Manager refers to both the Workflow business service (referred to as the Workflow engine) and the workflow server components.



http://download.oracle.com/docs/cd/B31104_02/books/BizProcess/BizProcess_Architecture6.html

Calling workflow from the script

When invoking a workflow process from script, you can specify that the process run on the server or in the object manager:

To run a process on the server, call the service Workflow Process Manager (Server Request).
To run a process in the application object manager, call the service Workflow Process Manager.
Note that invoking a workflow process from script is performed in Synchronous mode.

Eg service Workflow Process Manager (Server Request)

//function Invoke_Process()

{

var svc = TheApplication().GetService("Workflow Process Manager(Server Request)");
var Input = TheApplication().NewPropertySet();
var Output = TheApplication().NewPropertySet();
var bo = TheApplication().ActiveBusObject();
var bc = bo.GetBusComp("Opportunity");
var rowId = bc.GetFieldValue("Id");
var accountId = bc.GetFieldValue("Account Id");
Input.SetProperty("ProcessName", "My Opportunity Process");
Input.SetProperty("Object Id", rowId);
// Pass the value of the Account Id field to the Account Id process property
Input.SetProperty("Account Id", accountId);
svc.InvokeMethod("RunProcess", Input, Output);

}

Eg: / Example: Invoking a Workflow Process through scripting
function Invoke_Process()
{
var svc = TheApplication().GetService("Workflow Process Manager");
var Input = TheApplication().NewPropertySet();
var Output = TheApplication().NewPropertySet();
var bo = TheApplication().ActiveBusObject();
var bc = bo.GetBusComp("Account");
var rowId = bc.GetFieldValue("Id");

Input.SetProperty("ProcessName", "My Account Process");
Input.SetProperty("Object Id", rowId);

svc.InvokeMethod("RunProcess", Input, Output);
}

No comments:

Post a Comment