OpenXPKI::Server::API2::Plugin::Workflow::execute_workflow_activity
Executes a given activity on a workflow.
By default, the activity is executed "inline", all
actions are handled and the method returns a HashRef with the UI
control structure of the new workflow state. Use parameters
"async" and/or
"wait" for "background"
execution using a newly spawned process (see below).
- "id" Int - workflow id
- "workflow" Str - name/type of the
workflow, optional (default: read from the tables)
- "activity" Str - name of the
action to execute
- "params" HashRef - parameters to
be passed to the action
- "ui_info" Bool - set to 1 to have
full information HashRef returned, otherwise only workflow state
information is returned. Default: 0
- "async" Bool -
"background" execution (asynchronously): forks a new process.
Optional.
Return HashRef contains the UI control structure of the
OLD workflow state.
- "wait" Bool - wait for background
execution to start (monitors the database, max. 15 seconds). Optional.
Return HashRef contains the UI control structure of the
current state of the running workflow. Please note that this might be
the next step or any following step as this depends on random timing,
i.e. when the monitoring loop happens to check the database again.
Changes compared to API v1:
String parameter "ASYNC" was
split into two boolean parameters "async"
and "wait":
CTX('api') ->execute_workflow_activity(.. ASYNC => "fork") # old API
CTX('api2')->execute_workflow_activity(.. async => 1) # new API
CTX('api') ->execute_workflow_activity(.. ASYNC => "watch") # old API
CTX('api2')->execute_workflow_activity(.. async => 1, wait => 1) # new API