Scheduled Process Model

Certified Senior Developer

HI EVERYONE,

I have a process model and that need to be triggered at every 30mins and it need to be triggered at 15th and 45th minute in everyhour(Eg:- 12:15am, 12:45am, 1:15am, 1:45am ..... an so on.). But in schedule trigger we don't have such option, In interval details I gave 30 mins but based on the publised time and deployemnt time of process model, the scheduled run timings are changing. Irrespective of the deployment time/published time, I want the process model to trigger at 15th and 45th minute in each hour.

How can I achieve this?

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    Could you try this,
    Use Delay until the date and time specified by this expression with this expression:

    datetime(
      year(now()),
      month(now()),
      day(now()),
      hour(now()),
      if(minute(now())<15, 15, if(minute(now())<45, 45, 15)),
      0
    ) + if(minute(now())>=45, 1, 0) * 60


    Then set At an interval for Every 30 minutes.

  • 0
    Certified Senior Developer
    in reply to Shubham Aware

    Hi  

    I added a similar code in delay until the date and time specified.

    The logic is same but format of code is different, refer below code. But with my code the process mode is erroring out and getting error mail as attached below. Any idea why it is erroring out? Is it due to using localvariables? Are localvariables not allowed in timer event? Is there any documentation with respect to that?

    = a!localVariables(
      local!now: now(),
      local!currentMinute: minute(local!now),
      local!upcomingMinute: if(
        and(
          local!currentMinute >= 15,
          local!currentMinute < 45
        ),
        45,
        15
      ),
      local!upcomingHour: if(
        local!currentMinute >= 45,
        a!addDateTime(startDateTime: local!now, hours: 1),
        local!now
      ),
      datetime(
        year(local!upcomingHour),
        month(local!upcomingHour),
        day(local!upcomingHour),
        hour(local!upcomingHour),
        local!upcomingMinute
      )
    )

    Error:

Reply
  • 0
    Certified Senior Developer
    in reply to Shubham Aware

    Hi  

    I added a similar code in delay until the date and time specified.

    The logic is same but format of code is different, refer below code. But with my code the process mode is erroring out and getting error mail as attached below. Any idea why it is erroring out? Is it due to using localvariables? Are localvariables not allowed in timer event? Is there any documentation with respect to that?

    = a!localVariables(
      local!now: now(),
      local!currentMinute: minute(local!now),
      local!upcomingMinute: if(
        and(
          local!currentMinute >= 15,
          local!currentMinute < 45
        ),
        45,
        15
      ),
      local!upcomingHour: if(
        local!currentMinute >= 45,
        a!addDateTime(startDateTime: local!now, hours: 1),
        local!now
      ),
      datetime(
        year(local!upcomingHour),
        month(local!upcomingHour),
        day(local!upcomingHour),
        hour(local!upcomingHour),
        local!upcomingMinute
      )
    )

    Error:

Children