The topics listed here provide links to task, conceptual and reference information for designing a Java CAPS Business Process (BP). If you have any questions or problems, see the Java CAPS web site at http://goldstar.stc.com/support.
Sun Business Process Manager (BPM) provides graphical editors to help you design and configure the models that depict your BPs using simple drag and drop procedures. The topics listed here provide the background information and instructions you need to understand and create BP models..
A Business Process (BP) is a collection of actions that take place in your company, revolving around a specific business practice. These processes can involve a variety of participants and might include internal and external computer systems or personnel. In Sun Business Process Manager (BPM), you create a graphical representation of the BP called a BP model. The model defines each component in the process and the flow of data through those components.
The BP model indicates the flow of data from start to end, and can include activities performed by the software, decision points, and any business logic used to transform and transfer the data. A BP can also contain activities that must be performed by a user, meaning that the flow of data is paused until the specified user performs the required activity.
BP components, or modeling elements, include activities, branching activities (decision points), intermediate activities, and links, as well as the business rules that define the logic of how data is transformed and moved. You can create sub-processes that can then be incorporated into a main BP.
The modeling elements you add from the Business Process Designer are standard BPEL elements, and are described in detail in Business Process Activities.
By default, the Start and End activities appear on the blank Business Process Designer as soon as you create a BP. There is only one starting point for any BP model. There can be multiple end points.
In addition to the standard BP components, you can also drag and drop other Java CAPS component activities from the Project Explorer directly into the Business Process Designer. Java CAPS component activities include the following:
Object Type Definition (OTD) activities, such as marshal and unmarshal
Business Activity Monitor activities
When you define certain Java CAPS components, one or more activity is added to that component in the Project Explorer. You cannot drag and drop a Java CAPS component, such as a Collaboration or OTD, directly into a BP. Instead, you drag and drop an activity defined by the component into the BP. For example, when you create a Java Collaboration Definition or OTD, activities are added to the Collaboration node in Project Explorer. Activities appear as yellow rectangles, similar to the Business Process Designer activity icons.
When you publish messages from a BP using a JMS send operation, the default message type specified in the JMSMessageType field is a text message. To publish bytes, stream, or map messages, you need to explicitly define the type in the message type field by defining a Business Rule for the send operation link (see Incorporating Business Rules for more information about using business rules).
Sun Business Process Manager (BPM) provides several editors that you can use to design and configure your BP. The main editor, the Business Process Designer, is where most of the process is defined. Additional editors allow you to configure and fine-tune the BP.
The Business Process Designer is the area in Enterprise Designer where you view, create, and edit BP models. The Business Process Designer provides the necessary tools for developing BP models such as graphic editing tools for adjusting, sizing, and aligning model components as well as a palette of modeling elements for developing the logical flow of information and tasks of the BP.
The Business Process Designer is very similar to any of the other Java CAPS interfaces. When you create a new BP, the Business Process Designer appears. The toolbar contains additional activity icons, which are described in Business Process Activities.
You might need to expand the Business Process Designer window to view all toolbar options.
Name |
Description |
---|---|
Reveals the Business Rule Designer in the lower portion of the Business Process Designer. |
|
Toggles between showing and hiding the corresponding Business Process Execution Language (BPEL) code, allowing you to view and edit the code. |
|
Updates the BP code on demand. The BP code is also synchronized when the model is saved. |
|
Checks for any errors in the BP model. |
|
Shows or hides the Property Sheet for the selected modeling element. |
|
Prints the BP model. This option also allows you to control the scale of the printed model. |
|
Automatically lays out the BP model. The Auto Layout feature provides several options for customizing the model layout. |
|
Displays several options for aligning and distributing your BP model elements. |
|
Controls the view size of the BP model. |
Activities are elements in a BP model that specify the logical flow of information. There are several different types of activities you can use in a BP, and each activity performs a different function within the process. Activities are categorized by the following types:
Activity elements include those activities that are common to most BPs, such as Start, End, Receive, Reply, and so on. Table 2 lists and describes the activity elements. These activities are all available from the Business Process Designer toolbar except the start and end nodes, which appear automatically on the Business Process Designer canvas when a BP is created.
Table 2 Activity Elements
Name |
Description |
---|---|
Indicates the start of the process. This element appears in the Business Process Designer by default when you create a new BP model; it does not have a corresponding icon on the Business Process Designer toolbar. A start node can only link to a receive activity, and cannot be deleted. |
|
Indicates the completed state of a BP. This element appears in the Business Process Designer by default when you create a new BP model; it does not have a corresponding icon on the Business Process Designer toolbar. An end node cannot be deleted. |
|
Indicates the invocation of a BP, or indicates to wait for the arrival of an inbound message. The receive activity represents the actual method by which a BP is initiated. |
|
Invokes a web service or a Java CAPS component. Depending upon the configuration of the component, a response might be required. |
|
Allows a BP to respond to the external system or user that originally invoked the BP. The receive activity at the beginning of the BP is paired with the reply activity at the end of the process. In cases where a message must be sent back to the caller of the BP, the reply activity uses information that correlates the message in the calling system. A reply activity is the last step in a BP in which the BP acts as a web service or sub-process. It correlates the outbound message back to the calling process; for example, it can reply to an external system as a web service. |
|
Maps and manipulates data using the Business Rule Designer (see The Business Rule Editor). You can also add a Business Rule to some links for the same purpose. |
|
Invokes compensation on an inner scope that has already completed normally. This construct can be invoked only from within a fault handler or another compensation handler. |
|
Allows data to pass through without any changes. |
|
Delays processing for a set period of time. |
|
Represents a step in a BP that requires human intervention. This activity must be configured by adding task assignments to the Worklist Manager. When a BP instance comes to a user activity, it creates a task and polls a table for the status of the task. In order for the user activity to complete, the user or the external application must update the status of the task. |
|
Represents and configures a step in a BP that requires human intervention from an external application. This activity must also be configured by adding task assignments to the Worklist Manager. |
Branching activities are elements in a BP model that specify the logical flow of information when there are two or more possible paths. BPM provides three different kinds of branching activities—decisions, event-based decisions, and flows.
Table 3 Branching Activities
Name |
Description |
---|---|
Exposes the commands described below. These commands allow you to define several possible paths to execute based on expression logic. |
|
Allows you to define complex expressions that are evaluated to determine the proper BP flow. This element also contains the expression and connection names. Expressions are built using the Business Rule Designer and BP attributes. |
|
Allows multiple inbound messages to be juxtaposed against one or more message or timeout conditions, so the type of message received determines the appropriate BP path. |
|
Allows you to specify one or more BP paths to be performed concurrently. |
Intermediate events are those activities that can receive a BP. Some intermediate events handle exceptions or compensate for exceptions. The intermediate events are available from the Intermediate Events menu on the Business Process Designer toolbar except Throw and Terminate Process, which are both available directly from the toolbar.
Table 4 Intermediate Events
A Scope element defines the behavior for one or more activities. A scope can provide exception handlers, event handlers, and a compensation handler. The exception handlers for the scope can be used to catch the faults caused by the possible exception responses.
Table 5 Scope Element
Name |
Function |
---|---|
Scope |
Allows you to apply exception handling to a set of sequential or simultaneous steps in a BP. |
A While element makes it possible to have repeating or looping logic inside a BP.
Table 6 While Element
Command |
Function |
---|---|
While |
Allows you to create a looping process within a BP (for instance, a negotiation process might take several weeks, but the manager wants to review the daily status). The loop continues until the process is complete, and then the BP continues. |
The Business Rule Designer allows you to configure relationships between input and output attributes using direct links between the input or using methods from the Method Palette. The area where you map attributes in the Business Rule Designer is called the Mapper.
Some attributes are automatically created for each activity when you drag and drop a component on the Business Process Designer. You can also manually create attributes in the Business Process Properties.
The Business Rule Designer has a Method Palette from which you can select methods to manipulate data. Use these methods to configure data passed between input and output nodes.
The Business Rule Designer toolbar is shown in Figure 1; the icons are described in Table 7.
Name |
Description |
---|---|
Automatically arranges the visible method boxes for clarity. |
|
Expands all method boxes so parameters and return values are all visible. |
|
Collapses all method boxes so parameters and return values are not visible. |
|
Deletes the selected method boxes. |
The Business Rule Editor is linked to the Business Rule Designer, and provides an advanced view of the business rules where you can further edit defined rules. You can delete a rule or set of rules, reset the destination for a rule, and change the order of rules. In the Business Rule Editor, you see the business rules in a tree-view in the order in which they are carried out, allowing you to see how data will be processed by the displayed rule set from start to finish, as shown in Figure 2.
The Reset Destination feature can be applied to business rules, and resets a BP attribute to an empty state before performing a mapping. The purpose of the Reset Destination option is to create an output container. Since this can create performance overhead, the default setting is off.
The Reset Destination option is useful when creating a BP that includes a user activity inside a while loop. When a BP attribute with repeating nodes is continually reused, such as in a loop activity, it might be necessary to reset the attribute value to an empty state. When BPM populates these nodes during the looping process, it overwrites the data in the BP attribute. If the attribute contains more information than will be overwritten, there is leftover data in the node. In this case, extraneous information appears that does not reflect the current intended value of the attribute. The Reset Destination feature prevents this.
It is important to activate the Reset Destination option on the first rule to ensure that the first action in the mapping process resets the attribute to an empty state. The Reset Destination feature is set in the Business Rules Editor (for more information, see Editing Business Rules).
When developing a Business Process (BP), you first create and name a new BP in a Java CAPS Project, and then add modeling elements and other Java CAPS component operations to the BP canvas to develop a logical process flow. Like other objects, BPs appear in the Project Explorer. Perform the following steps to create a BP model.
Once you create the BP, you need to might configure the properties. Once you have finalized the BP, you need to create a Connectivity Map, Environment, and Deployment Profile. You can then deploy the Project to the server.
The first step in creating a BP is to add a new BP to a Java CAPS Project.
From the Project Explorer panel, right-click a Project.
Point to New, and then select Business Process from the context menu.
Enter a new name for the BP.
Click Save.
See Sun Enterprise Service Bus topics for more information about creating a new Project.
You create BP components by dragging, dropping, and linking the available modeling elements in the Business Process Designer.
Perform the following steps to create the components of a BP.
There are several different kinds of activities you can include in a BP model. For more information about each of the different kinds of activities you can use and an illustration of their toolbar icons, see Business Process Activities.
Do one of the following:
On the Business Process Designer toolbar, click the activity icon and drag it to the canvas.
For intermediate or branching activities, click Intermediate Events or Branching Activities on the Business Process Designer toolbar, click the activity you want to use, and then drag it to the canvas.
Click the activity name and type a new name for the activity. This is optional. You can accept the default name.
The activity name must contain at least one character (A-Z, a-z, or 0-9), it must start with a letter or an underscore (_), and it can contain spaces.
Add Java CAPS components from the Project Explorer as described in Adding Components from the Project Explorer (optional).
Link the activities as described in Linking Modeling Elements.
Elements from the Project Explorer can either be dropped directly onto the canvas or onto an activity. Many elements provide custom settings so you can model every detail of your process.
In the Project Explorer, expand the tree until the element you want to add is visible.
Elements that can be added to a BP appear in the Project Explorer with a yellow rectangular icon, like the FileClient receive and write activities or Visual Page Designer show operations.
Click the element and drag it to the Business Process Designer canvas.
Link the modeling elements as described in Linking Modeling Elements.
Links indicate the flow of the BP by connecting activities together. BPM does not allow invalid links, ensuring the model is properly linked. Links can also accept business rules. A link with a business rule is marked with a blue icon.
Move your cursor over the connector portion of a modeling element.
Hold the cursor over the outside edge of the modeling element until it changes from the arrow pointer to a hand.
Drag a line from the first activity to the connector of the second activity, and then release the mouse.
To change the link style, right-click the BP in the Project Explorer, and then click Toggle Link Style.
Click Save.
Add business rules to the links, as described in Incorporating Business Rules below (optional).
You can configure logic in a business rule activity or add a business rule to a link. Business rules are defined using the Business Rule Designer, which appears when you click the Display Business Rule Designer icon or double-click a business rule activity or a business rule icon on a link. It is active when you add or select a link with a business rule and when you add or select a business rule activity. The Business Rules Editor, available from the Business Rule Designer, allows you to further modify business rules.
A business rule activity allows you to map and manipulate data in an activity in the Business Rule Designer.
From the Business Process Designer toolbar, click Business Rule Activity and drag it to the Business Process Designer canvas.
On the Business Process Designer toolbar, click Display Business Rule Designer.
The Business Rule Designer appears in the lower part of the Business Process Designer.
Define the business rules for the activity as described in Defining Business Rules.
You can add a business rule to a link in order to map and manipulate data between activities using the Business Rule Designer.
Right-click a link in the BP, and then click Add Business Rule.
On the toolbar, click Display Business Rule Designer.
The Business Rule Designer appears in the lower part of the Business Process Designer.
Define the business rules for the activity as described in Defining Business Rules.
A business rule can be a direct mapping of data, or can include multiple methods to manipulate data during the mapping.
In the Business Process Designer, double-click the business rule activity or link you want to edit.
Expand the trees in the right and left panels until the nodes you want to map are visible.
Do any of the following:
Drag a direct link between nodes in the right and left panels.
Select a method from the Method Palette. You can populate the method parameters and return values by linking them to nodes in the left and right panels, by linking them with additional methods, or by creating literal values.
See Using the Method Palette for more information about each method available in the Method Palette.
When you are done creating business rules, click Save in the Enterprise Designer toolbar.
Once you create business rules, you can modify them in the Business Rule Designer. You can also use the Business Rules Editor, provided with the Business Rule Designer, The editor provides an advanced view of the business rules for your BP
In the BP, double-click the business rule activity or business rule you want to modify.
Do any of the following:
To modify rules in the Business Rules Editor, click the bottom gray triangle to the left of the Business Rule Designer title bar.
The Business Rules Editor appears.
By default, the rules are in read-only mode. Click Show Single Mapping to place the editor in edit mode.
Do any of the following in the Business Rules Editor.
To delete a rule or set of rules, right-click the node and then click Delete. Use caution when deleting rules. This can result in modeling elements being removed from the BP and cannot be undone.
To activate the reset destination feature for a rule, right-click the rule, and then click Reset Destination (for more information about this feature, see Reset Destination).
When you right-click the node again, Reset Destination appears with a check mark.
To deactivate the reset destination feature for a rule, right-click the rule, and then click Reset Destination.
When you right-click the node again, Reset Destination no longer appears with the check mark.
To expand the tree nodes, right-click a node, and then click Expand, or click Expand All to expand all nodes.
To collapse a tree node, right-click the node, and then click Collapse.
To change the order of the rules, select the rule you want to move and then click either the down or up arrows in the toolbar until the rule is where you want it. You can only move a node if there a multiple nodes at the same level.
To close the Business Rules Editor, click the top gray triangle to the left of the Business Rule Designer title bar.
When you are done making changes, click Save in the Enterprise Designer toolbar.
After creating a BP model, you can check to see if there are any errors or warnings in the processing code. Errors are critical issues and will stop the BP. For example, activities that are not connected or an incorrect number of output links from an activity will cause an error. Warnings appear when there is a problem, but it is not critical enough to stop the BP. For example, unused containers in a BP cause warnings, you can still build, deploy, and run the process.
On the Business Process Designer toolbar, click Validate Business Process Model.
The Business Process Validation dialog box appears.
If an error or warning is encountered, the dialog box displays information about the error or warning.
If there are multiple errors or warnings, the Next button is enabled, allowing you to view information for each additional error or warning.
If there are no errors or warnings, a message appears stating so.
After you have reviewed any error messages, click Close.
Even if a BP model is not complete or contains errors, you can save it as a “work in progress” and return to it later.
Sub-processes are Business Processes (BPs) called within the main BP of a Project, and are invoked within the same Integration Server. Use the Business Rule Designer to configure the input and output attributes for the sub-process.
Sub-processes are required when a BP contains a user activity; the sub-process defines the flow of data through the user activity. A sub-process exists within a main process, so incorporating a sub-process into a BP involves two steps:
In the following procedure, you create a WSD object to use in the sub-process. The WSD object functions as the interface to the sub-process or, in the case of a user activity, to the Visual Page Designer pageflow. For detailed information about using the Web Service Designer, see Sun Enterprise Service Bus topics.
Right-click the Repository and click New Project.
Name the Project.
Right-click the Project, point to New, and then click Web Service Definition.
Edit the WSD object as needed.
Right-click the Project, point to New, and then click Business Process.
Add a receive activity to the BP, and then link it to the Start element.
In the Project Explorer, expand the WSD object, expand PortTypes, and then expand PortType.
Click the PortType operation and drag it onto the empty receive activity.
If the operation includes an output message, a reply activity appears.
Add one or more empty activity to the canvas between the implement and reply activities.
Add links between the modeling elements in the sub-process, and then add business rules if needed.
Click Save.
Once you create the sub-process, you can add it to the main BP in the Project.
Create a new BP and add a receive activity, an empty activity, a reply activity, and any other activities required for the BP.
Expand the sub-process and drag the operation onto the empty receive activity.
Add links between the modeling elements in the main process and add business rules as needed.
Click Save.
If the sub-process is to be invoked as a synchronous request/reply web service, the Receive and Reply must be associated with the same partner, port type, and operation. These properties can all be configured in the property sheet for the user activity.
For web services or components that contain repeating nodes, the Business Rule Designer displays the repeating nodes in the input and output attributes for each activity, designated by the repeating icon. For direct node mapping, repeating nodes are used to dynamically populate 1-n values based on the runtime data.
XPath predicates are only used with repeating nodes and allow you to isolate particular elements in repeating nodes at runtime. Predicates allow you to define conditional mappings in a business rule when using BP attributes that contain repeating values.
The Predicate Editor allows you to define the conditions for the mapping. Once you define the conditions, you can map the associated repeating node values using the Business Rule Designer (at that point, the condition is in effect for that mapping). An indication of the condition appears to the right of the repeating node or element for which the condition was defined. At runtime, the condition is used to select the correct element and perform the mapping as designed.
You can create a predicate for a repeating node while you are defining business rules in the Business Rule Designer.
From the Business Rule Designer, right-click a repeating node.
Click New Predicate.
The Predicate Editor appears.
In the Predicate Editor, define the conditions for the predicate.
Click OK.
On the Enterprise Designer toolbar, click Save.
Once you create a predicate, you can modify the conditions as needed.
From the Business Rule Designer, right-click the existing predicate
Click Edit Predicate.
The Predicate Editor appears.
In the Predicate Editor, modify the conditions for the predicate.
Click OK.
On the Enterprise Designer toolbar, click Save.
Once you create a predicate, you can delete the predicate if needed.
From the Business Rule Designer, right-click the existing predicate.
Click Delete Predicate.
On the dialog box that appears, click Yes.
The Predicate condition is removed.
On the Enterprise Designer toolbar, click Save.
The most common use of predicates is to create a condition using either runtime BP attribute values or fixed values in an expression, and then create an appropriate mapping for when that condition is found to be true.
In certain instances, the names in one BP attribute must match name in the JMS Message User property. When the condition is found to be true, the appropriate mapping for value then takes place. In addition, only the appropriate value for value is mapped from the series of name and value pairs.
The Business Process Designer provides standard tools to automatically align the modeling elements you select. You can also change the style of the lines that link modeling components together and specify grid options.
You can choose two different styles for the links in a Business Process (BP), direct linking (diagonal) or indirect linking (orthogonal). The style you choose applies to all links in a model and the style is applied automatically.
The default setting is direct linking, which links modeling elements using the most direct line between two modeling elements and using diagonal lines when connecting elements that are not precisely aligned. Indirect linking uses only horizontal and vertical lines with right angles for elements that are not aligned.
Open the BP in the Business Process Designer.
In the Project Explorer, right-click the BP name, and then click Toggle Link Style.
The link style changes from diagonal to orthogonal or from orthogonal to diagonal.
On the Enterprise Designer toolbar, click Save.
You can change grid properties in the Properties dialog box of the BP or you can right-click in the Business Process Designer, which displays the grid options context menu. This section describes how to change grid options from the Business Process Designer.
Right-click in the Business Process Designer canvas.
A context menu appears.
To force modeling elements to align to the grid, select Snap to Grid.
To edit additional grid properties, click Grid Properties.
The Edit Grid Properties dialog box appears.
Edit any grid properties, and then click OK.
In order to clarify the display of BP modeling elements, you can automatically align and distribute the elements by selecting Align or Distribute from the toolbar.
Do one of the following:
In the Business Process Designer toolbar, click Align or Distribute.
From the menu that appears, select the type of automatic alignment or distribution you want to use.
The options are described in Aligning and Distributing Modeling Elements.
In the Enterprise Designer toolbar, click Save to save the new element placement.
Menu Item |
Description |
---|---|
Align Left |
Aligns elements vertically along their left edges. |
Align Center |
Aligns elements vertically through their centers. |
Align Right |
Aligns elements vertically along their right edges. |
Align Top |
Aligns elements horizontally along their top edges. |
Align Middle |
Aligns elements horizontally through their centers. |
Align Bottom |
Aligns elements horizontally along their bottom edges. |
Distribute Horizontally |
Distributes elements horizontally. |
Distribute Vertically |
Distributes elements vertically. |
In order to save time and effort, you can automatically arrange the modeling elements on the Business Process Designer canvas. The Auto Layout feature provides several options for arranging modeling elements for clear display.
In the Business Process Designer toolbar, click Auto Layout.
The Auto Layout dialog box appears.
Select the display options.
When you are done, click OK.
The following tables describe the different options available for arranging modeling elements. Default values are indicated with bold text.
Table 8 Cycle Remove Options
Option |
Description |
---|---|
Greedy |
Optimizes cycle removal. |
Depth First Search |
Performs cycle removal by searching depth first. |
Table 9 Layering Options
Option |
Description |
---|---|
Longest Path Sink |
Layers elements according to the longest path sink. |
Longest Path Source |
Layers elements according to the longest path source. |
Optimal Link Length |
Optimizes link length. |
Table 10 Initialize Options
Option |
Description |
---|---|
Naive |
Initializes layout without searching depth. |
Depth First Search Outward |
Initializes layout by searching depth first outwardly. |
Depth First Search Inward |
Initializes layout by searching depth first inwardly. |
Table 11 Crossing Reduction Options
Option |
Description |
---|---|
Iterations |
Specifies the number of iterations for crossing reduction. Click the up or down arrow to change the number. |
Aggressive |
Performs aggressive crossing reduction when selected. |
Table 12 Layout Options
Option |
Description |
---|---|
Layer Spacing |
Specifies the number of pixels for layer spacing. Click the up or down arrow to change the number. |
Column Spacing |
Specifies the number pixels for column spacing. Click the up or down arrow to change the number. |
Left to Right |
Performs a horizontal layout from left to right. |
Top to Bottom |
Performs a vertical layout from top to bottom. |
From the Project Explorer, you can generate a custom HTML report of your BP model. This report displays information about the configuration of the BP, including activities, attributes, trading partners, correlation sets, and so on. The report can be as detailed or as high-level as you want it to be. You can specify the objects, details, and properties to include on the report. Use this report to evaluate the BP prior to finalizing the configuration.
In the Project Explorer, right-click a BP and click Generate Report.
The Custom Documentation dialog box appears.
In the Report filename field, enter the directory path and name for the report. To browse to a file path, click the Browse button.
Click the Objects tab.
In the Selected objects panel, select any objects that you want to exclude from the report and then click Remove.
Click the Details tab.
In the Selected details panel, select any details that you want to exclude from the report and then click Remove.
Click the Properties tab.
In the Selected categories panel, select and properties that you want to exclude from the report and click Remove.
Click OK.
Sun Business Process Manager (BPM) generates the report and saves the file to the location you specified. The report appears in your default web browser.