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 Complex Process Flow

In this step of the Complex Process Flow tutorial, you perform the procedures necessary to create a complex process flow, as described in the sections below:

Creating the Process Flows Record

follow these steps to create the Process Flows record:

  1. Open a new record from the Process Flows service.
  2. In the Name field, enter XY Send Product Literature where XY are your initials. If desired, enter a description.
  3. Enter email Notifications in the Category field. This links the record to the Process Flow Categories record created in the first example of this tutorial.
  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. This list is a combination of all data required by all steps within the process flow.

A few additional Input Properties have been added to this list, beyond what was deemed necessary during the Outlining process. These were determined by reviewing the Input Properties tab of the Create Order process components and the Input Properties tab of the XY Send email process flow. This underscores the importance of understanding how the components are configured within the application. 

 

Enter the following rows into the Input Properties tab. When all rows are entered, save the Process Flows record.

Name

Type

Default Value

Required

Value List Type

To

String

 

Yes

None

Subject

String

 

Yes

None

TextBody

String

 

Yes

None

PersonID

Integer

 

Yes

None

EmployeeID

Integer

 

Yes

None

ProductID

Integer

 

Yes

None

Defining the Result Codes

Create the following result codes for the Process Flows record on the Result Codes tab and save the record:

Code

Description

Success

EMAIL_SENT

Order created and email sent.

Yes

AFFILIATED

Person affiliated with company.

Yes

FAILED

Failure encountered.

No

Defining the Process Flow Steps

This section describes how to create the four steps in this process flow:

Step 1: Determining Whether to Send the Product Literature

Follow these steps to create the first step (which is rule-based):

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

  3. Move the cursor to the design area and 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.
    • Resize the form as necessary so you can read all of the fields in the Properties area.

  4. Within the step's Properties area, Enter XY Determine Company Link in the Name field. Enter a description if desired on the Description tab.

  5. Click the Rule tab.
    • 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 determine whether to send the product literature by finding out whether or not the person is associated with a company. SQL provides the best method of determining this information.

  6. Select SQL in the Rule Type list and enter the following into the text box:

    Select ID = 
    CASE
    WHEN CompanyID IS NULL 
    THEN 'Unlinked'
    ELSE 'Linked'
    END
    FROM APTIFY.dbo.vwPersons WHERE ID=<%PersonID%>


    SQL Rule Step

  7. Save the process flow.

Step 2: Creating the Orders Record

Once the rule step determines that the product literature should be sent, the next step is to create an order for that literature. This step makes use of the existing Create Orders Record process component.

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

  2. Move the cursor to the design area so it is to the right of the rule-based step. 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.

    Add Component Step

  3. In the step's Properties area, enter XY Create Literature Order in the Name field. Enter a description on the Description tab, if desired.
  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 (Entity Operations) > Orders category.

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

  7. 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. The figure provides an illustration of how some of the inputs from the table below should appear in the Process Flows record.

    Input Property

    Source Type

    Source

    Notes

    SaveRecord

    Static Value

    No

    For this process flow, you do not want to save the Orders record until after you have added the Order Line in Step 3, so set this to No.

    ID

    Static Value

    -1

    The ID will be assigned automatically when the Order is saved. Set this to -1 as a placeholder since this is a required field.

    OrderDate

    Formula

    GetDate()

    Change the Source Type from Static Value to Formula since GetDate() is a SQL Expression. The order will use the current date and time as the Order Date.

    ShipToID

    Context Object

    PersonID

     

    ShipToCountryCodeID

    Static Value
    See Notes column

    222
    See Notes column

    If the Person does not have an address, then you need to specify the Country Code ID to save the record. This tutorial sets this property to minimize user error. You can use a different Source Type as needed.

    BillToID

    Context Object

    PersonID

     

    BillToCountryCodeID

    Static Value
    See Notes column

    222
    See Notes column

    If the Person does not have an address, then you need to specify the Country Code ID to save the record. This tutorial sets this property to minimize user error. You can use a different Source Type as needed.

    EmployeeID

    Context Object

    EmployeeID

     

    OrganizationID

    Static Value

    1

    Enter the ID of an Organization's record. For the sake of simplicity, this tutorial sets it to 1 but you could use another source type as necessary.

    PayTypeID

    Static Value

    1

    Set the pay type to Purchase Order since there will be no charge for this literature order.

    PONumber

    Static Value

    N/A

     

    OrderLevelID

    Static Value

    1

    Enter the ID of the application OrderLevel record. For the sake of simplicity, this tutorial sets it to 1 but you could use another source type as necessary.

     

    Create Order Record Inputs

  8. Save the record.
  9. Click the Output Map tab.
  10. Configure the following settings for the GEObject output property so the Orders GE object can be passed to the Create OrderLines Record component in the next step of the Process Flow:
    • Destination Type: Context Object
    • Destination: GEObject

      Step's Output Map
  11. Save the record.

