Siebel Business Process Framework: Workflow Guide > Reference Materials for Siebel Workflow > Manipulating and Processing Data >

Passing Data To and From a Workflow Process


This topic provides information about passing data to a workflow process and obtaining data from a workflow process. It includes the following topics:

The Workflow engine can be invoked by calling a business service. The Workflow Process Manager business service is a standard business service used for this purpose. When you run a workflow process by invoking the Workflow Process Manager business service, you can pass inputs to Workflow, and in some cases, obtain outputs from Workflow.

While this topic discusses passing data to and from a Business Service step, keep in mind that the Sub Process step uses the same conventions for passing property sets. For more information, see About the In/Out Process Property.

Passing Inputs to a Workflow Process

The input property set is required to contain a property named ProcessName, which specifies the name of the workflow process to be run. In addition to the ProcessName property, you can put other values, such as strings, numbers, and property sets, into the property set. These values are passed to the workflow process by the Workflow Process Manager business service.

Simple data type process properties, such as String, Number, and DateTime, that are marked In or In/Out are initialized if the input property set has a property in the top-level property set with a name matching the name of the workflow process property. The value of such a property in the input property set initializes the value of the matching workflow process property.

Hierarchical data type process properties that are marked In or In/Out are initialized if the input property set has a child whose property set Type field contains a string matching the name of the hierarchical workflow process property. If such a match is found, the matching child and everything below the child in the input property set is copied into the process property.

Note that multiple variables can be passed into SQL Program Arguments. For more information, see Passing Multiple Variables into SQL Program Arguments.

Passing Outputs from a Workflow Process

It is possible that a workflow process started programmatically will not return outputs. For example, an interactive workflow process can be started programmatically, but since it can pause, the output from the call to start the workflow process might reflect the state at an intermediate point. For this reason, only a workflow process that is guaranteed to run to completion in one call, that is, a service flows, can be expected to provide output in the output arguments of the call into the Workflow Process Manager business service.

Output arguments follow the same convention as input arguments. Simple workflow process properties, such as String, Number, and DateTime, that are marked Out or In/Out appear as properties on the top-level property set. Hierarchical process properties appear as children of the output property set. Hierarchical process properties can be located by examining the Type field of the child, which match the workflow process property name.

Passing Parameters from a Workflow Process to a Global Variable

You can use a business service to access and pass parameters from a workflow process to a global variable. Note that when an update is made to a global variable by using a Batch Manager task, each task is in essence a separate user session. Therefore, an update that is made to a global variable by using a Batch Manager task might not be visible to subsequent Workflow Process Batch Manager tasks. For more information, see Example of Script That Accesses Workflow Parameters.

Passing a Constant from a Workflow Policy Action into a Workflow Process

You can use the Run Workflow Process program to pass a constant from a Workflow Policy Action into a Workflow Process.

To configure a workflow to pass a constant from a workflow policy action into a workflow process

  1. In Siebel Tools, navigate to the Workflow Policy Program OBLE and query for Run Workflow Process in the Name property.
  2. With the Run Workflow Process object definition still chosen, navigate to the Workflow Policy Program Arguments OBLE.
  3. Add a new argument, then choose File > Save from the application-level menu.

    For example, add a new argument with the Name property set to IOName. Make sure the Visible property has a check mark.

  4. In the Workflow Policy Program OBLE, click the Run Workflow Process object definition.
  5. From the application-level menu, choose Tools > Compile Selected Object, then click Compile in the Object Compiler dialog.

    In the Siebel client, this argument appears in the Arguments applet in the Workflow Policy Actions view.

  6. Set the default value.

    The default value varies according to IOName.

  7. Open the Process Designer for the workflow to which the constant is passed.
  8. In the MVPW, create a new record with the Name argument set to the same name defined in the argument you created in Step 3.

    For example, Name must be the same as IOName. For more information, see About Process Properties.

  9. Invoke the workflow policy.

    For more information, see Invoking a Workflow Process from a Workflow Policy.

Examples of Script That Pass Data To and From a Workflow Process

This topic describes several examples of using script to invoke a workflow process and for passing parameters.

Example of Script That Invokes a Workflow Process and Constructs an Input Property Set

This topic gives one example of using script to invoke a workflow process and construct an input property set. You might use this feature differently, depending on your business model.

