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:
- Open a new record from the Process Flows service.
- In the Name field, enter XY Send Product Literature where XY are your initials. If desired, enter a description.
- 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.
- 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
- Step 2: Creating the Orders Record
- Step 3: Creating the Order Lines Record
- Step 4: Notifying the Sales Department
Step 1: Determining Whether to Send the Product Literature
Follow these steps to create the first step (which is rule-based):
- Click the Design tab.
- Select the Insert Rule Step button in the toolbar.
- 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.
- Within the step's Properties area, Enter XY Determine Company Link in the Name field. Enter a description if desired on the Description tab.
- 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.
- 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.
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%>
- 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.
- Select the Insert Component Step button in the toolbar.
- 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.
- In the step's Properties area, enter XY Create Literature Order in the Name field. Enter a description on the Description tab, if desired.
- Under the Properties tab, select the drown arrow to the right of the Component field to display the available component categories.
- Expand the (Entity Operations) > Orders category.
- Select the Create Orders Record 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.
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 column222
See Notes columnIf 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 column222
See Notes columnIf 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.
Â
- Save the record.
- Click the Output Map tab.
- 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
- 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.
- Select the Insert Component Step button in the toolbar.
- 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.
- 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.
- 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.
- Under the Properties tab, select the drown arrow to the right of the Component field to display the available component categories.
- Expand the (Entity Operations) > OrderLines category.
- Select the Create OrderLines Record 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.
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.
- 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.
- Select the Insert Sub-Process Step button in the toolbar.
- 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.
- 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.
- 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.
- 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.
- The process flow's input properties appear in the Properties area.
- Set the value of Source on each input map to Context Object.
- In the Source field, select from the list the corresponding input property you previously specified on the process flow's Input Properties tab.
- 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:
- 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.
- Enter Unlinked in the Result Code field. Leave Is Success selected.
- Click OK to close the dialog.
- A link labeled Unlinked is added between steps 1 and 2 in the diagram.
- A link labeled Unlinked 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 Unlinked action already appears on this tab.
- The Unlinked action already appears on this tab.
- Click the New Map button to open the Create New Result Code dialog.
- 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.
- A Linked action appears in the Action Map.
- For the Linked action, select End Process as the Action and enter AFFILIATED in the Process Flow Result Code field.
- Save the record.
Linking Step 2 to Step 3
Follow this procedure to link step 2 to step 3:
- Click the Insert Result Code Link icon in the toolbar.
- Place the cursor over one of the handles of step 2's box until it becomes a target symbol. Click the mouse button.
- Drag the cursor over a handle of step 3's box. Click the mouse button.
- The Create New Result Code dialog appears.
- The Create New Result Code dialog appears.
- Select Success as the result code and click OK.
- Select Step 2 in the diagram to load its properties.
- Click the Action Map tab.
- For the Failed action, select End Process as the Action and enter FAILED in the Process Flow Result Code field.
- Save the record.
Linking Step 3 to Step 4
Follow this procedure to link step 3 to step 4:
- Click the Insert Result Code Link icon in the toolbar.
- Place the cursor over one of the handles of step 3's box until it becomes a target symbol. Click the mouse button.
- Drag the cursor over a handle of step 4's box. Click the mouse button.
- The Create New Result Code dialog appears.
- The Create New Result Code dialog appears.
- Select Success as the result code and click OK.
- Select Step 3 in the diagram to load its properties.
- Click the Action Map tab.
- For the Failed action, select End Process as the Action and enter FAILED in the Process Flow Result Code field.
- 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:
- Select Step 4 in the diagram to load its properties.
- Click the Action Map tab.
- For both actions, select End Process as the Action.
- For the SUCCESS action, enter EMAIL_SENT in the Process Flow Result Code field.
- For the FAILED action, enter FAILED in the Process Flow Result Code field.
- Save the record.
The following figure illustrates the process flow when all steps are linked.
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