SiebelSupport

-Learning the sharing way :)

Tuesday, July 17, 2012

How Do You Pass or Receive a Property Set to or from a Custom Business Service


By on 1:18 PM

Within a workflow process, you can store a property set in a process property of type Hierarchy. To pass the content of a process property to or from a custom business service, however, the Type of the child property set stored in the process property must match the name of the input or output argument of the business service.
The following two examples demonstrate this principle.

Example 1: Getting a Property Set from a Business Service

This example shows how to set up a workflow process to invoke a custom business service, and retrieve a process property that is in a hierarchal property set.
  1. In Siebel Tools, create a business service, MyBS, defined with the following method and arguments:

    Method Name: Method1
    Arguments:
    NameData typeTypeDisplay nameStorage TypeOptional
    HierarchyArg1 Hierarchy Input / Output Hierarchy Argument 1 Hierarchy True
    The name of the argument, for example, HierarchyArg1, must match the Type of the child property set in the business service script.
    Add the following Server script (eScript):
    function Service_PreInvokeMethod (MethodName, Inputs, Outputs)
    {
        if (MethodName == "Method1") {
            var outPropset = TheApplication().NewPropertySet() ;
            outPropset.SetType("HierarchyArg1") ;
            outPropset.SetProperty("PropName1", "Hello") ;
            outPropset.SetProperty("PropName2", "Goodbye") ;
            Outputs.AddChild(outPropset) ;
            outPropset = null;
            return (CancelOperation);
        }
        else return (ContinueOperation);
    }

    Create a workflow process, myWF, with a process property defined as follows:

    Name: myHierarchy
    Data Type: Hierarchy
  2. You can name this process property with any name you choose. This process property name becomes the Type of your output property set.
  3. Add a business service step to the workflow process defined as follows to invoke the business service you created in steps 1 and 2:

    Business Service: MyBS
    Method: Method1

  4. For the output argument of the business service step, add a record as follows:

    Property Name: myHierarchy
    Type: Output Argument
    Output Argument: Hierarchy Argument 1 The execution of this step puts the property set built in the myBS business service into the myHierarchy process property. Please refer to the Note at the end of this FAQ for additional information about this step.
  5. Run the workflow process in the workflow process simulator. At the end of the business service, the myHierarchy process property with the following structure is available:
    TypeValueChild Type
    myHierarchy   HierachyArg1
    TypeValueProperty KeyProperty Value
    HierachyArg1   PropName1 Hello
        PropName2 Goodbye

Example 2: Passing the Process Property to a Business Service

This second example builds on the workflow and business service developed in Example 1 and assumes that you have a workflow process with a hierarchy process property that has been initialized by another step. This example shows how to pass a property set from a workflow process to a business service. For this example, the Type of the property set must be stored within this process property.
In Example 1, the step calling the MyBS business service returned a property set with a Type of HierarchyArg1 into the myHierarchy process property. In this example, this process property is passed to another business service called MyBS2 using the Method2 method.
  1. Create a new business service named MyBS2 and define it with the following method and argument (created in Siebel Tools): 

    Method Name: Method2
    Arguments:
    NameData typeTypeDisplay nameStorage TypeOptional
    HierarchyArg1 Hierarchy Input / Output Hierarchy Argument 1 Hierarchy True
  2. Add the following Server script (eScript) to the business service:
    function Service_PreInvokeMethod (MethodName, Inputs, Outputs)
    {
        if (MethodName == "Method2") {
            var childPropset = TheApplication().NewPropertySet();
            childPropset = Inputs.GetChild(0);
            var a = childPropset.GetProperty("PropName1");
            var b = childPropset.GetProperty("PropName2");
            var outPropset = TheApplication().NewPropertySet();
            outPropset.SetType("HierarchyArg1");
            outPropset.SetProperty("PropName3", a+b);
            Outputs.AddChild(outPropset);
            outPropset = null;
            childPropset = null;
            return (CancelOperation);
        }
        else return (ContinueOperation);
    }

    Modify the workflow process from Example 1 to add another business service step and a new process property of type hierarchy called myHierarchy2.
  3. The business service step invokes the MyBS2 business service you created above. This step should be added after the step that invokes the MyBS business service. In that step, pass it the process property as indicated below:

    Business Service: MyBS2
    Method: Method2
  4. Add a record into Input Arguments applet as follows:

    Input Argument: Hierarchy Argument 1
    Type: Process Property
    Property Name: myHierarchy
  5. For the output argument of the business service step, add a record as follows:

    Property Name: myHierarchy2
    Type: Output Argument
    Output Argument: Hierarchy Argument 1

    The execution of the MyBS2 business service step passes the content of the myHierarchy process property (a hierarchical process property) into a child property set having a Type of HierarchyArg1. The HierarchyArg1 property set is received by the Service_PreInvokeMethod function of the MyBS2 business service.

  6. Run the workflow process in the workflow process simulator. At the end of the business service, the myHierarchy2 process property with the following structure is available:

    Type
    ValueChild Type
    myHierarchy2   HierachyArg1

    TypeValueProperty KeyProperty Value
    HierachyArg1   PropName3 HelloGoodbye

 
 