The following is a sample script that invokes the Workflow Process Manager business service which constructs an input property set, psInputs, for the business service. This script defines strings that are put into the input property set as properties:

var msgName = "Siebel Agent Authorization Retrieval";

var reqSubType = "CICS Services Request";

var reqType = "AgentAuthorizationReq";

var CICSServiceName = "Consumer Auto Agent Authorization Retrieval";

var processName = "Consumer Auto VBC VBC Template";

var reqFileName = "C:\\sea752\\XMLMessages\\AgentAuthorizationVBCReq-final.xml"

var resFileName = "C:\\sea752\\XMLMessages\\AgentAuthorizationVBCResponse-final.xml"

Example of Script That Defines Property Sets for the Input Property Set

This topic gives one example of using script to define property sets for the input property set. You might use this feature differently, depending on your business model.

The following is a sample script that defines property sets, which are put into the input property set as child property sets:

//Request PS

var psRequest = app.NewPropertySet();

var psAgentNumTag = app.NewPropertySet();

var psType = app.NewPropertySet();

var sAgentID;

Example of Script That Constructs Property Sets

This topic gives one example of using script to construct property sets. You might use this feature differently, depending on your business model.

The following is a sample script that constructs property sets:

//Build property set hierarchy

sAgentID = app.LoginName();

psRequest.SetType("XMLHierarchy");

psAgentNumTag.SetType("DataAgentNumber");

psAgentNumTag.SetValue(sAgentID);

psRequest.AddChild(psAgentNumTag);

Example of Script that Assembles Properties and Child Property Sets into the Input Property Set

This topic gives one example of using script to assemble properties and child property sets in the input property set. You might use this feature differently, depending on your business model.

The following is a sample script that assembles properties and child property sets into the input property set:

psInputs.AddChild(psRequest); //Pass in Property Set

psInputs.SetProperty("RequestURLTemplate", requestURLTemplate); //Pass in string

psInputs.SetProperty("RequestSubType", reqSubType);

psInputs.SetProperty("ReqType", reqType);

psInputs.SetProperty("MessageName", msgName);

psInputs.SetProperty("CICSServiceName", CICSServiceName);

psInputs.SetProperty("ProcessName", processName);

psInputs.SetProperty("Request File Name", reqFileName);

psInputs.SetProperty("Response File Name", resFileName);

Example of Script That Invokes the Workflow Process Manager Business Service and Passes the Input Property Set

This topic gives one example of using script to invoke the workflow process manager business service and pass the input property set. You might use this feature differently, depending on your business model.

The following is a sample script that invokes the Workflow Process Manager business service and passes the input property set to the Workflow Process Manager business service:

var svc = TheApplication(). GetService("Workflow Process Manager");

svc.InvokeMethod("RunProcess", psInputs, psOutputs); //Call the Workflow

var sErr = psOutputs.GetProperty("sErr"); //Check the Workflow status

Example of Script That Accesses Workflow Parameters

This topic describes how to use script to access workflow parameters for a running workflow process.

To access workflow parameters for a running workflow process

  1. Define a business service with relevant methods and parameters.
  2. Access the business service from the workflow process.
  3. In the business service step in the workflow process, pass the workflow process properties to the business service method arguments.

    For more information, see Passing a Process Property In and Out of Workflow Steps.

  4. Use the following script to take the business service argument values and assign them to Profile Attributes:

    function Service_PreInvokeMethod (MethodName, Inputs, Outputs)

    {

    if( MethodName == "XXX" ) {

    var isWorkflowRunning, viewValidCurrent, viewValidNext;

    // read the input arguments into profile attributes

    isWorkflowRunning = Inputs.GetProperty("Workflow Running");

    viewValidCurrent = Inputs.GetProperty("Valid View Current");

    viewValidNext = Inputs.GetProperty("Valid View Next");

    TheApplication().SetProfileAttr("WFRunning", isWorkflowRunning);

    TheApplication().SetProfileAttr("WFViewCurrent", viewValidCurrent);

    TheApplication().SetProfileAttr("WFViewNext", viewValidNext);

    }

  5. Use the profile attributes for more processing.

    The necessary information is put into the profile attributes of the application. You can use the standard procedures for accessing the profile attributes to extract this information. For more information, see Siebel Personalization Administration Guide.

Siebel Business Process Framework: Workflow Guide Copyright © 2008, Oracle. All rights reserved.