Tuesday, 13 September 2016

Adding workflow policy Condition based on new column in siebel

1.       Table
Create column on required table
e.g
Table Name
Column Name
S_SRV_REQ
X_HIGH_PRIORITY_FLG



2.       Workflow Policy Column
Create new workflow policy column in Siebel tools
Workflow Policy Column Name
Table
Column
High Priority Flag
S_SRV_REQ
X_HIGH_PRIORITY_FLG




3.       Workflow Policy Object
WF Policy Object
 Changes to be Applied
Service Request
Modify existing WF policy object to add new workflow policy component column ‘High Priority Flag



4.       Workflow Policy Component Column
Parent WF Policy Component
Workflow Policy Component Column Name
Alias
Changes to be Applied
Service Request
High Priority Flag
High Priority Flag
Add workflow policy column under existing WF Policy Component





Compile above changes and restart Siebel application


5.       Workflow Policy

After making changes as explained in above 4 steps, you Can use new column as an condition for workflow policy under Administration- Business Process -->Workflow Polices-->Conditions



Removing diccache.dat for Dedicated Client in Siebel

Avoid creation of diccache.dat file while using dedicated client which is connected to Database server.
Use the below parameter under [ServerDataSrc]/[Env Connection] section in the CFG file.

We have validated the same on dev major

UseDictionaryInTransactionLogging = FALSE 

Enabling Debug Mode for Task Based UI (TBUI) in siebel

Using Debug Mode
Set debug mode in Application level menu-->Tools-->Debug Mode.

PFB Screenshot


A) Dedicated Client

To enable the Debug Mode menu item
  1. Open the configuration file (.CFG) for the application in a text editor.
  2. In the [InfraUIFramework] section of the configuration file, set the EnableRestrictedMenu parameter to TRUE.
    For example:
    [InfraUIFramework]
    EnableRestrictedMenu = TRUE
  1. Save your changes, and close the file.
The EnableRestrictedMenu parameter (in the [InfraUIFramework] section of the configuration file) controls the display of the Debug Mode menu item.
If this parameter is set to TRUE, then users of that application can see the Debug Mode item on the Tools application-level menu. If this parameter is set to FALSE, the Debug Mode menu item is not visible to users.


B)Thin Client


  1. Login to siebel application
  2. Navigate to Administration - Server Configuration -->Enterprises
  3. Query component 'eCommunications Object Manager (ENU)' in Component Definitions tab (Please note component can change as per siebel application)
  4. In Child Tab 'Component Parameters', query EnableRestrictedMenu parameter and Set value as True
  5. Restart Siebel Application



Monday, 12 September 2016

Saturday, 10 September 2016

Get day of the week based on input date in siebel

PFB escript code to Get day of the week based on input date in siebel

var oWeekDay = new Array("Sunday", "Monday", "Tuesday","Wednesday", "Thursday", "Friday", "Saturday");
var strDate = Inputs.GetProperty("DropTime");

var dtDate = new Date(strDate);
var i = 0;
var strWeek = dtDate.getDay();

while (i <= strWeek)
{
var result = oWeekDay[i];
i++;
}
Outputs.SetProperty("weekDay", result);

Get any LOV field in siebel


PFB code to Get value any LOV field in siebel



var strFieldName = Inputs.GetProperty("FieldQuery");
var strSearchExp = Inputs.GetProperty("SearchExpression");

// Get ListOfValues BC
objListOfValuesBO = TheApplication().GetBusObject("List Of Values");
objListOfValuesBC = objListOfValuesBO.GetBusComp("List Of Values");

// Query LOV
with (objListOfValuesBC)
{
ClearToQuery();
ActivateField(strFieldName);
SetSearchExpr(strSearchExp);
ExecuteQuery();

var blnRecord = FirstRecord();

if(blnRecord)
{
strFieldValue = GetFieldValue(strFieldName);
Outputs.SetProperty(strFieldName, strFieldValue);
}
}

Convert input string into Date format in siebel

PFB escript code to Convert input string into Date format in siebel


var splitDate = sDate.split ("/");
var nDay = ToNumber(splitDate[1]);
var nMonth = ToNumber(splitDate[0]);
var nYear = ToNumber(splitDate[2]);

    return (new Date(nYear, nMonth-1 , nDay));

Script to Validate email format in siebel

