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. You can do this via SimpleOne agent interface.
Role required: admin, wf_admin.
To create a new activity, you need to complete several steps:
- Create a table storing settings for the newly created activity.
- Create an activity type that will store parameters and bear the functionality of your newly created activity.
- Create activity exit types that will specify the exit condition from this activity.
- Configure the activity form view that will be displayed in the Workflow Editor.
Creating a table
In fact, every activity stores its settings in a child table of the Workflow Activity (wf_activity) table.
To create this child table, please complete the steps below:
- Navigate to System Settings → All Tables.
- Click New and fill in the fields.
- In the Parent field, select the Workflow Activity (wf_activity) table.
- Click Save or Save and Exit to apply changes.
For more information about the table attributes, please refer to the Table Attributes article.
Creating an activity type
Activity type is an entity intended for the categorization of the newly created or updated activities. It allows defining properties and behavior for an activity.
To create an activity type, please complete the steps below:
- Navigate to Workflow → Activity Type.
- Click New and fill in the fields.
- Click Save or Save and Exit to apply changes.
Activity type form fields
Field | Mandatory | Description |
---|---|---|
Name | N | Specify the activity type name (for example, "Send Request"). |
Active | N | Select this checkbox to activate or deactivate this activity type. If you unselect this checkbox, then you will not be able to use this activity type when creating or modifying activities. |
Description | N | Type a brief description of the activity type. |
Script | N | In this field, you can specify a JavaScript scenario implementing the activity logic. You are free to use SimpleOne Server-Side API there. |
Image | N | Attach an image that will be displayed in the workflow editor for this activity. It is recommended to use SVG files. However, other image formats will do as well. Recommended height and width: 24 px. |
Activity Type Category | N | Specify a category for the activity. Click the magnifier icon to select from the dictionary. |
Activity Table | N | This is a reference field where you can specify a table for this activity type created before. Click the magnifier icon to select from the dictionary. |
When to Run | N | A condition that should be met to run the activity type. Available options:
|
Create an activity type exit
To create an activity type exit, please complete the steps below:
- Navigate to Workflow → Activity Type Exits.
- Click New and fill in the fields.
- Select the activity type for which you create the exit in the Activity Type field.
- Click Save or Save and Exit to apply changes.
Activity type exit form fields
Field | Mandatory | Description |
---|---|---|
Name | N | Activity type exit name. |
Activity Type | N | Activity type to which this exit is related. Click the magnifier icon and select from the dictionary. |
Exit Condition | N | Specify a JS script that will return 'true' or 'false'. The script defines the condition that must be met to exit the activity. Example: activity.result == 'complete' |
Description | N | Activity type exit description. |
Order | N | 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. |
Configure the activity form layout
To configure the activity form view displayed in the Workflow Editor, perform the following steps:
- Open the record of the table you have created for the new activity.
Copy the value from the Name field and paste it in the URL address after the /record/ line (see the example below).
- In the hamburger menu , navigate to Configure → Form → Layout.
- In the Form view and section area, click Add new under the View name field.
- In the window appeared, enter "Workflow" in the View name field.
- Click Create to apply changes.
- Configure the set of fields to display on the activity form.
- Click Save to apply changes.
In case you need to see the activity record often, create a menu item:
- Open the record of the table you have created for the new activity.
Copy the value from the Name field and paste it in the URL address after the /record/ line (see the example above).
- Copy the URL address.
- Navigate to System Settings → Menu Items.
- Click New and fill in the fields.
- In the Link type tab, fill in the Table and Link Type fields with any values.
- In the Link type tab, click the icon and paste the URL.
- Click Save or Save and Exit to apply changes.
See the Navigation article to learn more about menu items and categories.
It is not recommended to modify the form layout for out-of-the-box activities. This may cause troubles adding these activities to a workflow.
- No labels