Creating the Validation Process Flow
In this step of the Validation Process Flow tutorial, you perform the procedures necessary to create a validation process flow, as described in the sections below:
Creating the Process Flows Record
Follow these steps to create the Process Flows record for this example:
- Open a new record from the Process Flows service.
- In the Name field, enter XY Validate Organization where XY are your initials. If desired, enter a description.
- Enter Example Business Logic in the Category field. This links the a Process Flow Categories record included with Aptify.
- Save the record.
Defining the Input Properties
The list of necessary input properties is based on the list of data used by the process flow generated during the Outlining process. In this case, the only required input property is the GEObject reference. Therefore, enter the following row on the Input Properties tab:
Name | Type | Default Value | Required | Value List Type |
GEObject | Object |
| Yes | None |
Defining the Result Codes
Create the following result codes for the Process Flows record on the Result Codes tab and then save the Process Flows record:
Code | Description | Success |
SUCCESS | Validation successful. | Yes |
VALIDATION_FAILED | Validation failed. | No |
PF_FAILED | Failure encountered during Process Flow Execution. | No |
Defining the Process Flow Steps
This section describes how to create the four steps in this process flow:
Step 1: Check the Value of the Organization Field
Follow these steps to create the first step (which is component-based):
- Click the Design tab.
- Select the Insert Component Step button in the toolbar.
- Move the cursor to the design area and click the mouse button to drop the component step in the selected location.
- A new step appears in the Design area. The step's details load in the Properties area on the right-side of the Process Flows record.
- Resize the form as necessary so you can read all of the fields in the Properties area.
- Under the Properties tab, select the drown arrow to the right of the Component field to display the available component categories.
- Expand the General category.
- Select the Value Tester component from the list.
- The component's input properties automatically flow down to the step's Properties tab.
- The component's input properties automatically flow down to the step's Properties tab.
- Enter XY Check Organization in the Name field at the top of the step's Properties dialog. Enter a description on the Description tab, if desired.
- Populate the rows on the Properties tab as specified below. Not all rows on the tab are configured, as not all of the input properties are required or necessary for the purposes of this example. Figure provides an illustration of how some of the inputs from the table below should appear in the Process Flows record.
- For this step, the process flow will check the value of the Employees.Organization virtual field rather than the value of Employees.OrganizationID. This provides additional flexibility to perform a string comparison on the Organization Name to determine if it contains the word Warehouse (note that this comparison will be case sensitive). Alternatively, you could create the check to look for an OrganizationID < 7 (since in the same data, Organizations with an ID of 7 to 10 correspond to warehouses).
Input Property
Source Type
Source
Notes
Mode
Static Value
GEObject
GEObject
Context Object
GEObject
This option flows from the Process Flow Input Property you specified previously.
FieldName
Static Value
Organization
This step will check the value for the Organization virtual field.
Operator
Static Value
Does Not Contain
Select the operator from the available options in the drop-down list.
ValueToCompare
Static Value
Warehouse
NOTE: The Value Tester comparison is case sensitive.
- For this step, the process flow will check the value of the Employees.Organization virtual field rather than the value of Employees.OrganizationID. This provides additional flexibility to perform a string comparison on the Organization Name to determine if it contains the word Warehouse (note that this comparison will be case sensitive). Alternatively, you could create the check to look for an OrganizationID < 7 (since in the same data, Organizations with an ID of 7 to 10 correspond to warehouses).
- Save the process flow.
Step 2: Display the Validation Message
If an Employees record passes the validation from step 1 (in other words, the specified Organization's name does not contain the word, Warehouse), then the process flow will end and the validation is successful. However, if the validation fails (that is, the specified Employees record is linked to an Organization whose name contains the word, Warehouse), then the second step is to display the validation message to the end user. You define the validation message in a rule-based step.
- Select the Insert Rule Step button in the toolbar.
- Move the cursor to the design area so it is to the right of the first step. Click the mouse button to drop the rule step in the selected location.
- A new step appears in the Design area. The step's details load in the Properties area on the right-side of the Process Flows record.
- Enter XY Organization Validation Message in the Name field for the rule step (in the Properties area).
- Enter a description for the step on the Description tab.
- Click the Rule tab within the properties area.
- Because this is a rule-based step, either SQL or VBScript may be used to extract the correct information. The functionality of this step is to configure the text of the Validation Message property, so this step should use VBScript.
- This script sets the value for the ValidationMessage property and selects the VALIDATION_FAILED result code. In the event that there is an error encountered while processing the step, the rule also catches any exceptions to publish to the error log and sets the result code to PF_FAILED.
Select VBScript in the Rule Type list and enter the following into the text box:
Try oProperties.SetProperty(ValidationMessage, You cannot associate an employee with a warehouse.) oResultCode.Value=VALIDATION_FAILED Catch ex As System.Exception oResultcode.Value = PF_FAILED Aptify.Framework.ExceptionManagement.ExceptionManager.Publish(ex) End Try
- Save the record.
Linking the Process Flow Steps
Once the steps are created, they must be linked together to form the complete process flow.
Follow this procedure to link step 1 to step 2:
- Click the Insert Result Code Link icon in the toolbar.
- Place the cursor over one of the handles of step 1's box until it becomes a target symbol. Click the mouse button.
- Drag the cursor over a handle of step 2's box.
- Click the mouse button.
- The Create New Result Code dialog appears.
- The Create New Result Code dialog appears.
- Select False in the Result Code field.
- Click OK to close the dialog.
- A link labeled FALSE is added between steps 1 and 2 in the diagram.
- Select Step 1 in the diagram to load its properties.
- Click the Action Map tab.
- The FALSE action should already be linked to the Organization Validation Message step.
- The FALSE action should already be linked to the Organization Validation Message step.
- If not already selected, select the End Process Action for the TRUE and FAILED result codes.
- Enter SUCCESS as the Process Flow Result Code for the TRUE code.
- Enter PF_FAILED as the Process Flow Result Code for the FAILED code.
- Save the record.Link Step 2 to Step 3
Ending the Process Flow
For the last step in the process flow, you need to mark all of its actions as End Process. Follow this procedure:
- Select Step 2 in the diagram to load its properties.
- Click the Action Map tab, which should be blank. Since this is a rule-based step, you need to add new Action Maps manually for the two results defined in the rule (VALIDATION_FAILED and PF_FAILED).
- Click the New Map button.
- In the Create New Result Code dialog, enter VALIDATION_FAILED as the Result Code, clear the Is Success option, and enter a brief description.
- Click OK to load the action map.
- Select End Process as the Action and enter VALIDATION_FAILED in the Process Flow Result Code field.
- Click the New Map button again.
- In the Create New Result Code dialog, enter PF_FAILED as the Result Code, clear the Is Success option, and enter a brief description.
- Click OK to load the action map.
- Select End Process as the Action and enter PF_FAILED in the Process Flow Result Code field.
- Save the record.
Copyright © 2014-2019 Aptify - Confidential and Proprietary