|
NameOpenXPKI::Server::Workflow::ActivityDescriptionBase class for OpenXPKI Activities. Deriving from this class is mandatory if you use the extended flow control features.Configuration parametersTo use the flow control features, you can set several parameters in the workflow configuration. The retry params can be set in either the activity or in the state block. If both are given, those in the state block are superior. The autofail parameter is allowed only in the state block.
FunctionsinitIs called during the creation of the activity class. Sets $self->{PKI_REALM} to CTX('session')->data->pki_realmSets $self->workflow() as a reference to the current workflow. pauseimmediately ends the execution of current action. this is achieved via throwing an exception of class OpenXPKI::Server::Workflow::Pause. before that, $self->workflow()->pause() will be called, which stores away all necessary informations.get_max_allowed_retriesreturns the number of max allowed retries (normally defined in config). default: 0set_max_allowed_retries($int)sets the number of max allowed retriesget_retry_intervalreturns the retry interval (relative OpenXPKI DateTime String, normally defined in config). default: "+0000000005"set_retry_interval($string)sets the retry interval (relative OpenXPKI DateTime String e.g. "+0000000005")get_reap_at_intervalreturns the reap_at interval (relative OpenXPKI DateTime String). default: "+0000000005"set_reap_at_interval($string)sets the reap_at interval (relative OpenXPKI DateTime String, e.g. "+0000000005")get_retry_countReturn the value of the retry counter.wake_upHook method. Will be called if Workflow::execute_action() is called after proc-state "pause". The current workflow is given as argument.NOTE The hook methods are executed on a dedicated instance of the action class so you can NOT share data with the execute method via $self, use the workflow context object to share data if needed. resumeHook method. Will be called if Workflow::execute_action() is called after proc-state "exception" or "retry_exceeded". The current workflow is given as first argument, the process state to recover from as second.runtime_exceptionHook method. Will be called if Workflow::execute_action() is called with an proc-state which is not appropriate (e.g. "finished" or "running") The current workflow is given as argument._get_service_config_pathHelper to retrieve a config path from the parameter or autocreate from interface/server. Expects the name of the node inside the server config that should be used as fallback (single item as string or nested path as arrayref), if config_path is not explicitly set in the action parameters.Parameter mappingParameters in the yaml configuration of the activity that start with _map_ are parsed using template toolkit and imported into the namespace of the action class.The prefix is stripped and the param is set to the result of the evaluation, the value is interpreted as template and filled with the context: action_name: class: ..... _map_my_tt_param: my_prefix_[% context.my_context_key %] If you just need a single context value, the dollar sign is a shortcut: action_name: class: ..... _map_my_simple_param: $my_context_key The shortcut syntax also supports retrieval of subkeys from nested objects: action_name: class: ..... _map_my_simple_param: $my_context_key.key_in_hash The values are accessible via the $self->param call using the basename. Activity configuration example If "my_context_key" has a value of foo in the context, this configuration: action_name: class: ..... _map_my_simple_param: $my_context_key _map_my_tt_param: my_prefix_[% context.my_context_key %] Is the same as: action_name: class: ..... my_simple_param: foo my_tt_param: my_prefix_foo Note that the square bracket is a special char in YAML, if you place it at the beginning of the string, you must put double quotes around, e.g. _map_my_tt_param: "[% context.my_context_key %]"
Visit the GSP FreeBSD Man Page Interface. |