BEA Logo BEA WebLogic Process Integrator Release 1.1

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

 

   WebLogic Process Integrator Doc Home   |   Studio Guide   |   Previous Topic   |   Next Topic   |   Contents   |   Index

Working with Workflow Components

 

The following sections describe how to use workflow components:

 


Adding Workflow Components to a Workflow Diagram

After you first create a workflow template definition, the workflow toolbar and workflow drawing area are displayed on the right side of the WebLogic Process Integrator Studio main window.

By default, the drawing area already contains three shapes (components) that you must define: start, task, and done. If you will be adding a shape to an existing workflow diagram, right-click the workflow template definition in the folder tree and choose Open from the pop-up menu to open the workflow diagram.

Add new shapes to the diagram by clicking the shape in the toolbar, then clicking in the workflow diagram where you want to drop the shape. To identify icons to the toolbar, see Workflow Drawing Area in WebLogic Process Integrator Overview.

 


Deleting Components from a Workflow Diagram

Delete a component from a workflow diagram in one of two ways:

A confirmation dialog box is always presented.

 


Defining Variables

Not all workflow template definitions require variables. However, for those workflow template definitions containing processes that require variables, you should define these before you begin defining the workflow template definition. You can also add these variables as you create the workflow template definition.

Process variables have a workflow-global scope. That is, a single variable instance is shared by all objects within a workflow template definition instance. Process variables are therefore defined at the workflow template definition level in the folder tree and are referred to as workflow variables.

Each workflow template definition can have a set of variables associated with it. A variable is typically used to store application-specific information required by the workflow at run time. Variables are created and assigned values largely to "control" the logical path through a workflow instance; the same workflow template definition is instantiated multiple times and can be traversed in different ways if the flow contains decision nodes, which test workflow variable values to branch to either the next True or next False within the workflow.

Defining Variables

To define a variable:

  1. In the folder tree, right-click Variables under the appropriate workflow template definition, and choose New Variable to display the Variable Properties dialog box.

    Figure 4-1 Variable Properties Dialog Box

  2. Complete the following fields:

Updating Variables

To update an existing variable:

  1. Right-click an existing variable in the folder tree and choose Properties from the pop-up menu. The Variable Properties dialog box is displayed.

  2. Make changes to the variable as needed, and click OK.

Locating Variables in the Workflow

To see where a variable is used within the workflow, right-click the variable in the folder tree and choose Usage from the pop-up menu. This displays the Variable Usage dialog box.

Figure 4-2 Variable Usage Dialog Box

The Variable Usage dialog box lists the nodes within a workflow template definition in which the selected variable is used and the value assigned to that variable. Variables can be used in all workflow nodes except joins and dones.

In the preceding figure, the Confirm variable is used in the Confirm Order task and has a value of :Confirm="yes".

The dialog box contains the following buttons:

Variable Conversion Rules

The following table details the implicit conversions that are handled automatically by WebLogic Process Integrator between different variable types.

Table 4-1 Variable Conversions

Value Converted To

String

Integer

Double

Date

Boolean

XML

NodeList 1

String

X 2

X 3

X 4

X 5

X 6

X 7

X 8

Integer

X 9

X 10

X 11

NS

X 12

NS

X 13

Double

X 14

X 15

X 16

NS

X 17

NS

X 18

Date

NS

NS

NS

X 19

NS

NS

NS

Boolean

X 20

X 21

X 22

NS

X 23

NS

X 24

XML

X 25

NS

NS

NS

NS

X 26

X 27

Note: NS is Not Supported.

The following are notes relating to certain conversions in the preceding table:

  1. org.w3c.dom.NodeList, which is typically the output of Xpath() function. The Xpath() function also returns Double, Boolean, String, and Integer types.

  2. As it is

  3. Java Integer.toString() output

  4. Java Double.toString() output

  5. Java Date.toString() output

  6. Java Boolean.toString() output: "true" and "false"

  7. DOM serializing

  8. DOM serializing

  9. An ILLEGAL_CONVERSION warning WorkflowException is thrown if parsing cannot occur (NumberFormatException).

  10. As it is

  11. Double's Integer value

  12. 1 if true, 0 if false

  13. DOM serialized to string, then convert to Integer (See note 9.)

  14. An ILLEGAL_CONVERSION warning WorkflowException is thrown if parsing cannot occur (NumberFormatException).

  15. Integer's Double value

  16. As it is

  17. 1.0 if true, 0 if false

  18. DOM serialized to string, then convert to Double (See note 14.)

  19. As it is

  20. True if string value is "true", "t", "1"; false if string value is "false", "f", "0". Any other string value throws an ILLEGAL_CONVERSION warning WorkflowException.

  21. False if Integer value is 0, true if any other value

  22. False if Double value is 0, true if any other value

  23. As it is

  24. DOM serialized to string, then convert to Boolean (See note 20.)

  25. DOM parsing to a XML document element (not simply a node, which means when it is dumped back to a String, it will have XML header similar to the following: <?xml version="1.0" encoding="UTF-8"?>). An ILLEGAL_CONVERSION warning WorkflowException is thrown if DOM parsing cannot occur.

  26. As it is

  27. DOM serialized to string, then convert to XML node (See note 25.)

 


Defining Start

Every workflow has at least one start shape that indicates the beginning of the workflow. The first node after the start will be the first activated node of the workflow, which can be a task, decision, or event.

