OpenXPKI::Server::Workflow::Activity::Tools::Pause;
Generic pause activity which stops the current workflow for a defined period of
time. Note that this is a non blocking pause and the outer execute loop will
terminate and return. This is basically the same as using the watchdog with a
retry count of 1 and a suitable interval.
The Activity has two modes of operation, which are triggered by
the name of the parameter used. If you specifiy both parameters, wakeup is
used first but sleep is used if wakeup contains a false value.
- *sleep*
- Sleep for a relative time starting from now. The value given to sleep is
evaluated as a relativedate as defined in OpenXPKI::DateTime. Note: the
activity will always detach from the current process and waits for the
watchdog to be restarted. Therefore the given sleep period is a lower
bound and not an exact value!
Example - Sleep for a day:
<action name="I18N_OPENXPKI_WF_ACTION_PAUSE"
class="OpenXPKI::Server::Workflow::Activity::Tools::Pause"
reason="I am tired"
wakeup="+0000001">
</action>
- *wakeup*
- Wakeup expects an absolute time, either in the OpenXPKI::DateTime
absolutedate format (YYMMDDhhmmss) or epoch. Note: If the date has already
elapsed, the activity will NOT detach but just become a noop and continue.
Example - Sleep until five-to-twelve on new years eve:
<action name="I18N_OPENXPKI_WF_ACTION_PAUSE"
class="OpenXPKI::Server::Workflow::Activity::Tools::Pause"
wakeup="201412312355">
</action>
Hint - this is very handy in combination with the parameter
mapping feature:
<action name="I18N_OPENXPKI_WF_ACTION_PAUSE"
class="OpenXPKI::Server::Workflow::Activity::Tools::Pause"
_map_wakeup="$context_key_with_date">
</action>
- *reason*
- The reason parameter is optional an takes a string to be logged as reason
for the pause.