This figure above shows an overview of how data is passed to and from a business services and workflow process. It shows the relationship between the workflow process property set and the Inputs and Outputs property sets for business services and presents the mechanism for workflow process described in above Example 2. The workflow process definition is at the top of the figure. The dotted blue lines show in a workflow process, to retrieve a hierarchal process property from a business service, the name of the output argument of the business service must match the child Type of the process property.

Note.  In above steps (Example 1, step 5 and Example 2, step 4) the Output Argument and Input Argument columns show the display name of the argument, not its name. This is the reason why the Type of the property set is HierarchyArg1 and not Hierarchy Argument 1.

SiebelSupport - Learning the sharing way :)

When you know a thing, to hold that you know it, and when you do not know a thing, to allow that you do not know it - this is knowledge.

0 comments:

Post a Comment

Labels

ADSI authentication ADSISecAdpt apiinstaller.jar Applet User Properties Barcode fonts in PDF Best Practices BI Publisher BI Publisher 11g BI Publisher Desktop BI Publisher Desktop 10.1.3.2 BI Publisher template error BIP Performance tuning BUG 19469254 Create iPad Reports CRM on Demand R19 Deployment Guide - IP2014 Desktop Integration Siebel Agent (DISA) EAI Object Manager EnableURLCredentials ENTERPRISE NAME IS TRUNCATED DURING MIGRATION INSTALL IN LINUX PLAT Escripting External Business Components (EBCs) Generate Trigger Get a 20% Discount on Oracle Training How To Incorrect missing encryption key Incremental Repository Merge (IRM) Install Barcode fonts in BIP Server Integration Object IP2014 IP2014 Patch Set 1 IP2014 Patchset 2 IP2015 IP2015 Patchset 1 (15.1) IsRecordSensitive JDeveloper jqmtoolbarrenderer.js LDAP LDAPSecAdpt log level of SWSE Menu in Siebel Open UI new theme in Siebel 8.1.1.11 Open UI NFS OBIEE Integration on Siebel 7.8.2 Oracle Database XE Oracle Fusion Middleware Oracle Integration Cloud Services (ICS) Oracle WebLogic Server Override Custom Theme In Open UI Without Deleting The User Preferences Files Of All Users Performance Tuning Quiz Release Notes Responsive Web Design REST SAI REST SAP BusinessObjects Data Quality SavePreferences SBL-DAT-00222 SBL-DAT-00522 SBL-DBC-00107 SBL-SEC-10001 and SBL-DAT-00565 SBL-SEC-10018 Siebel - Oracle Real-time Scheduler Integration SIEBEL 8.1.1.14 ENVIRONMENT VARIABLE INSTALL ISSUE Siebel 8.1.1.8 Fix Pack Siebel 8.1.1.9 / 8.2.2.2 Siebel Administration Siebel Analytics Siebel BI Publisher Reports Siebel Composer Siebel Composer Developer Preview Siebel CRM 15.0 Siebel CRM 8.1.1.10/8.2.2.3 Siebel CRM Innovation Pack 2015 Siebel Delta Files (SDF) Siebel Email Marketing Siebel Filesystem Siebel Innovation Pack 2016 Siebel License Keys Siebel Open UI Siebel Open UI Manifest Siebel Release 15.1 Siebel Reports Siebel RESTful Services Siebel Server Cloning SPF Symbolic URL Synergy Open UI Theme Synergy Theme Open UI - Siebel CRM Innovation Pack 2015 Videos What is Workflow Policy OR

Tags