Specifying Multiple Starts

You can specify more than one start shape, if more than one simultaneous path through the workflow is to be started. For example, when you want two streams of work to start at the same time within a single workflow, you can define two starts within the workflow.

These two streams of work can be started at simultaneously, if they have the same triggering event and are both marked as manual starts or timed starts set to the same time. Otherwise, the two streams can be started separately with each start being an alternate way of starting the workflow.

The benefit to the ability to specify more than one start is visual access to both streams of work within the same workflow and these streams of work can share the same variables. You have the flexibility to take a portion of a workflow and starting it in a different manner or at a different time within the workflow.

Note: If no Start shape is specified, then no task activation can occur in the workflow.

You specify the triggering properties of a workflow in the start node. If a workflow contains multiple starts, each start can have its own triggering method and start independently.

Defining a Start Node

To define a Start shape:

  1. Display or add the Start shape as described in Adding Workflow Components to a Workflow Diagram.

  2. Double-click the Start shape to display the Start Properties dialog box.

    Figure 4-3 Start Properties Dialog Box

  3. The Description field by default contains the name Start. Modify this name as needed to create a unique, identifiable name.

  4. Select a workflow triggering method:

  5. Complete or view the fields on the tabs:

 


Defining Dones

A done shape represents the point within the workflow where the process completes. Once a done node is reached in the workflow, the running instance of the workflow is marked done, regardless of whether all the done nodes have been reached or not.

You can specify any number of done shapes in a workflow. If a workflow can exit from various points, you have the option of placing separate done nodes wherever needed.

To define a done:

  1. Add or view a done shape as described in Adding Workflow Components to a Workflow Diagram.

  2. Double-click the done shape or right-click it in the folder tree and choose Properties to display the Done Properties dialog box.

    Figure 4-7 Done Properties Dialog Box

  3. Complete or view the fields:

 


Defining Decisions

The workflow can use any number of decision shapes. Each decision shape contains a condition that is evaluated when a transition to that decision node occurs. The result is either true or false, with subsequent flow of control passed to the subsequent task, decision, event, and join or done node(s). Additionally, it is possible to specify actions to be executed on both a True and a False evaluation of the condition. (If the condition is verified, it is True. If it is not, it is False.)

To define a decision:

  1. Add or view a Decision shape as described in Adding Workflow Components to a Workflow Diagram.

  2. Double-click the Decision shape or right-click it in the folder tree and choose Properties to display the Decision Properties dialog box.

    Figure 4-8 Task Properties Dialog Box

  3. Complete the following fields:

  4. Provide or view information in the tabs of the Properties section of the dialog box.

 


Defining Tasks

A workflow contains a series of tasks, each of which represents a discrete activity to be performed automatically by the WebLogic Process Integrator server or by a workflow user. The task behavior is determined by various task properties and by the task actions that define the processing to be performed as certain task events occur.

To define a task:

  1. Display or add a task as described in Adding Workflow Components to a Workflow Diagram.

  2. Double-click the task shape or right-click the task in the folder tree and choose Properties to display the Task Properties dialog box.

    Figure 4-9 Task Properties Dialog Box

  3. Complete the following fields:

  4. View or provide information on the following tabs:

 


Defining Events

A workflow event shape represents a notification node. The workflow waits for an XML message to trigger the event. Upon that trigger, actions defined within the event can be executed and/or workflow variables can be set.

To define an event:

  1. Display or add a task as described in Adding Workflow Components to a Workflow Diagram.

  2. Double-click the event shape or right-click it in the folder tree and choose the Properties command to display the Event Properties dialog box.

    Figure 4-10 Event Properties

  3. To define the event, follow the procedure in Using the XML Notification: The WebLogic Process Integrator Event in Understanding WebLogic Process Integrator Events and XML Documents.

 


Using Joins (And/Or)

The possibility of multiple paths being active in the same workflow gives rise to the issue of path joining. There are two types of joining: AND joining and OR joining.

How Joins Work

AND joining melds multiple separate paths of control back into a single path, synchronizing them such that control does not continue until all paths converge. This type of join derives its name from the fact that control continues when the AND of all inputs is true. That is, when Path 1 and Path 2 and Path 3 ... etc. are all present, then control proceeds. An AND join will reset itself immediately after it is activated, in order to allow a looping process.

OR joining allows multiple path threads to enter and traverse down the same line of control within the workflow. In this case, the threads do not meld; the nodes along this part of the flow are executed multiple times, once for each thread control passing through it. This type of joining derives its name from the fact that control passes to the next node when the OR of its inputs is true. That is, if Path 1 or Path 2 or Path 3 ... etc. is present, then control proceeds.

An OR join can only be activated once. This avoids the multiple occurrence of actions and events succeeding the OR, which can happen by the completion of the various predecessors of the join. However, this single activation prevents a flow from looping when an OR join is defined, as the flow stops the second time at the OR join.

Use AND and OR joins to link task, decision, and event shapes and thus control the transition coming to the join and flowing from it.

Defining a Join

To define a join:

  1. Display or add a join as described in Adding Workflow Components to a Workflow Diagram.

  2. Double-click the join shape or right-click it in the folder tree and choose Properties to display the Join Properties dialog box.

    Figure 4-11 Join Properties Dialog Box

  3. Complete or view the fields as follows: