ReakTor Labz | ProaKtor

> > > Configure Clarify Business Process for Blackout Period

Configure Clarify Business Process for Blackout Period

30th October 2018

There are times users might want to not run a Cleo Clarify Business Process due to a component not being available. This scenario is typical for an outbound Cleo Clarify Launcher Business Process when a database needs to be queried, and the database is unavailable.

Below is the step-by-step process along with the Cleo Clarify Business Process script code.

SCENARIO:

We do not want Cleo Clarify Business Process to run from 12am -2:30am on Sundays.

SET-UP:

1. We will retrieve the date

2. Retrieve the day of week using ConvertDate and ‘EEE” conversion code

3. Retrieve the time of day using ConvertDate and ‘kkmm” conversion code

4. Compare day of week against ‘Sunday’

5. Compare retrieved time of day against 0230

BUSINESS PROCESS VARIABLES:

var Date vCurrentDate
var String vTimeofDayStr
var String vDateofWeek
var String Sun=“Sun”
var Double vTimeofDayNum
var Long v0230=230

BUSINESS PROCESS CODE:

step {
new GetCurrentDate().execute(vCurrentDate)
} next : end
step {
new ConvertDateToString().execute(vDateofWeek, vCurrentDate, “EEE”)
} next : end
step {
new ConvertDateToString().execute(vTimeofDayStr, vCurrentDate, “kkmm”)
} next : end
step {
new ConvertStringToNumber().execute(vTimeofDayNum, vTimeofDayStr)
} next : end
step ChkSunday {
new CompareValues().execute(vDateofWeek, Sun, “Equal (=)”.asCompareType, unset)
} next : Select
step Chk230 {
new CompareValues().execute(vTimeofDayNum, v0230, “Greater or Equal (>=)”.asCompareType, unset)
} next : Success


By: on