Step 1: Defining the Workflow Class

In this step, you will define the class where the workflow will be implemented in later activities of this guide.

A workflow is defined in an extension of the graph for which the workflow should be applied. For example, if you need to implement a workflow for the Opportunities (CR304000) form, whose business logic is defined in the OpportunityMaint graph, you need to create an extension of the OpportunityMaint graph. In this step, you will define the RSSVWorkOrderWorkflow class that will contain a workflow for the Repair Work Orders (RS301000) form.

To define the RSSVWorkOrderWorkflow workflow class, do the following:

  1. In the PhoneRepairShop_Code project, create the Workflows folder.
  2. In the Workflows folder, add a new item named RSSVWorkOrderWorkflow.cs based on the C# class template .
  3. In the RSSVWorkOrderWorkflow.cs file, define the workflow class, as the following code shows.
    using PX.Data;
    using PX.Data.WorkflowAPI;
    using static PX.Data.WorkflowAPI.BoundedTo<PhoneRepairShop.RSSVWorkOrderEntry,
      PhoneRepairShop.RSSVWorkOrder>;
    
    namespace PhoneRepairShop
    {
        public class RSSVWorkOrderWorkflow :
          PX.Data.PXGraphExtension<RSSVWorkOrderEntry>
        {
    
        }
    }
  4. Use Acuminator to suppress the PX1016 error in a comment. In activities of this guide, for simplicity, the graph extension is always active.
  5. Save your changes.