BEA Logo BEA WebLogic Process Integrator Release 2.0

  BEA Home  |  Events  |  Solutions  |  Partners  |  Products  |  Services  |  Download  |  Developer Center  |  WebSUPPORT

 

   WebLogic Process Integrator Documentation   |   Using Studio   |   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 and Toolbar.

 


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.

 


Understanding 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. Variables can hold values that are returned by business operations, that are extracted from XML documents, or that are set explicitly by workflow actions. Variables can also be used by the workflow for several other purposes, such as to evaluate a condition in a decision node, or to store the result of a response from the Worklist client application.

Defining Variables

To define a variable:

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

    Figure 6-1 Variable Properties Dialog Box


     

    Note: If a plug-in is defined for variables, this properties dialog box will contain the new variables in the Type field. For more information about plug-ins, see Working with Plug-Ins.

  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 6-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 when values of one type are assigned to variables of another type.

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

X

X 13

Double

X 14

X 15

X 16

NS

X 17

X

X 18

Date

X

NS

NS

X 19

NS

X

X

Boolean

X 20

X 21

X 22

NS

X 23

X

X 24

XML

X 25

NS

NS

NS

NS

X 26

X 27


 

Notes: NS means Not Supported. If one of the unsupported conversions are attempted, an error message is displayed indicating that the conversion is illegal.

Additionally, the conversion rules are not fully supported for calculations in expressions. For example, assume you have the following expression, and you want to assign the result to a string type variable:

XPath("your_expression") + 2 

If XPath("your_expression")evaluates to a text value of 5, the value is not automatically converted to a string, and an error message is displayed.

To convert the result to a string, you need to indicate explicitly that you want the result of the expression converted. The expression needs to be modified as follows:

tostring XPath("your_expression") + 2 

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 simultaneously, if they have the same triggering event and both are 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 of being able to specify more than one start is visual access to both streams of work within the same workflow, and sharing the same variables with both workflows. You also have the flexibility to take a portion of a workflow and start it in a different manner or at a different time within the workflow.

Note: If no Start node is specified, 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 6-3 Start Properties Dialog Box


     

    Note: If a plug-in is defined for the Start node, this properties dialog box contains a selection to access the functionality provided by the plug-in. For more information about plug-ins, see Working with Plug-Ins.

  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 a Start Node Using an Event Trigger

A workflow can be started by responding to an event. An event is an asynchronous notification from another workflow or from an external source, such as another application. An event notification takes the form of an XML message. For further information about events and how they are triggered, see Understanding Event-Driven Processing.

To define an event trigger to start a workflow:

  1. In the Start Properties dialog box, select the Event option.

    Figure 6-6 Start Properties Dialog Box


     

  2. In the Document Type/Root Element field, enter the DOCTYPE or root element in the XML message that triggers the start of the workflow.

    The DOCTYPE or root element you specify here must match the DOCTYPE or root element in the incoming XML message before BEA WebLogic Process Integrator starts the workflow.

  3. In the Key Value Expression field, optionally define a key value for the XML message. You can enter a string that is the key value, or an expression that is evaluated at run time to produce the key value.

    The key value you specify here must match an element in the incoming XML message before BEA WebLogic Process Integrator starts the workflow.

    You also need to define the expression that locates the key value in the incoming XML message, so BEA WebLogic Process Integrator can compare it against the key value you specify in this field. For details, see Defining an Event Key.

  4. In the Condition field, optionally define a condition that needs to be evaluated before the workflow can start. If the condition is true, BEA WebLogic Process Integrator starts the workflow.

  5. Select a Start Organization from the drop-down list of organizations already defined within WebLogic Process Integrator. When the Start node is the Event type, you must specify the organization for which the workflow instance is started because you can start the same workflow template definition for different organizations.

  6. If you want to define the Start Organization using an expression, select the Workflow Expression option. The Expression Builder is displayed. Use the Expression Builder to enter an expression that is evaluated at run time and becomes the name of an organization. The expression can be either a case- sensitive string that specifies the organization, or an expression using information passed in the XML message.

    Note: Expressions are built using WebLogic Process Integrator expression syntax and typically use the syntax of XPath function to extract values out of XML documents. If you know the syntax of the expression you want to use, you can type the expression directly in the field. Alternatively, click the A+B button to display the Expression Builder dialog box. The Expression Builder helps you construct an expression, which is made up of functions, operators, literals, and variables. For more information on constructing expressions, see Using Expressions and Conditions.

  7. The XML message that starts the workflow can be parsed to extract information to be used in the initialization of workflow variables. Select the Variables tab to specify the variables that should be initialized when the workflow starts.

    Click Add to display the Workflow Variable Assignment dialog box. The variables in the pull-down list are those defined in the Variables Properties dialog box. (See Understanding Variables.) The XML expression can be the name of an element in the XML message the value of which you want to assign to the selected variable, or it can be an XPath function that extracts a value from the XML message and assigns it to the selected variable.

  8. Select the Next tab to display a list of all task, decision, join, and done nodes in the current workflow. Select a node (or nodes) in the list to be activated next in the workflow when the Start node is instantiated.

  9. Select the Actions tab to display a list of all actions to be performed when the Start node is initiated. Click Add to display a the list of available actions. For details about defining an action, see Defining Actions.

  10. Click OK.

 


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 6-7 Done Properties Dialog Box


     

    Note: If a plug-in is defined for the Done node, this properties dialog box contains a selection to access the functionality provided by the plug-in. For more information about plug-ins, see Working with Plug-Ins.

  3. Complete the following:

 


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 6-8 Decision 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 task node represents a discrete business activity that is performed either automatically when a workflow runs, or manually by a user using the Worklist client application.

