Siebel Business Process Framework: Workflow Guide > Example Workflow Processes That Call a Business Service > Externalizing Properties When Using a Business Service >

Example of Defining Input Arguments in Siebel eScript


To define input arguments for an EAI Business Service, you can add the following example Siebel eScript code to the Service_PreInvokeMethod event of the EAI HTTP Transport business service or to the EAI SQL Adapter business service. This code uses the XML hierarchy described in Example of Defining Input Arguments in an XML Hierarchy:

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);

}

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