Versions Compared

Key

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

This tutorial will show how easy it is to create an Approval Workflow using . We will use an Expense Report workflow as an example. Consider this business scenario:

  • The employee accesses the Expense Report workflow and fills in the form, signs it and clicks Continue.
  • sends that employee’s manager a notification.
  • The manager clicks on the notification [on any device], can view the expense report request and approve it or send it back for corrections.
  •  If approved by the manager and the total amount of the expense report is greater than $1000.00, the workflow will be routed to the VP for further approval otherwise it will continue to employees in HR for final processing.
  • Final processing might include integration with a database or with a back end system.

 

Column
width375px

On This Page:

Table of Contents
maxLevel1

...

  1. Click the Edit button for the Approval Forms/Workflows application on the Application Home page. 

     

  2. Click the Flows tab and then click Edit for the Expense Report flow:   

     
     

  3. At this time, the Expense Report flow only contains the form named Expenses. The Expense report form was created using simple visual drag & drop and edited to achieve the desired layout. To view the form, click the  icon on the flow designer toolbar. 



  4. There are sections in this form for the Reviewer, Supervisor and Accounting approvals. A business rule  controls when these sections are shown/hidden as the flow progresses. For Example, when the employee is filling out the Expense Report, the Reviewer, Supervisor and Accounting sections are hidden.  

    Expand
    titleClick here for more information on these rules.This section will expand/collapse by clicking on the arrow.
    The simple business rule shown below controls when these sections are shown/hidden as the flow progresses.

     

    Rules will be even easier to implement in a future release of .  
     

  5. Other Business Rules autofill the Report Date, employee information and the Reviewer name using the credentials of the user who is logged in. Another rule enables/disables the Miles Travelled field based on a selection from the Category dropdown. There is a rule to calculate the mileage and a separate rule to calculate the expense report grand total.  

    Expand
    titleClick here for more information on these rules.This section will expand/collapse by clicking on the arrow.

    This rule populates the Report Date field with the current date when the form loads:

    Code Block
    if (form.load) {
      ReportDate.value = DateUtil.today();
    }

    This rule autofills the First Name and Last Name controls using the credentials of the user who is logged in. The Reviewer for the user filling out the Expense Report comes from the "subject.reports.to" field on the Add/Edit users screen.

    Code Block
    if (form.load && EmployeeName.value.length === 0) {
      EmployeeName.value = _data.getParameter('subject.first.name') + ' ' +
                          _data.getParameter('subject.last.name');
      Reviewer.value = _data.getParameter("subject.reports.to");
    }

    This rule enable/disables the Miles Travelled field based on a selection from the Category dropdown. The Miles Travelled control will only be enable for user input when "MIleage" is selected as the Category dropdown choice. Otherwise, the user cannot enter data into the Miles travelled control.

    Code Block
    for (var i = 0; i < Category.value.length; i++) {
      if (Category[i].value == "Mileage") {
        MilesTraveled[i].enabled = true;
      } else {
        MilesTraveled[i].enabled = false;
      }
    }

    This rule calculates the mileage for each row in the Expenses Table:

    Code Block
    for (var i = 0; i < MilesTraveled.value.length; i++) {
      if (MilesTraveled[i].value > 0) {
        Amount[i].value = MilesTraveled[i].value * IRSMileageRate.value;
      }
    }

    There rule adds the amount for each row in the table to calculate the Expense Report Grand Total. 

    Code Block
    var tot = 0;
    for (var i = 0; i < Amount.value.length; i++) {
      tot = tot + Amount[i].value;
    }
     
    GrandTotal.value = tot;
    if (ExpenseRepeat.itemRemoved) {var x;}
  6. Using the  Linked Forms Feature of the flow designer, we can add a linked version of the parent form, Expenses, for each of the remaining steps in the  flow. Click the Link icon three times to create three linked forms. 
     

  7.  Click on the second activity in the flow. Change the name to Reviewer, by typing it in the name field on the left Activity Property pane. Rename the third activity in the flow, Supervisor and the last activity Accounting.  

     

  8. Click the  icon to save the flow.

...

Share URL:  Click the  Share icon for the workflow on the Flows Home Page and select the third option: Link (Email/Web page). Copy this link and paste it into a different browser.  will display the login screen. Continue with the Employee Submission section below:

Spaces:  A   space is a frevvo website that can be used to test the Expense Report flow. It is very easy to create and add your forms and workflows to it. Follow these steps to create the space:

  1. Ensure the visibility of your Expense Report flow is set to public and that it is deployed to production: 
    Image Modified 
  2. Click on the Spaces Tab. Click the Image Modified icon. Enter an id and name for your space. Click Create.
  3. Click the Image Modified Share icon. Copy the share url for your space then logoff . Paste the space url into another browser or a new tab of the browser you are using. Login as your designer user.

    Image Modified
     
  4. Your space will look similar to the image below. 

     

...