Step 3: Creating the Order Lines Record

After adding the Create Orders Record component, you need to add the Create Order Lines component that adds the order line for the literature to the order.

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

  2. Move the cursor to the design area so it is below the Create Orders Record step. 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.

  3. In the step's Properties area, enter XY Create Literature Order Line in the Name field. Enter a description on the Description tab, if desired.
  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 (Entity Operations) > OrderLines category.

  6. Select the Create OrderLines Record component from the list.
    • The component's input properties automatically flow down to the step's Properties tab.

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

    Input Property

    Source Type

    Source

    Notes

    SaveRecord

    Static Value

    Yes

    After adding the Order Line, this will save the OrderLines sub-type record and the Orders record.

    ParentGEObject

    Context Object

    GEObject

    The GEObject option will not appear in the Source drop-down list since it is not specified as an Input Property on the Process Flow. However, you can manually enter this value in the Source field.

    ProductID

    Context Object

    ProductID

     

    Quantity

    Static Value

    1

    Send 1 unit of the product.

    Price

    Static Value

    0

    The product literature is sent free of charge in this example.

  8. Save the record.

Step 4: Notifying the Sales department

The final step in the process sends an email notification to the Sales department. This step may make use of an existing process flow.

  1. Select the Insert Sub-Process Step button in the toolbar.

  2. Move the cursor to the design area so it is to right of the Create OrderLines Record step. Click the mouse button to drop the 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.

  3. In the step's Properties area, enter XY Send Email SubProcess Step in the Name field. Enter a description on the Description tab, if desired.

  4. Select the XY Send email process flow from the Sub-Process drop-down list.
    • The process flow's input properties appear in the Properties area.

  5. Set the value of Source on each input map to Context Object.
  6. In the Source field, select from the list the corresponding input property you previously specified on the process flow's Input Properties tab.
  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. Perform the steps in the following sections:

Linking Step 1 to Step 2

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.

    Adding a Link Between Steps
  3. Drag the cursor over a handle of step 2's box. Click the mouse button.
    • The Create New Result Code dialog appears.

  4. Enter Unlinked in the Result Code field. Leave Is Success selected.

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

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

  7. Click the Action Map tab.
    • The Unlinked action already appears on this tab.

  8. Click the New Map button to open the Create New Result Code dialog.

  9. Enter Linked in the Result Code field and leave Is Success selected. Click OK to save and close the dialog.
    • A Linked action appears in the Action Map.

  10. For the Linked action, select End Process as the Action and enter AFFILIATED in the Process Flow Result Code field.

    Specify Action Map Properties
  11. Save the record.

Linking Step 2 to Step 3

Follow this procedure to link step 2 to step 3:

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

  3. Drag the cursor over a handle of step 3's box. Click the mouse button.
    • The Create New Result Code dialog appears.

  4. Select Success as the result code and click OK.
  5. Select Step 2 in the diagram to load its properties.
  6. Click the Action Map tab.
  7. For the Failed action, select End Process as the Action and enter FAILED in the Process Flow Result Code field.
  8. Save the record.

Linking Step 3 to Step 4

Follow this procedure to link step 3 to step 4:

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

  3. Drag the cursor over a handle of step 4's box. Click the mouse button.
    • The Create New Result Code dialog appears.

  4. Select Success as the result code and click OK.
  5. Select Step 3 in the diagram to load its properties.
  6. Click the Action Map tab.
  7. For the Failed action, select End Process as the Action and enter FAILED in the Process Flow Result Code field.
  8. Save the record.

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 4 in the diagram to load its properties.
  2. Click the Action Map tab.
  3. For both actions, select End Process as the Action.
  4. For the SUCCESS action, enter EMAIL_SENT in the Process Flow Result Code field.
  5. For the FAILED action, enter FAILED in the Process Flow Result Code field.
  6. Save the record.

The following figure illustrates the process flow when all steps are linked.

Linked -Process Flow Steps

At this point, you can use the Process Flow Debugger tool to test your process flow. See Using the Process Flow Debugger for details.

Copyright © 2014-2019 Aptify - Confidential and Proprietary