In this section: How to: Reference: |
When you connect one object to another, DataMigrator
draws an arrow between them. These arrows, or connector
objects, specify the logic that governs what is executed
next in a process flow. The connection logic may be unconditional
or conditional, represented graphically by colored arrows. Conditional
logic is set by default, however, you can edit the connection to
change the nature of the condition or to make it unconditional.
-
Black arrows
indicate unconditional connection logic. This means that the next
object will be processed immediately after its predecessor. For
some pairs of objects, unconditional logic is required. The connections
between the following types of objects and their successors are
unconditional by default, and cannot be changed:
-
Start > any
other object type
-
Parallel Group > Wait
-
E-mail > any
other object type
-
Green arrows
indicate that the next object will be processed if the previous
one runs successfully. This is the default when you draw an arrow
from one object to the next in a single path, as shown in the following
image.
-
Red arrows
indicate that the next object will be processed if the previous one
fails to run properly. This is the default for the second arrow
when you draw two arrows from the same object to other objects,
forming two branches in the flow. Since the first arrow (the green
one) means run when the flow is successful, it follows that the second
arrow (the red one) means run when the flow fails, as shown in the
following image.
-
Purple arrows
indicates that the next object will be run based on a custom condition
you define. You can use statistical or global variables (&&variables) in
custom conditions to test specific conditions, return codes, or
values based upon which branching will occur. For example, you might
want the flow to branch differently based a particular error message
number. For related information, see Branching in a Process Flow.
The connections between the following objects are conditional
by default. You can change the conditions or make them unconditional:
-
Flow > Flow,
Parallel Group, Stored Procedure, E-mail. (The conditions you can
apply are OK, FAILURE, and a Custom condition.)
-
Stored Procedure > Flow,
Parallel Group, Stored Procedure, E-mail. (The conditions you can
apply are OK, FAILURE, and a Custom condition.)
-
Wait > Flow,
Parallel Group, Stored Procedure, E-mail. (The conditions you can
apply are Wait satisfied and Timeout.)
x
Procedure: How to Edit a Connection Condition
Follow
these steps to edit a connection condition between a flow or a stored
procedure and one of the following object types: a flow, a Parallel
Group, a Stored Procedure, or an E-mail.
-
Drag
the required objects into the process flow workspace.
-
Connect
the objects.
-
To view
or edit the connection condition, double-click the arrow connecting
the two objects. The Condition window opens, as shown in the following image.
For
a single connection, OK is the default. For a second connection,
FAILED is the default.
-
Click
an option button to change the condition.
-
If you
wish to specify a Custom condition, click Custom.
The Edit Custom Focus Condition box becomes active.
Type the code for the condition you want to apply. Typically,
you use a global (&&) variable, DataMigrator variable, or
statistical variable in your custom conditions to test specific
conditions, return codes, or values based upon which branching will
occur.
-
Click OK to
close the condition box.
-
Click
the Save button to update the process flow.
Example: Creating a Custom Connection Condition
You
can set a custom condition for a connection between objects in a
process flow. In this case, a connection will become active if duplicate
rows are rejected while a data flow is run. The number of duplicates
will be included in an e-mail that is sent if the condition is met.
Note: Your
DataMigrator Server must be configured for e-mail notification to complete
this example. For details, see Configuring DataMigrator Server Operations.
- In the DMC,
right-click an application directory in the navigation pane and choose New,
then Flow.
- Select the Process
Flow tab.
- Drag the DMDUPLG data
flow object from the ibisamp application directory in the navigation
pane into the workspace, to the right of the Start object.
- Create a connection
by right-clicking the Start object and dragging
to the DMDUPLG data flow object.
- Drag an e-mail
object from the Process Flow toolbar into the workspace, to the
right of the DMDUPLG data flow object.
- Create a connection
by right-clicking the DMDUPLG data flow object
and dragging to the e-mail object.
The workspace should appear
as shown in the following image:
- Double-click
the arrow between the DMDUPLG data flow object
and the e-mail object.
or
Right-click the connection arrow
and select Edit Condition.
The Condition
window opens.
- Click the Custom radio
button.
The Edit Custom Focus Condition field becomes active.
- Type
(&DUPLS GT 0)
in
the Edit Custom Focus Condition field and click OK,
as shown in the following image.
- Right-click
the e-mail object and select Properties.
The
E-Mail attribute pane opens.
- Type an e-mail
address in the Address To field and type Duplicate
Rows Rejected in the Subject field.
- Type
&DUPLS rows rejected
in
the Message Text field as shown in the following
image and click OK.
This
connection will become active if duplicate rows are rejected while
a data flow is run, and an e-mail notification will be sent with
the number of duplicate rows.
x
Reference: Condition Dialog Box
The Condition dialog
box shown in the following image is available from the process flow
workspace by double-clicking a connection arrow between objects,
or by right-clicking a connection arrow and selecting Edit
Condition.
The
Condition dialog box has the following fields/options:
-
Choose Condition Type
-
Provides access to the following condition options:
-
OK Default Condition (Return Code is 0)
-
Executes the connection if the prior object executed successfully.
-
FAILED Default (Return Code is 0)
-
Executes the connection if the prior object failed to execute.
-
Unconditional (GOTO)
-
Executes the connection regardless of the success or failure
of the prior object.
-
Custom
-
Allows you to set a custom condition for the connector.
-
Edit Custom FOCUS Condition
-
The code for a custom condition.
xBranching in a Process Flow
The ability to set connection logic enables you to create
branches within a process flow. You simply connect multiple objects
to the object from which you want the branching to begin.
The branching process flow shown in the following image is built
in Exercise 2: Creating the Process Flow. It is strongly suggested that you to complete
these exercises in order to create the branches shown here. As you
do so, you will become familiar with many aspects of data and process
flow design in the DMC.
x
Procedure: How to Create Branches in a Process Flow
-
Drag
an object into the workspace following the object from which you
want the branching to begin.
-
To build
the first branch, connect the object at the starting point for the branches
to the object you just dragged in. A green arrow is created by default.
-
To build
the second branch, drag another object into the workspace and connect
it to the object at the start of the branch. A red arrow is created
by default.
-
If you
wish to change the connection conditions for any branch, double-click
the arrow and edit the condition in the Conditions window, then
click OK.
-
Click
the Save button to update the process flow.
Note: You
can also create branches using custom conditions. Note, however,
that while you can use multiple custom conditions to specify different
branches, you should not use custom conditions with OK and FAILED
conditions.