Wednesday, September 25, 2013

Siebel Triggers Job Uses only OR logic on Policy Conditions while Creating Triggers

Generate Triggers Job Only Uses "OR" Logic when Creating Triggers

Generate Triggers Job Only Uses "OR" Logic when Creating Triggers

While creating the Generate Triggers job, it is observerd that all the triggers are created with "or" logic even though their policies contain a series of "anded" criteria.

This is the expected behavior.

The triggers created for multiple conditions of one policy with "or" logic is expected behavior.

The reason for this is to separate the functionality of Generate Triggers (Gentrig) and WorkflowMonitor (WorkMon) Components. Gentrig is a relative simple Server Component that monitors DBrecord changes and inserts a record of these changes into S_ESCL_REQ. WorkMon then evaluates the inserted record (violation) and checks to see if all the conditions associated with Rule of the violation are met.  Only if all conditions are met, does WorkMon then fire the associated action for the policy.

Architecturally, it is more efficient to have WorkMon evaluate the conditions associated with a violation rather than having a complex trigger mechanism.  Additionally, because condition data is often stored in more than 1 table; and because a series of conditions that cause a violation of policy can occur at separate times while still within the monitor action interval, capturing these with database triggers is very difficult -because database triggers can only fire for concurrent actions.  As a result of this database limitation, it becomes important to capture all of these potential violations in order to have WorkMon evaluated them as a whole at the time of the policy action.

For example, a policy has 2 conditions: SR area=Network and Activity Priority=1-ASAP. 2 triggers will be generated. One trigger monitors SR being created or updated, and checks to see if the area equals Network. The other trigger monitors Activity records being created or updated, and checks to see if the Priority equals 1-ASAP. If we created AND triggers, and a user creates a SR without Activity, since the activity is not there, the trigger will not be violated. Later, a user adds an activity to the SR, but because the trigger created was using an "AND" trigger, and in this instance the main SRrecord is not updated, still no database trigger fires. The violation would then be lost as no trigger would be fired in either instance due to the anded logic.
However, if the OR logic exists for the triggers, then there will be 2 records inserted into S_ESCL_REQ (1 for the SR area Network added/upated, 1 for the Priority 1 activity added)  Because workMon will evaluate each record as it is inserted, the condition would not evaluate as a violation until the activity is added (the second record).  Therefore, the first row would be discarded (as there was no activity), but the second insert would cause a violation and the action would fire because at that time, both the SR Area and the Activity Priority meet the policy conditions.

So, as you can see when you look at the architecture in its entirety, even though the triggers are generated with "or" logic, the WorkMon component will evaluate the entire rule as a whole before deciding whether or not it is appropriate to fire off the workflow.
Please not that modifying triggers manually is not a supported practice.

Creating VBC in Siebel

A virtual business component (VBC) provides a way to access data that resides in an external data source using a Siebel business component. The VBC does not map to an underlying table in the Siebel Database. You create a new VBC in Siebel Tools and compile it into the siebel.srf file. The VBC calls a Siebel business service to provide a transport mechanism.
 You can take two approaches to use VBCs
  • Use the XML Gateway business service to pass data between the VBC and one of the Siebel transports, such as the EAI HTTP Transport or the EAI MSMQ Transport
  • Write your own business service in Siebel eScript or in Siebel VB to implement the methods described in this chapter

Friday, September 13, 2013

Creating a custom Siebel Report using BI Publisher

How to create a custom Siebel Report using BI Publisher

. 
If you’ve ever worked with Siebel Business Applications, you should know that these come with predefined reports composed of integration objects and layouts.
These applications can be customized by modifying an integration object and/or RTF template when necessary. Sometimes the predefined report doesn’t match with user requirements (based on our experience this happens most of the time), however, there exists the possibility of creating a Siebel Report from scratch.
This article is a road map on how to create a custom Siebel Report in a connected mode.
The following steps list the process of how to create a custom Siebel Report:
  1. Create a Siebel integration object
  2. Generate an xml data file to use it as a data source during template developing
  3. Create a template using BI Publisher Add-in for MS Word
  4. Upload the new template to Siebel
Create a Siebel Integration Object:

