How to create your first workflow configuration
This post is meant as an example to create your first working workflow.
This is not an explanation of everything that can be done by using workflows, and also not an explanation of all the fields.
For more info and details, see this post: Workflow configurations
Introduction
We are going to create a workflow configuration that contains user interaction and a process call.
The overall way of working of all workflow configurations is:
- Create a workflow configuration record.
- Create a workflow step.
- Set the initiating transaction (Important step that is best to do ASAP)
- Creating a second step
- Adjusting the transition expression
- Making sure there is an end to the workflow.
1. Create a workflow configuration record
First add a new workflow configuration:
Settings > Workflow configuration > add button
2. Add a step: User interaction
a. Click add from workflow configuration page:
b. Fill in an internal_name (this name can be referenced to in later workflow steps. Make sure to use lowercase and underscores).
c. Choose step_type: User interaction
d. Save the step.
e. In the Questions and Buttons forms you can ask input from the user. Let’s start with asking a question.
f. Add a question.
- Fill in the fields.
- Keep the datatype to “Text”
g. Next we will add a button.
- Fill in the fields
- Make sure the internal name is lowercase.
3. Add a initiating transition
- Go back to the workflow configuration page and add an initiating transition.
The reason you need to add this is so the workflow configuration know with which step to start. This is also required if you want to reference other workflow-steps, because the system will check if the workflow-step is within context.
- Choose in the ‘To’ searchlink your created step.
By leaving the “From” empty, the system know this is the first step.
4. Add a step: Process call
a. Go back to the workflow-step we created in step 2. From here we will create a new workflow-step by using the “Outgoing transitions” form.
This streamlines the flow of creating the workflow-steps and will automatically create a transition between the steps.
-
-
- Click “Add”.
b. Fill in an internal_name (this name can be referenced to in later workflow steps. Make sure to use lowercase and underscores).
c. Choose step_type: Process call
d. Choose process call: Add/Edit (if this doesn’t exist yet, see this topic about proces action definitions)
e.
f. Also fill in the parameters that belong to the chosen process:
- record: “organizations:getnull()”
- values: “[<“name”, this.my_first_workflow_step.question_text.concat(” - Created by workflow at “).concat(datetime:now().tostring())>]”
- This expression might be a bit intimidating, below a short description:
- This is the syntax [<“fieldname”, where expression>]
- “my_first_workflow_step” refers to the workflow-step we created. If you used a different name, this needs to change accordingly.
- “.question_text” will return the value provided by the user for that question. If you used a different name, this needs to change accordingly.
g. Save the step
5. Adjust the transition by providing an “if true” expression
a. Within the workflow step of step 3, click on the incomming transition. This will open a form where we can provide an expression.
b. We want to listen to when the user clicks on the “Next” button. This can be done by using this expression.
- Expression: “this.my_first_workflow_step.button.equals(“next”)”
6. Add outgoing transition that ends the workflow
- Open the step from step 3 again and add an outgoing transition:
- Leave “To” empty in this case, so the transition goes from this step to nothing (end of workflow)
–
[Topic ideas]
- Example of all step types
- Currently available: User interaction; Process call
If you have any suggestions for more examples, please comment below.