Step 3: Overriding the Configure Method
Do the following:
- In the
RSSVWorkOrderEntry_Workflow
class, declare the static Configure method as the following code shows.protected static void Configure(WorkflowContext<RSSVWorkOrderEntry, RSSVWorkOrder> context) { }
In the code above, the Configure method has one parameter of the WorkflowContext type, which has two type parameters: the graph of the form for which workflow is defined, and the primary DAC of the form.
- Override the Configure(PXScreenConfiguration config) method and call
the static Configure method inside it, as the following code
shows.
public sealed override void Configure (PXScreenConfiguration config) { Configure(config.GetScreenConfigurationContext<RSSVWorkOrderEntry, RSSVWorkOrder>()); }
In the code above, you have gotten the current context of the screen configuration for the Repair Work Orders (RS301000) form by specifying the form graph and primary DAC as parameters of the GetScreenConfigurationContext method.
- In the static Configure method, add a template for defining the
default workflow, as the following code
shows.
context.AddScreenConfigurationFor(screen => screen .StateIdentifierIs<RSSVWorkOrder.status>() .AddDefaultFlow(flow => ...) );
In the code above, you have added a new screen configuration for the Repair Work Orders (RS301000) form, specified the field that is the state identifier and started adding the default workflow by calling the AddDefaultFlow method.
- Save your changes.
Now you are ready to add the definition of the workflow to the screen configuration.