In this first step you will use the Integration Object Builder wizard to create an Integration Object using Siebel Tools.

BI Publisher is integrated with Siebel through web services as it is necessary to create or reuse a Siebel Integration Object. This step provides a hierarchical structure of data.
1
Figure  1, the Integration Object Builder wizard.
Once the integration object has been created, you have to deploy it to runtime database. One of the main advantages of BI Publisher as a reporting tool is that the compilation of the SRF file is not necessary in this step.
2
Figure 2, Integration Object and Integration Components
Generate an xml data file to use it as a data source during template developing
Now you will generate xml sample data. In Sample Data File Generation Siebel View, select the new Integration Object, generate Sample XML and save the file. This process extracts a subset of data that you will use to build the RTF layout. In a case where the complete hierarchy is not generated in this subset of data; you must generate a XSD Schema of your integration object using the Generate XML Schema Wizard in Siebel Tools. Remember to save it as a XML file.
3a3b
Figure 3, Sample data file and schema generation
Create a template using BI Publisher Add-in for MS Word
Now you are ready to build your RTF layout. Use BI Publisher Add-in for MS Word to load the XML file which you generated in the previous step. Build your template using XML tags from the Integration Object and check if the report preview is working.
4
Figure 4, Load Data or Schema in BI Publisher Add-in
To generate the XLIFF file in MS Word go to Translate Template, then Extract text and save it with an xlf extension.
5
Figure 5, Creating XLIFF file
Upload the new template to Siebel
Once you have your template finished, it is time to register it. In Siebel Application, go to template view and create a new report. Select the report layout, XLIFF file and assign the Integration Object. Associate the Report with a Siebel Applications view and upload the file.
6
Figure 6, Template Registration
Your report is now available in the view you have associated it with. From this point you can run or schedule your new custom report.

In conclusion, you would need to create a customized Siebel Report when any of the existing predefined Siebel reports does not match your reporting needs. However, you have to be familiar with all these predefined reports so that when you go to analyze the requirements you can be completely sure that you need to build that report and not spending your time reinventing the wheel.
- See more at: http://www.clearpeaks.com/blog/oracle-bi-ee/how-to-create-a-custom-siebel-report-using-bi-publisher#sthash.MmsVvKeK.dpuf

Monday, June 10, 2013

Common Workflow Errors

The following lists some commonly encountered errors for Workflow Process Manager.
1. Problem: You activated your workflow but it is not executing
Solution: Verify if performed. In order to tell if a process has been triggered, Turn workflow logging (EngInv, DfnLoad, StpExec, PrcExec) on. See the Business Process Administration Guide in Siebel Bookshelf for procedures on how to do this.
2. Problem: You revised the workflow process and re-activated it, but somehow the previous workflow information was read.
Solution: Restart Siebel Server service to refresh the cached version.
3. Problem: When workflow is triggered by runtime event Display Applet, the workflow is triggered the first time but not subsequently? Why?
Solution: Since the DisplayApplet event is a UI event, and the default web UI framework design is to use cache, the event only got fired when the first time a non-cached view is accessed. The workflow gets triggered whenever the event is fired and worked correctly. To make the trigger work each time, you could explicitly set EnableViewCache to FALSE in .cfg file. NOTE: Setting EnableViewCache to FALSE is not recommended as this may severely impact performance.
4. Problem: If a business component has code on WriteRecord and the runtime event fires on Writerecord, which occurs first?
Solution: Runtime events fire before any script events.
5. Problem: After you triggered workflow from a runtime event, you do not get the row-id of the record on which the event occurred.
Solution: Runtime event passes the row-id of the object BO (i.e. primary BC) and not the row-id of the BC. Retrieve the row-id of the active BC using searchspecs (e.g. Active_row-id (process property) = [Id] defined as Type = Expression and BC = BC name)
6. Problem: Encountered the error for Object-id . Please verify that the process exists and has a waiting status.
Solution: This error typically occurs in the following scenario:
(1) A workflow instance is started and paused, waiting for a runtime event
(2) The runtime event fires. The workflow instance is resumed and run to completion.
(3) The runtime event fires for a second time. Workflow engine tries to resume the workflow instance and fails, since the workflow instance is no longer in a Waiting state.
Deleting existing instances will not help. You should ignore the error message and proceed. Steps (1)-(3) need to occur, in that order, in the same user session for the error message to be reported. As a result, the error message would disappear when the application is re-started.
Also, Purge only works on stopped/completed instances. In order to delete persisted/incomplete instances, you will need to manually stop the instances first.
7. Problem: How do you access a different business object (BO) from a workflow process?
Solution: Workflow architecture restricts the use of 1 BO to a workflow. Use a sub process step to access a different BO.
8. Cannot initiate process definition
Solution: Verify that the workflow process exists, process status is set to Active, and the process has not expired.
9. Problem: OMS-00107: (: 0) error code = 4300107, system error = 27869, msg1 = Could not find 'Class' named 'Test Order Part A'
OMS-00107: (: 0) error code = 4300107, system error = 28078, msg1 = Unable to create the Business Service 'Test Order Part A„
Solution: Make sure at least one .srf file is copied to SIEBEL_INSTALL\objects\ directory


