Siebel Business Process Framework: Workflow Guide > Example Workflow Processes >

Example of Externalizing Properties Used by Siebel Workflow


This topic provides an example for externalizing properties. It includes the following topics:

The goal of this example is to provide a framework to externalize Workflow properties such that a workflow process using business services that interact with external systems does not require repository changes when migrating between Siebel instances in development, test, and production.

Concepts presented in this example can be extended for other business services provided by Siebel and can help avoid changes to workflows when migrating the repository between development, test, and production Siebel instances.

Externalizing Properties Overview

A workflow process that uses a business service that requires interaction with external systems must be changed when the repository is migrated between development, test, and production.

An example if this is EAI HTTP Transport, which requires the URL of the external system for the HTTPRequestURLTemplate input argument. The URL for the workflow process that uses the EAI HTTP Transport business service would point to an integrated test system's external URL in the testing instance and point to a production external system URL in the production instance.

The basic idea for the design of the framework is to store in a file the input arguments of a business service that are in use in a given workflow process. In the Service_PreInvokeMethod event of the Business Service step, add script to read values of these substitutable input arguments of a business service in use in a workflow process from a file, and set the Input Argument of the business service with values read from a file. This way, the file residing on the production Siebel instance server contains values for production external systems, and the file residing on the dev/test Siebel instance server contains values for dev/test external systems. In other words, input argument values are not hard coded for such a service in the workflow design, but read at run time from a file in the Service_PreInvokeMethod Event method script.

This framework relies on a file, with a particular name, on each Siebel Server being available for reading. Otherwise the business service fails and Siebel Workflow throws an error at that Business Service step, which is the required behavior.

For a business service where the script is added to the Service_PreInvokeMethod event, it is expected that an input argument called ExternalSystem is defined, and the argument's value matches the XML tag name of the child of the root element in the file.

This script code sets the child elements of the second-level parent, that is the child of the root element, of the file as input arguments.

Recommended Requirements for Externalizing Properties

Recommended requirements for externalizing Workflow properties for certain business services include:

  • The framework makes transparent the migration of repository workflows between development, test, and production Siebel instances. That is, workflows no longer require changes during migration between various Siebel instances.
  • The framework supports current business services as well as future requirements.
  • The framework supports usage scenarios of a given business service used in various workflows.
  • The framework is easy to manage and has a net effect of reducing the total cost of ownership of operational aspects of running the Siebel instance.

About the EAI Business Service Input Arguments

The EAI HTTP Transport and EAI SQL Adapter business services, when used in the workflow process as a business service step, have input arguments that might require changes when migrating the repository between development, test, and production Siebel instances. Table 78 describes potential required changes.

Table 78. Description of Input Arguments That Might Require Changes When Migrating Repository Data
Business Service
Business Service Methods
Business Service Method Input Arguments

EAI HTTP Transport

Send

SendReceive

HTTPRequestURLTemplate

EAI SQL Adapter

Query

ExtDBODBCDataSource

ExtDBPassword

ExtDBTableOwner

ExtDBUserName

Assume that a given Siebel instance has integration points with third-party HR and Finance systems. To use the EAI HTTP Transport and EAI SQL Adapter business services, the input arguments listed in Table 78 must be supplied in the definition of the workflow process business service step where the business service is referenced.

Example XML Hierarchy

The following is an arbitrary XML Hierarchy file containing input arguments for the EAI HTTP Transport and EAI SQL Adapter business services, and their values. The parameters under Finance and HR are for illustration purposes only. The file is named ebizint.xml.

You can have a number of parameters with appropriate values. For a given usage scenario of a business service, parameters that are not needed do no harm. Also, this XML Hierarchy is arbitrary. The hierarchy displayed below is for illustration purposes only:

<?xml version="1.0" encoding="UTF-8" ?>

<Systems>

<Finance>

<TargetWebAddress>http://finance</TargetWebAddress>

<ExtDBODBCDataSource>financesource</ExtDBODBCDataSource>

<ExtDBUserName>financeuser</ExtDBUserName>

<ExtDBPassword>financepassword</ExtDBPassword>

<ExtDBTableOwner>financeowner</ExtDBTableOwner>

</Finance>

<HR>

<TargetWebAddress>http://hr</TargetWebAddress>

<ExtDBODBCDataSource>hrsource</ExtDBODBCDataSource>

<ExtDBUserName>hruser</ExtDBUserName>

<ExtDBPassword>hrpassword</ExtDBPassword>

<ExtDBTableOwner>hrowner</ExtDBTableOwner>

</HR>

</Systems>

Example eScript

Given the structure of the example XML file displayed in Example XML Hierarchy, the following eScript code example can be added to the Service_PreInvokeMethod event of the EAI HTTP Transport and EAI SQL Adapter business services:

function Service_PreInvokeMethod (MethodName, Inputs, Outputs)

{

var ExtSystem, XMLReadSvc, XMLReadSvcInputs, XMLReadSvcOutputs;

var ExtSystemParent, Child

var errorStr;

try

{

XMLReadSvcInputs = TheApplication () .NewPropertySet ();

XMLReadSvcOutputs = TheApplication () .NewPropertySet ();

XMLReadSvcInputs.SetProperty("FileName", "C:\\ebizint.xml");

XMLReadSvcInputs.SetProperty("EscapeNames", "false");

XMLReadSvc = TheApplication () .GetService ("EAI XML Read from File");

ExtSystem = inputs.GetProperty ("ExternalSystem");

XMLReadSvc.InvokeMethod("ReadXMLHier", XMLReadSvcInputs, XMLReadSvcOutputs);

//ExtSystem = {"HR", "Finance", "HRSensitive"}

ExtSystemParent = XMLReadSvcOutputs.GetChild(0) .GetChild(0);

for (var i =0; i < ExtSystemParent.GetChildCount(); i++)

{

Child = ExtSystemParent.GetChild(i);

if (Child.GetType() == ExtSystem)

{

for (var j=0; j < Child.GetChildCount(); j++)

{

var ExtType = Child.GetChild(j) .GetType();

var ExtValue = Child.GetChild(j) .GetValue();

Inputs.SetProperty (ExtType, ExtValue);

}

}

}

}

catch (e)

{

errorStr = e.toString();

TheApplication () .Trace(errorStr);

TheApplication () .RaiseErrorText(errorStr);

return (CancelOperation);

}

finally

{

ExtSystem = null;

XMLReadSvc = null;

XMLReadSvcInputs = null;

XMLReadSvcOutputs = null;

ExtSystemParent = null;

Child = null;

errorStr = null;

}

return (ContinueOperation);

}

Figure 25 displays an example usage of the EAI HTTP Transport business service, which has the above eScript code defined in the Service_PreInvokeMethod event.

Figure 25. Example Usage of EAI HTTP Transport Business Service

Maintaining the XML File

There is no other ongoing maintenance required for ebizint.xml. Whenever the values in the file change this file needs to be updated with the correct values on the Siebel Servers. An example change that requires an update to ebizint.xml is a change in the external system URL.

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