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:
- In the PhoneRepairShop_Code project, create the Workflows folder.
- In the Workflows folder, add a new item named RSSVWorkOrderWorkflow.cs based on the C# class template .
- 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> { } }
- Use Acuminator to suppress the PX1016 error in a comment. In activities of this guide, for simplicity, the graph extension is always active.
- Save your changes.