Siebel Business Process Framework: Workflow Guide > Manipulating Data in a Workflow Process > Passing Data to and from a Workflow Process >

Examples Scripts That Pass Data to and from a Workflow Process


The examples in this topic pass data to and from a workflow process.

Using a Script to Start a Workflow Process and Create an Input Property Set

The following example script calls the Workflow Process Manager business service. This business service creates an input property set named psInputs for the business service. This script defines strings as properties. It puts these strings in the input property set:

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"

Using a Script to Define Property Sets for the Input Property Set

The following example script defines property sets. It puts these property sets in the input property set as child property sets:

//Request PS

var psRequest = app.NewPropertySet();

var psAgentNumTag = app.NewPropertySet();

var psType = app.NewPropertySet();

var sAgentID;

Using a Script to Create Property Sets

The following example script creates property sets:

//Create property set hierarchy

sAgentID = app.LoginName();

psRequest.SetType("XMLHierarchy");

psAgentNumTag.SetType("DataAgentNumber");

psAgentNumTag.SetValue(sAgentID);

psRequest.AddChild(psAgentNumTag);

Using a Script to Assemble Properties and Child Property Sets in the Input Property Set

The following example script assembles properties and child property sets in 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);

Using a Script to Call the Workflow Process Manager Business Service and Pass the Input Property Set

The following example script calls the Workflow Process Manager business service, and then passes the input property set to this 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

Using a Script to Access Parameters for a Workflow Process

The example in this topic accesses workflow parameters for a running workflow process.

To use a script to access parameters for a workflow process

  1. Define a business service that includes the required 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 a Workflow Process Step.

  4. Use the following script to use the values of the business service argument 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);

    }

    A profile attribute is a string that is visible to any object that exists in a user session. A separate session exists for each user. A user cannot access the strings that another user session contains.

  5. Use the profile attributes for more processing.

    Siebel CRM places the required information in the profile attributes. You can use the typical procedures to configure Siebel CRM to access these profile attributes. For more information, see Siebel Personalization Administration Guide.

Siebel Business Process Framework: Workflow Guide Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Legal Notices.