Pre-requisites:
Required role privilege 'Manage Workflow Rules' on the project where a workflow needs to be created.
Steps to create a new custom object workflow are mentioned below:
1. Navigate to the 'Workflows' tab and select the project in which a new workflow needs to be created.
2. Click the 'Create Workflow Definition' button at the top right to start creating a new workflow.
Alternatively, right-click the project name and select the option 'Create Workflow Definition'.
3. Capture required details in mandatory fields (marked with a red asterisk).
3.1. Workflow Name - Name which you want to give to the new workflow.
3.2. Description - Capture a brief description of this new workflow.
3.3. Workflow Context - Select 'Custom Object' as workflow context.
3.4. Custom Object Template - Select the 'ISS Issue' option and continue.
3.5. Total Workflow Days (Optional) - Enter the total length of the workflow in the number of days.
4. Once done, click on 'Create' to proceed to the workflow designer.
The visual workflow designer screen will appear. Various shapes and tools will appear as mentioned in step 4 in 'Create Workflow for Files'.
5. Example Scenario
Let us create an example workflow using the above shapes as per below mentioned scenario:
Workflow starts when a new model issue is created.
The defined user has to complete a user task 'For Action' on that model issue.
The custom object is then distributed to other users as per workflow configuration.
Workflow ends.
Steps to create workflow as per the above example:
5.1. Drag and drop the 'Play' shape onto the drawing board to start creating a new workflow. This is the starting point of the workflow.
5.2. Drag and drop a connecting object (arrow) coming out from the start event.
5.3. Add a new user task which is connected with the start event using the connecting arrow mentioned above.
5.4. Once the new user task is added, you need to configure properties for the same.
5.4.1. Name - Key in a name for this user task.
5.4.2. Description - Enter a brief description of this user task.
5.4.3. Task - Select the task you want the user to perform. Currently, the only user task available is 'For Action'.
5.4.4. To - Select the user who needs to perform the above task. You can select multiple users. In this example workflow, it will be a document controller.
Roles and organizations can be selected instead of individual users if a task needs to be assigned to multiple users.
Tasks can also be assigned to 'Workflow Originator' and/or 'CustomObject Creator'. The visual workflow engine will pick up these values dynamically based on the actual custom object or workflow being executed.
5.4.5. Due Days - Specify the number of days you want to give the user to complete the given task. Please key in '2D' if you want to give 2 days.
5.4.6. Workflow Transition Condition - Select an appropriate option from the dropdown.
Wait for all users to complete task: Workflow will halt until all selected users have completed the tasks assigned to them.
Proceed after any one person completes task: Workflow will start progressing the moment at least one user completes task.
5.5. Add a new system task which is connected with the 'For Action' user task event using the connecting arrow mentioned above.
5.6. Once the new system task is added, you need to configure properties for the same.
5.6.1. Name - Key in a name for this system task.
5.6.2. Description - Enter a brief description of this system task.
5.6.3. Task Type - Select a task type you want the system to perform. In this example workflow, it will be 'Status Change'. (It is assumed here that there is already a system task created for the 'Status Change' task type in the selected project.
In case there are no system tasks created in advance, you won't be able to set the 'Task' property leading to a validation error while trying to publish the workflow.
Click here to understand how to create system tasks for custom objects.
See below for a list of supported system tasks:
Context | Supported System Tasks |
File | Execute Groovy Script Email Notification Distribute Custom Objects Clear Tasks |
Task - Based on the selected task type, a popup will appear. Select a 'Config Name' which corresponds to the selected task type.
5.7. Drag and drop an end event and connect it with the 'Distribute' system task i.e. the output of the system task is the input of the end event.
Now the workflow is fully configured & you need to save it by clicking on the 'Save' button at the top left. The completed workflow is shown in the image below:
5.8 In case you are using a flow condition, below is a list of supported parameters:
Context | Supported Parameters in Flow Condition | Actual Name in Flow Condition | Supported Values |
App | App Status | status | Auto populated |
6. The system will give a prompt if the workflow needs to be published now or later, workflow once created needs to be published to be able to run it.
Click on 'Yes' to publish the workflow or click on 'Later' if you wish to publish it later.
7. Clicking on 'Yes' to publish the workflow, you are prompted to create a trigger event for this workflow. If you are saving a new workflow created in a project template, then this option to configure triggers is not available.
8. Click 'Yes' to configure a trigger event for this workflow. Click here to understand how to create a trigger event.
9. Once the trigger event is configured, the workflow is ready to use and it will start working the moment the trigger event occurs.
As per the scenario mentioned in the above example workflow, the user selected as per the workflow configuration will get a 'For Action' task on the custom object. It will then be distributed by the system based on the system task configuration. Then, the workflow ends.
Note: A maximum of 2000 workflow definitions are allowed to be created on a single project or a single project template. This can include workflows of all types including files, forms and custom objects.
Next Article: Edit Details of a Workflow (in a Project)