PFB escript code to Validate email format in siebel

      var email = Inputs.GetProperty("EmailAddress");
     
      var pat = /(^[0-9a-z]([-_.]?[-_0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\.[a-z]{2,4}$)/g;

    var valid = email.replace(pat,"Y");
   
    if(valid == "Y")
    {
      Outputs.SetProperty("StatusCode", 0);
      Outputs.SetProperty("sErrorType", "Email address format valid.");
}
else
{
      Outputs.SetProperty("StatusCode", 1);
      Outputs.SetProperty("sErrorType", "Please check the email address format.");
      }

Calling workflow in Async Mode in siebel


PFB Code for Calling workflow in Async Mode in siebel


var objInputPS = TheApplication().NewPropertySet();
   var objChildPS = TheApplication().NewPropertySet();
   var objOutputPS = TheApplication().NewPropertySet();
   var objWorkflowBS = TheApplication().GetService("Asynchronous Server Requests");

objInputPS.SetProperty("Component", "WfProcMgr");

   objChildPS.SetProperty("ProcessName", Inputs.GetProperty("ProcessName"));
   objChildPS.SetProperty("RowId", Inputs.GetProperty("RowId"));
     
   objInputPS.AddChild(objChildPS);
 
   objWorkflowBS.InvokeMethod("SubmitRequest", objInputPS, objOutputPS);

Convert date into DateToDDMMYYYHHMISS format in siebel

PFB code to Convert date into DateToDDMMYYYHHMISS format in siebel

var strDate = Inputs.GetProperty("Date");

var splitDate = strDate.split ("/");
var sDay = splitDate[1];
var sMonth = splitDate[0];
var sYear = splitDate[2];

if (sMonth.length == 1)
sMonth = "0" + sMonth;
if (sDay.length == 1)
sDay = "0" + sDay;

var tDate = new Date;


var sHour = ToString(tDate.getHours());
var sMin  = ToString(tDate.getMinutes());
var sSec  = ToString(tDate.getSeconds());


if (sHour < 10)
sHour = "0" + sHour;
if (sMin < 10)
sMin = "0" + sMin;
if (sSec < 10)
sSec = "0" + sSec;


strDate = sDay + "/" + sMonth + "/" + sYear + " "+ sHour + ":" + sMin + ":" + sSec;
Outputs.SetProperty("DateString", strDate);

return (CancelOperation);

Convert date into DateToDDMMYYY format in siebel

PFB code  to Convert date into DateToDDMMYYY format in siebel

var strDate = Inputs.GetProperty("Date");

var splitDate = strDate.split ("/");
var sDay = splitDate[1];
var sMonth = splitDate[0];
var sYear = splitDate[2];

if (sMonth.length == 1)
sMonth = "0" + sMonth;
if (sDay.length == 1)
sDay = "0" + sDay;

strDate = sDay + "/" + sMonth + "/" + sYear;
Outputs.SetProperty("DateString", strDate);

return (CancelOperation);

convert input string into lower case in siebel

PFB code to convert input string into lower case in siebel


var inStr = Inputs.GetProperty("Input String");
var resStr = inStr.toLowerCase();

Outputs.SetProperty("Output String", resStr);

Different ways of invoking workflow in siebel

PFB Different of invoking workflow in siebel

1.     E-script
2.     Run-time Event
3.     Using datamap expression
4.     Bus Comp/Applet User property(Named Method)
5.     Using Business Service 
1.     Server Requests
2.     Workflow Process Manager
3.     Asynchronous Server Requests
6.     Workflow Policy
7.     RCR

PFB detailed explanation

·  E-script

    var objInputPS = TheApplication().NewPropertySet();
              var objChildPS = TheApplication().NewPropertySet();
              var objOutputPS = TheApplication().NewPropertySet();
              var objWorkflowBS = TheApplication().GetService("Workflow Process Manager");
                  
                   objInputPS.SetProperty("ProcessName ", <name of workflow to be ivoked>);
                  
                 objInputPS.SetProperty("<inputs to workflow>", <Respective values to WF inputs>);
                        
               
              objWorkflowBS.InvokeMethod("RunProcess", objInputPS, objOutputPS);



·  Run-time Event

Use below in action set

Business Service Name
Workflow Process Manager
Business Service Method
RunProcess
Business Service Context

"ProcessName", "<workflow process name>"



·  Using datamap expression

IIF([Product Type] = 'OCC', IIF([EITC OCC Entity] = 'Account' OR [EITC OCC Entity] = '' OR [EITC OCC Entity] IS NULL, "RP" + LookupName('EITC_OCC_RATEPLAN', [Orders.EITC Service Account OCC Rateplan]),InvokeServiceMethod ("EITC Pricing Adjustment", "GetRootAndRatePlan", "Covered Line Item Id='"+[Covered Quote Item Id]+"',Order Id='"+[&Object Id]+"',Line Item Id='',Root Product Id='',Mode='Order'", "RP Product Integration Id")),"")

·  Bus Comp/Applet User property(Named Method)

E,g BC user property

Name
Named Method

Value
"ParentalPINReset", "INVOKESVC", "Asset Mgmt - Asset", "Workflow Process Manager", "RunProcess", "'ProcessName'", "EITC IPTV Reset PIN", "'RowId'", "[Id]", "'Type'", "Parental"



·  Using Business Service 
1.     Server Requests
2.     Workflow Process Manager
Eg same as escript…use required inputs for calling workflow

·  Workflow Policy

Navigate to Administration –Business Service to create workflow policy & create workflow policy action to invoke workflow based on criteria


·  RCR

Configure workflow job(in Administration –Server Management) to call workflow in specified interval