Skip to main content
All CollectionsWorkflow ManagerCreate a Workflow Trigger in a Project
Create a Workflow Trigger for Files in a Project
Create a Workflow Trigger for Files in a Project

This article helps you understand how to create a workflow trigger for files in a project.

Updated yesterday

Pre-requisites:

  • Required role privilege 'Manage Workflow Rules' on the project where a workflow trigger needs to be created.

The steps to create a workflow trigger event on a document are as mentioned below:

You have the option to configure a workflow trigger for files right after publishing a workflow from the workflow designer. In such a case, you will get a prompt message stating 'Do you want to configure a Trigger now?'. Here, click the 'Yes' option and follow the steps below - from step number 3 onwards.

1. Navigate to the 'Workflows' tab and select the project.

2. Click the 'Create Trigger' button to start creating a trigger event.

Alternatively, right-click on the project name and select the 'Create Trigger' option.

3. Enter the required details for all the mandatory fields in the 'Configure Trigger' screen:

3.1. Name - Name of the trigger.

3.2. Priority - At any given point in time, only one running workflow is allowed on a document. Below are the key factors to be considered while setting the priority of a workflow:

  • A new workflow can get kicked off on a document only when the earlier workflow is completed.

  • To decide which trigger gets precedence when there are multiple triggers with matching conditions, you can use the priority field. The triggers with higher priority will be kicked off first, and then the triggers with lesser priorities will be kicked off one by one.

  • All the triggers will execute which are configured with the system tasks event, while only one trigger will execute which is configured with the workflow definition event.

  • If there is more than one trigger with matching conditions and priority, then any one of them will get kicked off. In case this particular trigger fails, the next trigger with a matching condition would be initiated right away.

  • In the case of 'Pre' task mode, only one trigger will execute having higher priority irrespective of the number of triggers with matching conditions.

3.3. Description - A brief description of the trigger to be created.

3.4. Context - Select the trigger context as 'Document'.

3.5. Trigger Conditions - You can create various trigger conditions using 'AND' / 'OR' (logical operators). Workflow triggers for files can be created by using combinations of folder, purpose of issue, document status and configurable attributes set up in a project.

The rule is the single logical statement created based on one or more conditions defined by the user.

The trigger is executed based on this statement under different matching conditions. You can see the actual rule (statement) that will get applied based on the conditions defined for workflow trigger just like below:

Different brackets and text colours used to present the 'Applied Rule' can make it easy for you to understand how the workflow trigger would get applied based on the conditions entered, irrespective of the complexity of the rule.

Working of logical operators:-
------------------------------------------------------------------------------------------------------------------
<Condition 1> <logical operator (AND)> <Condition 2>

Description:- For 'AND' logical operator, both conditions must be satisfied (true).

<Condition 1> <logical operator (OR)> <Condition 2>

Description:- For 'OR' logical operator, any condition should be satisfied (true).

------------------------------------------------------------------------------------------------------------------

If I want the workflow to trigger when any revision is published in the folder named 'Architecture' having the status 'Design Draft', I need to select:

Condition One: Folder is equal to 'Architecture' AND


Condition Two: When the file status is 'Design Draft'

You can use a combination of logical operators to cover a business process.

Example

<Condition 1> <logical operator (AND)> <Condition 2> <logical operator (AND)> <Condition 3> <logical operator (OR)> <Condition 4>

Description: The above scenario should work as:

{( <Condition 1> <logical operator (AND)> <Condition 2> <logical operator (AND)> <Condition 3>) <logical operator (OR)> <Condition 4>}

If I want the workflow to trigger when any revision is published in the folder named 'Architecture' having the purpose of issue as 'A' or 'B' and when the status of the document is X or Y...

Condition One: When the purpose of the issue is 'A' OR


Condition Two: When the purpose of the issue is 'B' AND

Condition Three: When file status is 'X' OR


Condition Four: When file status is 'Y' AND

Condition Five: Folder is equal to 'Architecture'
Interpreted As: (poi=A OR poi=B) AND (status=X OR status=Y) AND (folder=Architecture) - Correct Way

The system automatically uses parenthesis (brackets) starting from left for the same logical operator.

The logic for parenthesis is as below:

Start with a bracket for the first field and as long as you get the same operator don’t close the bracket. When the operator changes, close the bracket and start a new bracket.

Example

A = 2 or A = 4 and C = 3 or C = 5 and B = 1 will be interpreted as (A = 2 or A = 4) and (C = 3 or C = 5) and (B = 1)

Suppose workflow has to be kicked off when the user publishes a document in folder 'A' having either document status as 'S1' or purpose of issuing file as 'P1', then the same has to be configured as mentioned below:

Folder == A AND Status == S1 OR POI == P1 - Interpreted as (Folder ==A AND Status == S1) OR (POI == P1) - Wrong way

Status == S1 OR POI == P1 AND Folder == A - Interpreted as (Status == S1 OR POI == P1) AND (Folder == A) - Correct way

The folder name is kept as 'Design' & document status as 'Review' for explanation.

1) Folder == Design AND Status == Review

If both conditions are true then and only then workflow should be triggered.

2) Folder == Design OR Status == Review

If any condition is true then workflow should be triggered.

3) Folder == Design AND Status == Review OR POI == For Acceptance

System uses braces as {(Folder == Design AND status== Review) OR (POI == For Acceptance)}

In this scenario, workflow will be triggered only if either (Folder == Design AND Status == Review) is true or (POI == For Acceptance) is true.

(If you want the design folder to remain common then first the conditions need to be added for document status and purpose of issue and then use the folder condition with AND operator at the end i.e. Status == Review OR POI == For Acceptance AND Folder == Design)

Click here for detailed help on how to use independent system tasks.

3.6 Trigger Event - Select the appropriate event which should trigger the workflow (as configured by the user). Trigger events for files can be:

3.7. Task Mode - Select the task mode either 'Pre', 'On-Load' or 'Post' for which this trigger will be used.

  • Pre - An event which is executed before the completion of the desired event i.e. publishing of a document or creation of an app. System tasks with 'pre' task mode can be created by using Groovy scripts only. 'Pre' task mode is currently available for the following events:
    Publish Documents, Edit Attributes, Download Document, Print Document, View Document

  • On-Load - An event which is executed just before the event-specific page or screen loads in the user interface i.e. edit status page load or download document page load. System tasks with on-load task mode can be created by using Groovy scripts only. On-load task mode is currently available for the following events:
    Publish Documents, Change Status, Edit Attributes, Download Documents, Create Discussion, Create Discussion Reply, QR Code Scan

  • Post - An event which is executed after completion of the desired event i.e. publishing of a document or creation of an app. 'Post' task mode is currently available for the following events:
    Publish Documents, Change Status, Static Link, Edit Attributes

3.8. Task Type - Select the type of task to be performed based on the selected trigger event and task mode.

3.9. Task - Select the relevant system task if this trigger is for an independent system task or select the relevant workflow definition if this trigger is for a workflow.

4. Click 'Create' to complete creating a trigger event for the workflow on the document.


Check: FAQs


Did this answer your question?