Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This page is for new to experienced workflow designers who are building a new workflow and looking for a pattern to meet their business requirements. These examples may help you to choose the best design pattern for your situation before you begin building it. Here is chart to help you compare some common patterns; many workflows combine multiple patterns.

...

 A navigation toolbar is displayed and the user will be able to navigate back and forth between the various steps in the screenflow. Note that you cannot go forward to the next step until the current step is valid.  will  frevvo will automatically enforce this constraint similar to the way forms cannot be submitted unless they are valid.

...

Leave the Assign to Role field empty. Click Submit.


Image RemovedImage Added

Dynamic User Assignment

You must have a control in any previous step with the specified name, i.e. in the example shown, you must have a control in the Leave Approval form from the first step with name ManagerId. This control must be populated with the  user frevvo user id of the specific person that you want to route to. At run-time,  will frevvo will resolve the target user id using the data in the ManagerId control and will route the workflow to that specific user.

...

Note

You may want to route a step in a workflow to the user's manager.  provides  frevvo provides a built-in template that is available for every transaction. Select the template {subject.reports.to} from the Assign to User dropdown. The workflow will then be routed to the user who is specified in the Reports To field on the User's configuration screen

...

  1. Add a control with name ApproveRole.
  2. Add a business rule that populates ApproveRole with Supervisor if Amount is <1000, and Manager if Amount is >1000.
  3. Click the approval step to open the Workflow Step Properties, and select the Assignment tab.
  4. Enter the template e.g. {ApproveRole} in the Assign to Role field.
    Image RemovedImage Added
Tip

Workflow steps that are assigned to a user, role, anonymous or dynamically are each considered their own 'task.' In the example above for Using Dynamic Workflows, there are two steps which are also two tasks. This workflow task design consideration is helpful to know when designing approve/reject steps, applying business rules and viewing audit trails.

...

  1. Click on the Actions workflow step. Click the Settings tab. Check Saved to the task list and Save to Role.
  2. Navigate to the Assignment tab. Add the appropriate role or dynamic role as described above to the Assign to Role field. In our example, the assigned role is SupportStaff.
  3. Click on the Guided Designer: Settings editing mode  and check Save/Load. This enables Save/Load for the workflow as a whole.


Image RemovedImage Added

At run-time, a member of the support staff performs this step, takes an action and logs it in the workflow. While this user is performing the steps, other users in the Support-Staff role are locked out. When the user is done, he/she can click the Save button in the workflow rather than the Continue or Finish button as shown below. This will place the step back into the Task List of all members in the Support-Staff role.

...

  1. Click on the Reviews workflow step. Click the Settings tab. Check Save to the task list and Save to User.
  2. Navigate to the Assignment tab. Add the {Reviewer} template to the Assign to User field.
  3. Click on the Guided Designer: Settings editing mode  and check Save/Load. This enables Save/Load for the workflow as a whole.

Image RemovedImage Added

At run-time,  will frevvo will resolve the dynamic user id using a control in the form and the proposal will first be routed to that user. The user can make comments and decide to pass it on to a different reviewer. To do so, he/she selects the next reviewer from a control in the form e.g. a drop down and clicks the Save button in the workflow rather than the Continue or Finish button as shown below. This will place the step into the Task List of the selected Reviewer.

...

Expand
titleClick here to walk through this example step by step...

We'll walk through this example step by step.

Create the Workflow
  1. Create a workflow with two steps: Contact Request and Account Management.
  2. Set up the form as desired, but be sure to add the following fields in the Account Management Section:
    1. Radio: What would you like to do with this request? with three options: Take, Assign, and Return. Set the option labels as desired.
    2. ComboBox: Assign To User (set to frevvo Users). If the user chooses to save the task to a different user, they will enter the userId here. You could use a dropdown or even a text control, but be sure it will resolve to a valid userId.
    3. Text: UserID. This can be hidden as it will be set by a business rules.
    4. Text: Role. This can be hidden as it will be set by a business rule.
    5. Text: Save Label. This is optional but can help personalize the form and give the user more context for what Save action they are performing. It is also hidden. We'll use it as a template to dynamically change the text on the Save Button based on the option the user selects.
    6. In our example form, we've also provided a Comments TextArea in a Repeat, so users can provide additional comments if the task is saved multiple times.
Add the Business Rule

Add a Business Rule like the following. This rule sets the UserID, Role, and Save Label fields based on the selection made in the radio What would you like to do with this request?. It also shows the Assign to User control if the user selects "Assign" so that they can enter a specific user to assign the task to.


