Workflow Actions: To Configure the Conditional Appearance of the Action

This activity will walk you through the process of implementing an action that appears conditionally and adding it to a workflow. The activity will also describe how to implement an action with a long-running operation.

Learning Objectives

In this activity, you will learn how to do the following:

  • Define a graph action with a long-running operation
  • Add a workflow action to the screen configuration
  • Configure the conditional appearance of the action

Story

For a repair work order to be billed and then paid, a user needs to create an invoice for the order. An invoice can be created for a repair work order only if it has the Pending Payment or Completed status and no invoice has been created for this repair work order. You need to implement the CreateInvoice action, as well as to configure the conditional availability of the associated button on the form toolbar and the equivalent command on the More menu.

Process Overview

In your extension library, first, you will define the CreateInvoice action in a graph. Then you will add this action to the screen configuration and to the states of the workflow where the action should be available. You will also define a condition depending on which the action the action should be available.

System Preparation

In an instance with the T100 dataset, make sure that you have done the following:

  1. Prepared an instance with the PhoneRepairShop customization project and enabled the workflow validation by performing the prerequisite activities of the Preparing an Instance for Workflow Customization chapter.
  2. Prepared the screen configuration and defined the set of states by performing the prerequisite activities in the Preparing a Screen Configuration chapter.
  3. Defined the Pending Payment and Completed states by performing the Transitions: To Implement a Simple Transition and Workflow Actions: To Implement an Action with Field Assignments prerequisite activities.