Process Node Scheduling

Hi Experts,

We got a specific scenario from our client where we have to keep our process waiting until a time provided by user matches with the server time.

So from the UI user is providing date in one field as " MM/DD/YYYY" and time in a different field as "HH:MM:SS" and timezone in another field.
The process node must only gets triggered or move to next node only when time provided by user matches with the server time.

I'm using below code but its not working as expected

a!localVariables(  
  local!split: split(ri!endSearchTime, ":"),
  local!day: day(ri!endSearchDate),
  local!month: month(ri!endSearchDate),
  local!year: year(ri!endSearchDate),
  local!endSearchDateTime:datetime(
    local!year,
    local!month,
    local!day,
    local!split[1],
    local!split[2],
    local!split[3]
  ),
  todatetime(
    if(
    local!endSearchDateTime - ((gmt(local!endSearchDateTime) - local!endSearchDateTime) - rule!TEST_ER_TimeZoneOffset(ri!endTimeZone)) < now(),
    now() + intervalds(0, 0, 10),
    local!endSearchDateTime - (( gmt(local!endSearchDateTime) - local!endSearchDateTime) - rule!TEST_ER_TimeZoneOffset(ri!endTimeZone)) + intervalds(1, 0, 0)
  )
  )
)

where rule!TEST_ER_TimeZoneOffset takes timezone as parameter and returns the intervalads as shown in below code

a!localVariables(
  local!timeZone:ri!timeZone,
 a!match(
    value:local!timeZone,
    equals: "PST",
    then:  intervalds(8, 0, 0),  

    equals: "PDT",
    then: intervalds(7, 0, 0),  

    equals: "MST",
    then: intervalds(7, 0, 0),  

    equals: "MDT",
    then: intervalds(6, 0, 0),  

    equals: "CST",
    then: intervalds(6, 0, 0),  

    equals: "CDT",
    then: intervalds(5, 0, 0),  

    equals: "EST",
    then: intervalds(5, 0, 0),  

    equals: "EDT",
    then: intervalds(4, 0, 0),  

    equals: "AST",
    then:intervalds(4, 0, 0),  
    
    equals:"NST",
    then:intervalds(3, 30, 0),  
    
    equals: "ADT",
    then: intervalds(3, 0, 0),
    
    equals: "NDT",
    then: intervalds(2, 30, 0),  
    default:  /*UTC*/
    intervalds(0, 0, 0)
  )
)

Please suggest

  Discussion posts and replies are publicly visible