Code Block
var event = form.load;
// If the user wants to save the task to their own task list, set the userID to their id and other fields to null.
if (WhatWouldYouLikeToDo.value === 'Take') {
  UserID.value = _data.getParameter('subject.id');
  Role.value = null;
  AssignToUser.value = null;
  AssignToUser.visible = false;
  AssignToUser.required = false;
  SaveLabel.value = 'Save to your task list.';

// If the user wants to reassign the task to a specific user, allow them to select that user.
} else if (WhatWouldYouLikeToDo.value === 'Assign') {
  AssignToUser.visible = true;
  AssignToUser.required = true;
  UserID.value = AssignToUser.value;
  Role.value = null;
  SaveLabel.value = 'Save to ' + UserID.value + "'s task list.";
  
// If the user wants to save the task back to Manager task list, set the Role Manager and clear the user values.
} else if (WhatWouldYouLikeToDo.value === 'Return') {
  AssignToUser.visible = false;
  AssignToUser.required = false;
  AssignToUser.value = null;
  UserID.value = null;
  Role.value = 'Manager';
  SaveLabel.value = 'Return task to the Manager Role';

// Set Role to Manager by default if nothing is selected to avoid invalid task assignment
} else {
  AssignToUser.visible = false;
  AssignToUser.required = false;
  AssignToUser.value = null;
  UserID.value = null;
  Role.value = 'Manager';
  SaveLabel.value = 'Please select an option above if you would like to save this task.';
}
Edit Workflow Settings

In Settings editing mode, check Save/Load, which will show a Save button on the form.

Workflow Step Settings and Assignment

Return to Workflow editing mode.

  1. On the Account Management Step, check Save to the Task List, Save to Role, and Save to User.
  2. In the Save Label property, enter the template {SaveLabel}. This will show the Save Label that you set in your business rule on the form's Save Button.
    Image RemovedImage Added
  3. In the Assignment Tab, set Assign to User to the template {UserID}, then set Assign to Role(s) to the template {Role}. You must use templates here; if you enter a specific user or role(s) this workflow will not work as expected.
    Image RemovedImage Added
Test the Workflow
  1. Click Save and Test. Enter any info in the first step, Contact Request, and click Continue. The business rule sets the control Role to Manager by default, and the control UserID to null, so Step 2 Account Management will be assigned to the role Manager. Every user in that role will get a Task Notification email, and will have the option to perform the step.
  2. Login as a user with the role Manager and go to the Task List. Click on the task for this workflow, and view the Audit Trail. Notice that the step is assigned to the role Manager. 
  3. Perform the step. Choose the Option "Take it", and click the customized Save to your task list button at the bottom. Then, view the audit trail again and notice that the task has been saved to this user's (in this case, Jerry's) task list. This happened because the business rule has set the UserID control to "jerry" and the Role control to null, and the Save to User option is checked.



  4. Perform the task again. This time, select Assign to a Specific User. Notice that the Assign to User field becomes visible and required. Enter or select a valid user, and notice that the Save button's label updates to Save to <user>'s task list. Click that Save button. The task disappears from your task list, and Sue (or the user you selected) gets a Task Notification email.
  5. Login as the user you just assigned this task to, and find the task on their Task List. Check the Audit Trail, and see that the business rule set the UserID field to the user you entered in AssignToUser, and the Role field to null, which triggered Save to User to assign the task to this user.
  6. Perform the task, and this time select Return it to the Manager Role. Notice your custom Save button label updates, and click it. The business rule will set the Role control to Manager and the UserID field to null, which allows the Save to Role feature to run. This returns the task to the task list of all users in the Manager role, and also notifies them. 
    Image RemovedImage Added
  7. Login as any user in the Manager role. Locate the task and check the audit trail, noticing the most recent Save operation which assigned this task to the role Manager. When you perform the task, you see all comments previously added by the other users. You can add more comments, and Finish the Workflow.


...

Sending a workflow step to an Email address allows the step to be performed by an anonymous user. An anonymous user is a person who does not have an account in your tenantfrevvo tenant

This a common workflow scenario. Some examples are:

...

  1. Step 1 is filled out by the company sales person. The sales person is logged into for frevvo for this step.
  2. An email is sent to the customer with a link to Step 2 for the customer's review and signature. The customer is an anonymous user as they are not required to log into to frevvo to perform this step. The workflow is suspended until the customer performs step 2.
  3. Step 3 routes the workflow back to the sales person for continued processing. The sales person is logged into for frevvo for this step.

