Tuesday, March 8, 2016

Thick Client Event Logging

There are surprisingly few blog posts out there about vanilla options for logging in the thick client.  Perhaps this is because everyone knows how to do it and if so feel free to ignore this.  But perhaps it is because most people just struggle through using inefficient methodologies.

Here is a simple tip for troubleshooting when using the thick client.  There is an OS environment variable called SIEBEL_LOG_EVENTS (if it does not exist you can create it). Many developers know how to set this to an integer between 0 and 5, but values of 4 and 5 where good detail is provided create a file that unreasonably large and hard to parse.  When troubleshooting on the thin client you can set individual event log levels from the Administration - Server Configuration screen, component events view.  You can do the same when using a thick client though you need to do it using the SIEBEL_LOG_EVENTS variable.  You can use any combination of event aliases and levels, but the value I have found useful is the following:
StpExec=4,PrcExec=4,ObjMgrSqlLog=4,SQLParseAndExecute=4,ObjMgrBusServiceLog=4,EventContext=4,ProcessRequest=4,ObjMgrDBConnLog=5,SecAdpLog=5,ObjMgrSessionLog=5,ObjMgrBusCompLog=2
Basically you can enter any comma separated list of event aliases.

One coda is that if I were trying to troubleshoot a WF issue, I could open this log and do a find for the word 'Instantiating'.  The first instance I would find is the Start step of the WF Process followed by the values of the process properties being set by that step:
PrcExec Create 4 00000002569f1a98:0 2016-01-20 15:31:33 Instantiating process definition 'PPT Passport History Response Integration'.
PrcExec PropSet 4 00000002569f1a98:0 2016-01-20 15:31:33 Setting runtime value of property 'Namespace: 'USER' Name: 'ConfigItem' Datatype: 'String'' to:
PrcExec PropSet 4 00000002569f1a98:0 2016-01-20 15:31:33 Start
PrcExec PropSet 4 00000002569f1a98:0 2016-01-20 15:31:33 Setting runtime value of property 'Namespace: 'USER' Name: 'ObjectName' Datatype: 'String'' to:
PrcExec PropSet 4 00000002569f1a98:0 2016-01-20 15:31:33 Workflow - PPT Test Error Process
PrcExec PropSet 4 00000002569f1a98:0 2016-01-20 15:31:33 Setting runtime value of property 'Namespace: 'USER' Name: 'CurrentStep' Datatype: 'String'' to:
PrcExec PropSet 4 00000002569f1a98:0 2016-01-20 15:31:33 Convert Siebel Message PPH
Subsequent occurrences look like this:
StpExec Create 4 00000002569f1a98:0 2016-01-20 15:31:33 Instantiating step definition 'Start'.
StpExec End 4 00000002569f1a98:0 2016-01-20 15:31:33 Stopping step instance of 'Start' with a 'Completed' status.
In this way you can step through the WF.  The advantage of this logging level over say looking at the WF Instance Monitor or only using WF Simulator, is you will be able to see the SQL executed and the bind variables used, what BCs were instantiated along the way, and what BS methods might have been called.

Tuesday, February 9, 2016

EAI Integration Map expressions

While there are many posts I have seen that talk about expressions supported by 'EAI Data Transformation Engine', I have never seen an attempt to compile a list of supported functions and examples of there uses.  So this will be a humble beginning that will hopefully grow over time.  Note that these functions are mostly VB so if trying out one that is not listed, start with what is supported in VB.  They can also be found in Siebel Bookshelf as Siebel Query Language expressions

Do not include XML element (use System type)
IfNull([Middle Name], [Conflict Id])

Transforming Dates
(from 'YYYYMMDD' to 'MM/DD/YYYY'):
Right(Left([Source Field Name],7),2) +"/"+Right([Source Field Name], 2)+"/"+Left([Source Field Name], 4)

(from Siebel Date to externally recognized format):
ToChar([Birth Date], 'YYYY-MM-DD')
ToChar([Completion Date], 'YYYY-MM-DDThh:mm:ss')

Conditional Logic:
IIF([Source Field Name] = "false", "N", "Y")

SSN formatting (Strip hyphens):
IIF(InStr([PPT Social Security Number], "-") > 0, Left([PPT Social Security Number], 3)+Mid([PPT Social Security Number], 5, 2)+Right([PPT Social Security Number], 4), [PPT Social Security Number])

EAI Lookup for an Inbound Interface:
  • EAILookupSiebel("XXX",[Source Field Name])
    • XXX is the Type in the EAI Lookup table.  This needs also needs to be setup as a value under the EAI_LOOKUP_MAP_TYPE LOV type.
  • IIF([Source Field Name] IS NULL, "", EAILookupSiebel("XXX",[Source Field Name]))
    • EAILookupSiebel fails if no value is found so minimize this possibility unless an exception is desired
Extract the file name from a File Path:
Mid([Source Field Name], InStr([Source Field Name], "/", -1) + 1)