Each task node progresses through four different states: created, activated, executed, and marked done. Progress through these states is not automatic. Each state is activated by some event. For each state, you can specify a list of actions that are performed when the task reaches that state.

The following table shows each task state, and when the actions specified in each state are executed:

Table 6-2 Task States

Task states

Actions specified in this state are executed . . .

Created

When a new workflow instance is created

Activated

When the previous node has completed its processing

The task remains in Activated state until the task is marked done.

Executed

Marked Done


 

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 6-9 Task Properties Dialog Box


     

  3. Complete the following fields:

  4. View or provide information on the following tabs:

 


Defining Events

An event node represents a wait state that is activated by the receipt of an XML message. The XML message can come from another workflow or from an external source, such as another application. For further information about events and how they are triggered, see Understanding Event-Driven Processing.

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 6-10 Event Properties


     

    Note: If a plug-in is defined for the Event node, this properties dialog box contains a selection to access the functionality provided by the plug-in. For more information about plug-ins, see Working with Plug-Ins.

  3. In the Description field, enter the name of the event.

  4. From the Type drop-down list, select the type of event. For an XML message, select XML Event.

  5. In the Document Type/Root Element field, enter the DOCTYPE or root element in the XML message that will trigger the event.

    The DOCTYPE or root element you specify here must match the DOCTYPE or root element in the incoming XML message before BEA WebLogic Process Integrator will trigger the event.

  6. In the Key Value Expression field, optionally define a key value for the XML message. You can enter a string that is the key value, or an expression that will be evaluated at run time to produce the key value.

    The key value you specify here must match an element in the incoming XML message before BEA WebLogic Process Integrator will trigger the event.

    You also need to define the expression that locates the key value in the incoming XML message, so BEA WebLogic Process Integrator can compare it against the key value you specify in this field. For details, see Defining an Event Key.

  7. In the Condition field, optionally define a condition that needs to be evaluated before the workflow can start. If the condition is true, BEA WebLogic Process Integrator will trigger the event.

  8. The XML message that triggers the workflow can be parsed to extract information to be used in the initialization of workflow variables. Select the Variables tab to specify the variables that should be initialized when the event is triggered.

    Click Add to display the Workflow Variable Assignment dialog box. The variables in the pull-down list are those defined in the Variables Properties dialog box. (See Understanding Variables.) The XML expression can be the name of an element in the XML document the value of which you want to assign to the selected variable, or it can be an XPath function that extracts a value from the XML document and assigns it to the selected variable.

  9. Select the Actions tab to display a list of all actions to be performed when the Event node is initiated. Click Add to display the list of available actions. For details about defining an action, see Defining Actions.

  10. Select the Next tab to display a list of all task, decision, join, and done nodes in the current workflow. Select a node (or nodes) in the list to be activated next in the workflow when the Event node is instantiated.

  11. Click OK.

 


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.

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 6-11 Join Properties Dialog Box


     

  3. Complete or view the fields as follows:

 

back to top previous page next page