Search Results for

    Show / Hide Table of Contents

    Build the decision workflows

    Introduction

    Caseworkers decide on an application with one of two workflows: Ga Approve Application or Ga Reject Application. Unlike the submission workflow, they don't create anything: they work on the application the caseworker selected in the list, which the workflow gets as its input. Each has:

    1. a form where the caseworker writes a note to the applicant, and
    2. a script that records the decision: the status, who decided and when.

    You build Ga Approve Application first; Ga Reject Application is the same with another status.

    Create Ga Approve Application

    1. Check that Grant Applications is selected in the product selector.

    2. Open Workflow Definitions and click Create.

    3. Fill in General:

      Field Value
      Name Ga Approve Application
      Display Name Approve
      Used For Creating New Cases ☐
      Accept Input ☑
      Require Data Object As Input ☑
      Window Size Small
      Hide Step Pane ☑

      The decision workflow's General settings

      Require Data Object As Input makes the workflow run on a record: the grid button that starts it is enabled only when a row is selected, and the selected application is the workflow's input.

    4. Open Data Classes, click Add existing, tick GaApplication and click Add.

    5. Click Save.

    Add the form

    1. In Steps, click Form.

    2. Fill in Name Decision form and Display Name Approve the application.

    3. In Fields, click Add and fill in Add Data Source:

      Field Value
      Data Class GaApplication
      Name GaApplication
      Reference Type Single Object
      Reference To Existing Object
      Data Context Input

      With Existing Object and Input, the form shows the application the workflow got as input, instead of a new one.

      The data source of the decision form

    4. Drag DecisionNote onto the canvas.

      The decision form

    5. Click Save And Close.

    Add the script

    1. Click Script, type the Name Record approval and paste:

      // The application the caseworker chose in the list (the workflow's input)
      var applicationId = (string)ctx.Input.Id;
      
      ctx.Use<IDataApi>().Update(applicationId, new
      {
          Status = "Approved",
          DecidedBy = ctx.User.GetClaim("FullName") ?? ctx.User.Username,
          DecidedAt = DateTime.UtcNow
      });
      

      The Record approval script

    2. Click Save And Close, then Build, and check that the status is Passed.

      The steps of Ga Approve Application

    3. Click Save And Close.

    Create Ga Reject Application

    Create a second workflow the same way, with these differences:

    Where Value
    Name Ga Reject Application
    Display Name Reject
    Form's Display Name Reject the application
    Script's Name Record rejection
    Script Status = "Rejected", instead of Status = "Approved",
    Tip

    When two workflows differ only a little, a rule or a workflow variable can let one workflow do both. Two small workflows are easier to read and to secure separately, which suits a first application.

    Next: Build the caseworker site.

    In This Article
    Back to top Generated by DocFX