Execute Workflows
Workflows can be run in several ways:
-
With a running ONE Runtime Server:
-
From the ONE Runtime Server Admin.
-
From the command line using the
onlinectl
script. -
Via an HTTP request.
-
-
Without having to start the server:
-
From the command line using the
runewf
script. -
From ONE Desktop in the Workflow Editor.
-
Launching workflows on the server requires that the workflows are located in one of the source folders defined in the Workflow Component. Launching outside the server is independent of the server configuration; however, some functions are unavailable, namely you cannot run tasks that require the server.
Workflow execution is logged. For more information, see How to Log Workflow Execution.
Launch workflow on the server
To execute workflows in the server context, add the Workflow Component to the server configuration and configure it.
Making changes to the server configuration requires restarting the server. |
Make sure the server is running. For instructions, see How to Start or Stop the Server.
ONE Runtime Server Admin
To execute workflows from the ONE Runtime Server Admin, make sure that the Web Console Component is enabled in Server Configuration.
Execute workflows
To execute a workflow:
-
Open the ONE Runtime Server Admin.
-
In the navigation panel on the left, under Workflows, select Configurations. A list of available workflows opens.
-
Select the workflow you want to run. The workflow details screen opens.
-
Under Launching, fill in the values for all defined input variables.
-
Select Start workflow. A running instance appears. If your workflow initiates other workflows (for example, via Trigger Workflow or Iterate), you can see all running workflow instances under Workflows > Running.
View execution results
To see the details of running or finished workflow instances, select the Instance ID under Running workflows or Finished workflows. The State and result of the workflow instance screen that opens shows the detailed information about the instance.
To see execution logs and other generated files for any task in the workflow, select Details for any particular task. For more information about logging for workflows and its configuration, see How to Log Workflow Execution.
Command line via OnlineCtl
OnlineCtl is a command line tool for performing ONE Runtime Server-related tasks.
It is launched by running <ATACCAMA_HOME>/bin/onlinectl.[bat|sh]
.
Required arguments
To execute workflows via onlinectl
, one argument is necessary: -config
, which specifies the path to server configuration.
See OnlineCtl for more information.
Sample execution command
The following is a sample execution command:
onlinectl.bat -config d:\default.serverConfig executeWorkflow src1:wfFileName.ewf varName1=value1 varName2=value2
Where:
-
src1
is the source folder identifier as set in Workflow Component. -
varName1
is an input variable. -
value1
is the value passed to the variable.
All workflow OnlineCtl commands
Command | Parameters | Description |
---|---|---|
executeWorkflow |
workflowName [varName=value] |
Runs workflow and waits for the return code. |
listRunningWorkflows |
Lists running workflows and their running instances. |
|
listWorkflows |
Lists all defined workflows. |
|
startWorkflow |
workflowName [varName=value] |
Starts workflow and immediately returns. The workflow is run in the background. |
waitForWorkflowCompletion |
wfName_1 [wfName_2 … wfName_N] |
Waits until instances of specified workflows are finished. |
Return codes
The workflow engine uses the following return codes to report the result of the execution:
Code | Description |
---|---|
0 |
Workflow process completed successfully. |
17 |
Workflow execution completed with errors. |
18 |
Workflow execution failed because of an invalid workflow configuration. |
19 |
No valid license file has been found. |
20 |
Plugin versions check failed. This usually means that the runtime installation is corrupted; we recommend reinstalling. |
21 |
Incorrect arguments were given to the |
HTTP request
It is possible to start workflows via the Workflow HTTP Remote API. In this case, the workflow behaves as if it was started manually, so you can see and control the workflow from the ONE Runtime Server Admin.
The request has the following form, where src1
is the source folder identifier as set in Workflow Component.
http://server:port/runWorkflow?id=src1:wfFileName.ewf
Pass variables
If you need to pass variables to the workflow, encode them to the URL as follows:
http://server:port/runWorkflow?id=src1:wfFileName.ewf&vars.varName1=value1&vars.varName2=value2
This example starts the workflow wfFileName.ewf
and passes variables varName1
with value value1
and varName2
with value value2
.
Secured HTTP request
If ONE Runtime Server is configured to require authentication (see Authentication Service Component), it is possible to pass the username and password via Request Headers (Name is "Authorization", Value is "Basic [base64Encoded]", where [base64Encoded] must be a base64-encoded string "username:password" of the user specified in the server configuration).
Execute from the Web Lookup step
The HTTP Remote API can be used to initiate a workflow from a ONE plan via the Web Lookup step.
Server responses to the HTTP call
The REST API runWorkflow returns a JSON with Workflow ID and Workflow Instance ID.
{
"id": "WorkflowId",
"instanceId": "WorkflowInstanceId"
}
-
200
: The workflow was successfully run. -
401
: The user request has no sufficient rights to run the workflow. -
404
: The workflow of the specified name was not found or has already been deleted. -
412
: There is some other error preventing the workflow to be run, such as:-
The workflow cannot be run since it contains errors.
-
No workflow ID was defined.
-
The workflow is in the invalid state.
-
Independent execution
Tasks that require a running server cannot be run from ONE Desktop or by runewf script.
|
Command line via Runewf
Workflows can be executed from the command line interface by executing the <ATACCAMA_HOME>/bin/runewf.[bat|sh]
script.
Required arguments
The runewf
script takes one required argument: the path to the workflow file that should be run.
Parameters
In addition, the following parameters are available:
Parameter | Required | Default | Description |
---|---|---|---|
runtimeConfig |
Yes |
No default value |
Path to the Runtime Configuration. Since the workflow executed from a command line does not run in any container (such as the online server), it needs additional runtime information required by some tasks (for example, EwfSqlTask). |
resume |
No |
No state file |
If defined, the processor tries to resume the specified workflow from this state file instead of performing a new clean run (see Resume Workflows). |
forcedResume |
No |
false |
Determines whether resuming should be executed in the basic ( |
state |
No |
No state file |
Defines an output state file where the progress of the tasks is logged to. If not specified, state-logging is not performed. |
log |
No |
|
Defines whether the workflow progress should be logged to the console (if |
vars |
No |
No variables |
Defines the values of variables to be passed to the workflow. If the workflow requires more variables than specified here, you are asked to enter them to the console. |
Sample execution command
runewf.sh -runtimeConfig="../project/Files/etc/one.runtimeConfig" -state="../project/Files/etc/state_log.xml" -log=true -vars.var1="Hello World!" -vars.var2="Welcome!" "../project/Files/workflows/workflow.ewf"
Return xodes
The return codes are the same as for OnlineCtl.
Local run using ONE Desktop
A workflow can be executed locally from ONE Desktop the same way as plans — by selecting the Run option. Historical workflow executions are not available on the Run Results tab, but the execution logs and results are shown in the Console along with a link to the state file after the workflow finishes.
All Iterate tasks in workflows that were executed locally using ONE Desktop are run in |
Pass variables
If the workflow has input variables defined, you are prompted to enter their value after you select Run. The engine remembers the values of variables used for previous executions. To keep the variables permanently and never be asked again, clear the Prompt me for variables before launching option.
Was this page useful?