In the Workflow Designer:

  • Step 1 contains an Email control, named ClientEmail, where the sales person enters the customer's email address.

  • Step 2 is the the step that the Anonymous user sees. In this example, it is assigned to the {ClientEmail} form field template. To route the workflow to an email address in your workflow

    1. Click the three dot action menu on the anonymous step. Select Edit Properties.

    2. Select the Assignment tab.

    3. Add the email address or the control template to the Assign to Email (No login required) field.

  • This step sends a task notification email to the customer's email address provided by the template. The email contains a link to Step 2. When the customers clicks on the link, the workflow is suspended until step 2 is completed.

  • Step 3 in our example is assigned the role of Sales. When the customer approves/rejects the Purchase Order, a task is sent to the Sales person - an authenticated user with a Sales role. The Sales person must log into to frevvo to complete the workflow.
    Image RemovedImage Added

    Note

    The anonymous user can click the link more than once.


Refer to the Workflow Tutorial for step by step instructions to create the Purchase Order workflow described above and for more information about other features available in in frevvo.

Anonymous Screenflow

A screenflow is a series of consecutive workflow steps performed by the same user. Consider the situation where you want to collect a large amount of information from an anonymous user  Some examples are:

...

Step 3: Approval Step (notice that Reject is available here, so this workflow could be sent back to the anonymous user for corrections.)

Image RemovedImage Added

Automated Step

...

  1. The first step is the Membership Renewal form filled out by the member.
  2. The second Step uses http Wait-Notify to send the data to an external payment processing system. The workflow suspends until that system replies.
  3. The third step sends the workflow back to a unauthenticated user in a  tenant frevvo tenant to process the membership.

...

