Showing posts with label Date in Workflows. Show all posts
Showing posts with label Date in Workflows. Show all posts

Tuesday 15 September 2015

Query Data between two Dates using Siebel Workflow

Hi All,
recently i had a requirement to fetch data between two dates and send this data to other application in XML format.
The exact requirement was someting like,

1. Allow user to Give two dates and it should return the Records within the given date range.
2. Implement this in a workflow and expose it as a webservice.

I used the below apprach to implement this functionality.

1. Created a workflow and Used EAI Siebel Adapter Busines Service, QueryPage or Query method
2. In Search Spec i gave the below expression

[LOY Transaction.Transaction Date] >= '" + [&StartDate]+ "' AND [LOY Transaction.Transaction Date] =< '" + [&EndDate]+ "'"












this queries the data withing the given date range, the expression can be extended to support other fields as well and Checks for NULL values.

eg. IIf (
  [&TxnNumber] IS NULL ,
  "[LOY Transaction.Transaction Date] >= '" + [&StartDate]+ "' AND [LOY Transaction.Transaction Date] <= '" + [&EndDate]+ "'",
  IIf ([&StartDate] IS NULL OR [&EndDate] IS NULL ,
  "[LOY Transaction.Transaction Number] = '" + [&TxnNumber]+ "'",
  "[LOY Transaction.Transaction Number] = '" + [&TxnNumber]+ "' AND [LOY Transaction.Transaction Date] >= '" + [&StartDate]+ "' AND [LOY Transaction.Transaction Date] <= '" + [&EndDate]+ "'")
  )

 this expession takes in 3rd variable transaction Number in Input as well and allows to query with the following options which was my actual requirement.

1. Only Transaction Number
2. Only Start and End Dates
3. Both Transaction Number and Date Range

Paging can be used if the Number of records is huge.. hope this was helpful.,..

Friday 26 June 2015

Calculating difference between two dates in Siebel workflow

Recently i had a requirement where i had to calculate difference between two dates and perform some check if difference was exceeding a given number.
There can be multiple ways of solving the problem the two best one are either write a custom script and do calculation there or use the expression in workflow and store dates in process properties and do checks there.
My requirement was to compare Date of Transaction with present date and Execute a operation only if the difference was greater than 10 Days.

Approach : 

1. Create 2 Process Properties , 

Name : JulianDayToday 
Value : Timestamp()

Name : TxnProcessedDate
Value : Create Date Field of BC







The Difference can be calculated with Expression 
Difference = [&TxnProcessedDate] - [&JulianDayToday]

value stored in difference can be used in decision points to execute the desired step.

hope this was helpful .. cheers..

Siebel GoTo View - Handling Realtime cases

 Hello All,  We all must have used GoTo view functionality of siebel to navigate to a particular view from current view. What if the require...