If you have a comment on this topic, contact Aptify Documentation. If you want to return to the Aptify Community Site, please click here.

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:

  1. Open a new record from the Process Flows service.
  2. In the Name field, enter XY Validate Organization where XY are your initials. If desired, enter a description.
  3. Enter Example Business Logic in the Category field. This links the a Process Flow Categories record included with Aptify.
  4. 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):

  1. Click the Design tab.
  2. Select the Insert Component Step button in the toolbar.

  3. 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.

  4. Under the Properties tab, select the drown arrow to the right of the Component field to display the available component categories.
  5. Expand the General category.

    Select Component
  6. Select the Value Tester component from the list.
    • The component's input properties automatically flow down to the step's Properties tab.

  7. 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.

  8. 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.


      Check Organization Inputs

  9. 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.

  1. Select the Insert Rule Step button in the toolbar.

  2. 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.

    Add Rule Step

  3. Enter XY Organization Validation Message in the Name field for the rule step (in the Properties area).

  4. Enter a description for the step on the Description tab.

  5. 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.

  6. 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 

     

    VBScript Rule Step

  7. 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:

  1. Click the Insert Result Code Link icon in the toolbar.
  2. Place the cursor over one of the handles of step 1's box until it becomes a target symbol. Click the mouse button.
  3. Drag the cursor over a handle of step 2's box.

    Adding a Link Between Steps
  4. Click the mouse button.
    • The Create New Result Code dialog appears.

  5. Select False in the Result Code field.

    Specify Result Code
  6. Click OK to close the dialog.
    • A link labeled FALSE is added between steps 1 and 2 in the diagram.

  7. Select Step 1 in the diagram to load its properties.

  8. Click the Action Map tab.
    • The FALSE action should already be linked to the Organization Validation Message step.

  9. If not already selected, select the End Process Action for the TRUE and FAILED result codes.
  10. Enter SUCCESS as the Process Flow Result Code for the TRUE code.
  11. Enter PF_FAILED as the Process Flow Result Code for the FAILED code.

    Specify Action Map Properties
  12. 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:

  1. Select Step 2 in the diagram to load its properties.
  2. 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).
  3. Click the New Map button.
  4. In the Create New Result Code dialog, enter VALIDATION_FAILED as the Result Code, clear the Is Success option, and enter a brief description.

    Add Result Codes

  5. Click OK to load the action map.
  6. Select End Process as the Action and enter VALIDATION_FAILED in the Process Flow Result Code field.
  7. Click the New Map button again.
  8. In the Create New Result Code dialog, enter PF_FAILED as the Result Code, clear the Is Success option, and enter a brief description.
  9. Click OK to load the action map.
  10. Select End Process as the Action and enter PF_FAILED in the Process Flow Result Code field.

    Validation Message Step Action Map
  11. Save the record.

Copyright © 2014-2019 Aptify - Confidential and Proprietary