Expand
  1. Build the Employee Review Workflow first. This is the workflow that is launched by the Employee Review Launch Form. Follow these steps:
    1. Create a new workflow and name it Employee Review workflow. If you want to know more about creating workflows refer to Workflow Tutorial.
    2. Drag and drop 4 text fields from the palette. 
      1. Name them EmployeeID, ManagerID, FirstName, LastName respectively in the properties panel of each text control.
      2. You can add any additional fields you want but that is optional. 
    3. Click Workflow to return to the Workflow Diagram. Click the first step to display it's properties.
    4. In the Assignment tab enter {ManagerID} in the Assign to User field.

      Note

      If assigning the first step to an email address template, you must set encode=false to prevent the "@" symbol from being encoded in your rule. The designer should use the template {EmailAddress!encode=false}.


    5. Select Save & Exit from the menu at the top right.
    6. Copy the Share Dialog Raw Link URL for the Employee Review workflow (the workflow you want to launch for each employee) into that field. To do this:
      1. Go to the Forms and Workflows homepage.
      2. Click the Action Menu for the Employee Review Workflow and select Share.
      3. This will open a Share workflow wizard . Click on the Raw workflow link. Copy the URL in the left textarea. NOTE: any other share URL type will not work.
  1. Follow these steps to build the Employee Review Launch Form. This form will start multiple new Employee Review workflows.
    1. You cannot launch a workflow sent to the currently logged in user’s task list. You can only send it to another user’s task list. Make sure you are not logged into the other user’s frevvo account when running the Employee Review Launch form. This is being improved in a future release.
    2. Create a form named Employee Review Launch Form. To know more about creating form refer to Forms Tutorial.
    3. In the form drag and drop a text control from the palette. 
    4. In the control’s properties on the left, name the control WorkflowToLaunchURL. You can enter any label you like.
    5. Uncheck the visible checkbox in the control’s properties to make the control hidden. 
    6. Paste the copied URL in the Employee Review Launch Form WorkflowToLaunchURL field
    7. Make the following changes to the URL pasted in the field,
      1. Cloud customers must change http://app.frevvo.com//443/ to frevvo:// in the URL to the workflow.
      2. In-house customers must change the http:<domain>:<port> to  frevvo:// in the URL to the workflow.
    8. Save the form.
  2. Add an EmployeeID dropdown field. The HR manager will select the employees to be reviewed from this dropdown. You can either add the userId in the Options field in the properties panel of the dropdown control or fetch all the users from the tenant through business rule as below:

    Code Block
    var event = form.load;
    var Users = [];
    Users = frevvo.userIds();
    EmployeeID.options = Users;


  3. Add a ManagerID dropdown field. The HR manager selects the manager responsible for reviewing this employee. This is the task list you want the Employee Review form to be sent to. The ManagerIDs can be added through the Options property of the dropdown or fetched from the tenant through  Business rules as below:

    Code Block
    var event = form.load;
    var Managers = [];
    Managers = frevvo.userIds(“<Your Manager Role>");
    Manager.options = Managers;


  4. Add text controls named FirstName & LastName. The HR manager can enter the employee’s name or they can be fetched through Visual rule builder:

    1. Click Rules in the Guided Desinger navigation bar at the top.
    2. Click on the + icon for Create New Rule

    3. Click Run Builder Button to open the wizard

    4. On the first step enter condition EmployeeID in the first dropdown and select Is filled in the second dropdown

    5. Click Next, Select FirstName in first Dropdown, ‘to’  in the second dropdown and userFirstName() function in the third.

    6. Click Add Action in the right hand top corner.

    7. In new added line Select LastName in first Dropdown, ‘to’  in the second dropdown and userLastName() function in the third.

    8. Click Next. Add 2 Actions and set the FirstName and LastName to ‘to empty’ in the second dropdown.

    9. Click Finish. This rule will automatically populate the FirstName and LastName for the selected EmployeeID.

  5. Add a trigger control named Launch to the form. When the trigger is clicked the form will launch a new Employee Review workflow and put the first step task on the selected Manager’s Task List.

  6. Add a Business Rule to call your Employee Review Workflow via the http.get method. The rule shown below runs when the user clicks a Launch trigger button. The rule appends frevvo _data URL parameters to initialize each Employee Review workflow. The rule allows you to trigger the workflow for a different user or role when you browse the workflow URL.

    Code Block
    if (Launch.clicked){
       var myurl = WorkflowToLaunchURL.value;
       http.get(myurl + "&_data=(EmployeeID:{EmployeeID},ManagerID:{ManagerUserId},FirstName:{FirstName},LastName:{LastName})");
    }


  7. To test:

    1. Open the Employee Review Launch Form. Select a user from the Employee ID dropdown. The First and Last Name fields are populated with the selected user's information. Select a Manager from the Manager ID dropdown. Click the trigger to run the rule.
    2. Log out. Log back in with the Manager ID you selected. Verify that an Employee Review workflow task is on the Manager's Task List.

In a real case scenario, it is recommended that you:

    1. Create a separate form with all the basic information fields in it. Then add a field where the user filling in that form can add the list of users for whom he wants to start the workflow. 

    2. Create a Business Rule which uses http.get method to call your workflow URL. You will have to call this URL multiple times depending on how many users you want to create the task for. You can pass the usernames of those users and basic information data to the workflow in this URL by using _data URL parameter.

Note

If assigning the first step to an email address template, you must set encode=false to prevent the "@" symbol from being encoded in your launch rule. The designer should use the template {EmailAddress!encode=false}.


Expand
titleExpand Rule for assigning steps to emails...

To assign the first step to an email address, follow similar steps as above. Instead of a control that collects UserIDs, have a TextArea control in your kickoff form where the user can enter multiple email addresses separated by a comma (in this example, the TextArea control is named UsersProcessed.) Write a rule like this to split the email addresses and send them as _data in the workflow kickoff URL:

Code Block
var count = 0;
var i, url;
var usersProcessed;
if (TriggerFlows.clicked) {
  usersProcessed = UsersProcessed.value.split(",");
  for (i = 0; i < usersProcessed.length; i++) {
    count++;
    url = FlowTypeUrl.value + "?_method=post&embed=true&_data=(SubmitterUserId=" + usersProcessed[i] + ")";
    http.get(url);
  }
  SuccessMessage.value = count + " tasks created";
  SuccessMessage.visible = true;
}

The rule to generate tasks will not work unless you are authenticated to frevvo when using that form. frevvo doesn’t allow you to create tasks for other users unless you are logged in. This is a security measure to prevent a a malicious user who has the link to that form from creating spam tasks.


...

In some cases, a workflow needs to go backwards. Non admin users can accomplish this by clicking a configurable Reject button on the form/workflow where the user can select the step in the workflow to go back to. Tenant and workflow administrators use the  task the frevvo task list and its built-in modify task feature to reject, reassign or abort tasks. Refer to Using the Task List for information about how these features work.

...