Start an Instance
Starts an Instance of a Workflow. You can optionally pass values for the input fields defined on the Workflow.
Permissions Required
You must have Find permissions to the Workflow, and the Workflow must have "Can be started manually" enabled in order to start an instance of this Workflow. Manual starts are enabled by default for Workflows in the Web App.
Method Signature
Instance start(String workflowId);
Instance start(String workflowId, String name, String description, List<Field> fields);
Parameters
Parameter | Type | Description |
---|---|---|
workflowId | String | The ID of the Workflow to start |
name | String | name to apply to the Instance |
description | description to apply to the instance | |
inputs | List< Field> | named input parameters to pass to the Instance. Must match Fields configured on the Workflow. |
returns | Instance | The started Instance |
Example
/*
* This example demonstrates finding a Workflow, starting an Instance of
* that Workflow with some inputs.
*/
import org.catalytic.sdk.CatalyticClient;
import org.catalytic.sdk.entities.Instance;
import java.util.List;
import java.util.ArrayList;
public class Program {
public static void main(String[] args) throws Exception {
// Create and initialize CatalyticClient
CatalyticClient catalytic = new CatalyticClient();
List<Field> fields = new ArrayList<>();
Field field = new Field("name", "Alice");
fields.add(field);
// Start an instance with fields
Instance instance = catalytic.instances().start(
"c9f2beec-10c0-4f2f-b4e0-1d884c7e053c",
"My first instance",
"This is my first instance",
fields
);
}
}
Updated almost 4 years ago