Monday, April 25, 2011

Deploy Integration Object to runtime DB

This Functionality has been introduced in Siebel 8.1

Pre Siebel 8.1 the only way to solve this problem was to have SRF Change. In Siebel 8.1 world here is what we can do to avoid SRF change
  1. Opened Siebel Tools by connecting to Production Repository.
  2. Made the change to the Integration Object
  3. Right Click and Deploy to runtime
If you are still getting the same error as that of before i.e prior modification of IO then issue could be of clear the cache and the only way to do it is have a server restart.

Follow these steps after deploying the IO:
  1. Go To Administration – Web Service (either Inbound or Outbound)
  2. Click on Clear Cache button
  3. You are done
Yes, it is as simple as that. I did notice one thing that if you EAI Object manager is not used heavily than you might not require this.

Thursday, April 14, 2011

How to Read SOAP Response In siebel

function ReadResponse(psInput,psOutput)


{

//******************************************************

// Description: The purpose of this function is to read the



incoming response XML from middleware and check for success/error.



//**********************************************************

var psParent;

var psChild;

//var psInCopy = TheApplication().NewPropertySet();





try {

var isSuccess =

true;

psParent = TheApplication ().NewPropertySet ();

psParent = psInput;

var iChildCount = psParent.GetChildCount();



psChild =

TheApplication ().NewPropertySet ();

//var strLevelType = psParent.GetType();

//var strLevel ="";

var isTraversing = true;

var iChild = 0

var

strResponseType;

var strErrorCode = "";

var strErrorMessage = "";

var strErrorSeverity = "";

var blnIsErrorDetail = false;

while ((isTraversing)

&& (iChildCount > 0) && (iChild < iChildCount)) {

psChild = psParent.GetChild(iChild);

iChild++;

//strLevelType

= psChild.GetType();

// *** UNCOMMENT TO TRACE *********

// TheApplication().Trace("(" + iChild + "/" + + iChildCount + ") " + strLevelType);

//*******************************************************



// check for parent tags to force drill down to specific child tags

// if

(psChild.GetType() == "CustomerInfoAccessResponse") {

if ((psChild.GetType() == "CustomerInfoAccessResponse")

(psChild.GetType() == "PayLoad")



(psChild.GetType() == "Operation")

(psChild.GetType() == "Output")

((psChild.GetType() == "ErrorMessage") && (blnIsErrorDetail))) {

if

(psChild.GetType() == "Output") {

blnIsErrorDetail = true;

}

psParent = psChild;



iChildCount = psParent.GetChildCount();

iChild = 0;

// check for tags to get values

} else if

(psChild.GetType() == "ResponseType") {

strResponseType = psChild.GetValue();

if (strResponseType != "ACK") {



isSuccess = false;

}

} else if (psChild.GetType() == "ErrorMessage") {

// this tag is used 2

ways - as parent and child-value - ignore error

try {

strErrorMessage = strErrorMessage + psChild.GetValue();



} catch(e) {}

} else if (psChild.GetType() == "ErrorCode") {

strErrorCode = psChild.GetValue();

} else

if (psChild.GetType() == "ErrorDetailMessage") {

strErrorMessage = strErrorMessage + "; Detail: " + psChild.GetValue();

} else

if (psChild.GetType() == "ErrorSeverity") {

strErrorSeverity = psChild.GetValue();

}

}





psOutput.SetProperty("WMService","getOpportunityByReservation");

if (isSuccess) {

psOutput.SetProperty("Error Message",strErrorMessage);



psOutput.SetProperty("Response","Success");

psOutput.SetProperty("ErrorCode","None");

psOutput.SetProperty("ErrorApp","None");



psOutput.SetProperty("DisplayMsgCode","ACK");



// KCS -08/28/06-added code here to parse inputs and update the outputs

//

either removing the Status property or changing the value of the

// status property.

} else {

psOutput.SetProperty("Error

Message",strErrorMessage);

psOutput.SetProperty("Response","Error");

psOutput.SetProperty("ErrorCode",strErrorCode);



psOutput.SetProperty("ErrorApp",strErrorSeverity);

//psOutput.SetProperty("DisplayMsgCode",strResponseType);



psOutput.SetProperty("DisplayMsgCode","Dta01");

}



} catch(e) {

throw(e);

} finally {

psParent = null;

psChild = null;

}

}



How to create a VBC without Script - XML Gateway

Key Points:


• Using XML Gateway Business Service to serve the VBC

• Using Business Integration Manager (Server Request) as Transport Protocol

• Create your own workflow to deal with the logic


Architecture:


• VBC trigger XML Gateway: Init(), Query(), etc

XML Gateway generates xml files corresponding to the command. Eg. It generates xml file







Contact







Matching Init() command

• XML Gateway triggers Business Integration Manager to invoke SendReceive() method



• Business Integration Manager sends the xml files generated by XML Gateway to Workflow



• Workflow gets the xml file and passes it to external application like MQ Series, MSMQ, HTTP Web Application or processes it inside the Siebel



• Workflow gets the result xml file from external application or Siebel Application and passes it back to Business Integration Manager (BIM)



• BIM receives the result xml file and passes back to XML Gateway to populate the VBC







Points of configuration:



• Create a BC of Class CSSBCVExtern



• Configure the above BC with following user properties

Service Name: XML Gateway

Service Parameters: Transport=EAI Business Integration Manager (Server

Request);ProcessName=;



• Create a process property as type of binary/string. Set the default to . It will hold the xml file generated by XML Gateway



• Create a process property as type of binary and named . It will pass back to BIM and XML Gateway to populate the VBC



• Analyse the xml file generated by XML Gateway to determine what action to be taken. (Query, Insert…)



• Use XSLT to transform the result xml file to the format XML Gateway needs to populate the VBC




Sample Workflow Design





Workflow Process Properties





Step Type Method Business Service

SaveIncomingXML Business Service Send EAI File Transport

Input Argument Type Value Property name

Process Property IncomingXML

FileName Literal C:\XMLGateway.txt

AppendToFile Literal True











Step Type Method Business Service

Analyse Incoming XML Business Service Echo Workflow Utilities

Output Argument Type Value Property name

CheckPoint Expression InStr([&IncomingXML],"fields-req")













Step Type Method Business Service

Is Init Request? Decision Point

Branch Condition Expression

Is Init Condition (CheckPoint Greater Than('0'))

Not Init Default







Step Type Method Business Service

Get Init XML Response Business Service Receive EAI File Transport

Input Argument Type Value Property name

FileName Literal C:\TEMP\TestVBCInit.xml

Output Argument Type Value Argument name

Output Argument











Step Type Method Business Service

Analyse Incoming Query XML Business Service Echo Workflow Utilities

Output Argument Type Value Property name

CheckPoint Expression InStr([&IncomingXML], "query-req")













Step Type Method Business Service

Is Query Request? Decision Point

Branch Condition Expression

Is Query Condition (CheckPoint Greater Than('0'))

Not Query Default







Step Type Method Business Service

Get Query XML Response Business Service Receive EAI File Transport

Input Argument Type Value Property name

FileName Literal C:\TEMP\TestVBCQuery.xml

Output Argument Type Value Argument name

Output Argument





TestVBCQuery.xml











Mr.

Sara

Chan







TestVBCInit.xml