As an instance administrator, you may need to create your own workflow activity endowed with the specific logic when the default activities set does not fit your needs. So, you can do this via SimpleOne administrative interface.
Role required: admin, wf_admin.
To create a new activity, you need to complete several steps:
- Create a table блаблабла;
- Create an activity type that will store parameters and bear the functionality of your newly created activity;
- Create an activity itself;
- Create activity exit types that will specify the exit condition from this activity.
Creating a table
In fact, every activity stores its settings in a table child for the Workflow Activity (wf_activity) table. Let's take the If activity as an example. to be continued
To create this table, please complete the steps below:
- Navigate to {your_instance_url}/list/wf_activity
- Enter the hamburger menu at the top left of the page;
- Enter the Configure menu and select the Table item;
- On the page opened, scroll down to the related list area and click on the Table tab;
- Click New, and fill in the fields and click Save. For more information about the table attributes, please refer to the Table attributes article.
When filling in the Name and Title field, it is recommended to keep them synchronized semantically, like this:
Field | Value |
---|---|
Name | wf_activity_run_script |
Title | Run Script |
When naming your activity, please keep in mind the following naming rule: your activity system name should be added after the wf_activity constant. In the example above, it looks like 'wf_activity_run_script'
Creating an activity type
To create an activity type, please complete the steps below:
- Navigate to {your_instance_url}/list/wf_activity_type
- Create New, fill in the fields and click Save.
Activity type form fields
Field | Description |
---|---|
Name | Specify the activity type name (for example, "Begin"). |
Description | Specify the activity type description. |
Active | Select this checkbox to activate or deactivate this activity type. If you unselect this checkbox, then you'll not be able to use this activity type when creating or modifying activities. |
Script | In this field, you can specify a JS-script implementing the logic of the activity. You are free to use SimpleOne Server-Side API there. |
Image | Specify the favicon that will be displayed in the workflow editor for this activity. |
Activity type category | Specify a category for the activity creating. |
Activity table | This is a reference field where you can specify a table for this activity type created before. |
Create an activity type exit
To create an activity type exit, please complete the steps below:
- Navigate to {your_instance_url}/list/wf_activity_type_exit;
- Click New, fill in the fields and click Save.
Activity type exit form fields
Field | Description |
---|---|
Name | Activity type exit name. |
Description | Activity type exit description. |
Exit condition | Specify a trigger condition that must be met to exit the activity. |
Order | Specify the exit order on the activity block. The order is defined in ascending order, and exits are displayed on the activity block from the upside-down depending on their order. |