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 Reply Children
  • 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:

  • The Assignment invalid issue seems to be caused by using a!localVariables().
    Can you use code I shared into a direct expression without local variables?

  • +1
    Certified Senior Developer
    in reply to Shubham Aware

    I tried you code but in you code adding 60 at the end is not adding 60minutes it is adding 60 days, so I modified the code as follows

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

    But this logic also resulted in same error, may be along with localvariables, a!addDateTime function also not supported.

    Now I added the below logic and it working fine. Thanks for your inputs  , . Is there any documentation on these things, what are supported and what are not supported in timer properties? If avaialble can you please share the same

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

  • Good to see it's working after removal of localVariable() and modifying my earlier code.