Sun Java logo     Previous      Contents      Index      Next     

Sun logo
Sun Java System Identity Manager 6.0 Deployment Tools 2005Q4M3  

1

Using the Business Process Editor

This chapter provides instructions for using the Business Process Editor (BPE). The information in this chapter is organized as follows:


Overview

The Business Process Editor (BPE) is a standalone, Swing-based Java application that provides a graphical and forms-based view of Sun Java™ System Identity Manager workflows, forms, rules, generic and configuration objects, and views. Use the BPE when customizing Identity Manager for your environment.

You can use the Business Process Editor (BPE) to

Within the BPE, you create workspaces that are associated with specific repositories.


Starting and Configuring the BPE


Note  To run the BPE, you must have Identity Manager installed on your local system and Configurator-level access to Identity Manager.

This section provides instructions for starting and configuring the BPE application, which includes:

Starting the BPE

To start the BPE from the command line:

  1. Change to the Identity Manager installation directory.
  2. Set environment variables with these commands:
  3. set WSHOME=<Path_to_idm_directory>
    set JAVA_HOME=<path_to_jdk>


    Note  If you are starting the BPE on a UNIX system, you must also enter

    export WSHOME JAVA_HOME

  4. Change to the idm\bin directory and type lh config to start the BPE:
  5. The Workspace location dialog displays, as follows:


    BPE Workspace location dialog box

    Figure 1. BPE Workspace location Dialog

Use the Workspace location dialog to create a new workspace or to select an existing workspace. Instructions for both actions are provided in the next section.

Specifying a Workspace

A workspace is a mechanism for saving repository connection information (such as the default server and password), options, breakpoints set by the BPE debugger, open sources, and automatically saved files.

A workspace is tied to a specific repository. You can have more than one workspace associated with a repository, but only one repository per workspace.

The BPE has two different connections to the Identity Manager repository:

This section contains instructions for

Creating New Workspace

To create a new workspace,

  1. In the Workspace location dialog, enter a unique name for the new workspace in the Workspace Directory field, and then click OK.
  2. When you provide the name of a workspace that does not yet exist, the Create new workspace wizard displays and instructs you to provide a directory for the workspace.

  3. Enter a directory name in the Workspace directory field, and then click Next.
  4. The Connection Information dialog displays so you can specify connection information for your workspace.


    BPE Connection Info dialog

    Figure 2. BPE Connection Information Dialog

  5. Specify the Editor connection information as follows:
    1. Select a connection type:
      • Local (selected by default): Select to enable the BPE to work on objects in a local repository.
      • When you specify a Local connection, BPE connects to the repository using the ServerRepository.xml found in WSHOME. (The SOAP URL field will be greyed out.)

      • SOAP: Select to enable the BPE to work on objects in a different repository.

      • Note  When you specify a SOAP connection, you will also be specifying SOAP as the default connection type for the BPE debugger.

    2. If you are using a SOAP connection, enter a fully qualified URL in the SOAP URL field. For example, http://localhost:8080/<idm>/servlet/rpcrouter2, where <idm> is the directory where you installed Identity Manager.
    3. Enable the Test Connection option if you want Identity Manager to test this connection to the repository.
  6. Specify the Debugger connection information for the BPE debugger as follows:

  7. Note  As mentioned previously, if you selected SOAP for the Editor connection type, you set the default debugger connection type to SOAP by default. All of the options in the Debugger connection area will be greyed out.

    1. Select the connection type and SOAP URL (if necessary).
    2. Enable the Test Connection option if you want Identity Manager to test this connection to the repository.
  8. Provide the following credentials:
    1. Enter a User login name and Password.
    2. Enable the Remember Password option if you want the BPE to use these credentials by default whenever you log into BPE.
  9. Click Finish to create the new workspace and the BPE main window will display.

Selecting a Workspace

Use one of the following methods to select an existing workspace from the Workspace location dialog,

After selecting a workspace, click OK and the BPE main window will display.

Troubleshooting Start-Up

When BPE tries to connect to the underlying server, you may receive the following error message:

HTTP 404 - /idm/servlet/rpcrouter2

Type Status report

message /idm/servlet/rpcrouter2

description The requested resource (/idm/servlet/rpcrouter2) is not available

If you get this connection error, check the URL field in the browser instance in which you are running Identity Manager. The first part of the URL listed there — for example, http://localhost:8080/idm — must be the same as the URL that you entered as the debugger connection.

Enabling JDIC

If you want to embed the web browser panel in the Form Preview panel, you must select JDIC as the preferred web browser. Otherwise, the Web Browser panel will use the External webbrowser command to launch the web browser externally.

To specify JDIC, use the following steps:

  1. Select Tools > Options to open the Editor Options dialog.

  2. BPE Editor Options dialog

    Figure 3. Editor Options Dialog

  3. Enable the JDIC option as the Preferred webbrowser. (This option does not display if the application is running a version of JRE less than 1.4.)

  4. Notes:

    • To enable JDIC for Windows, you must install Internet Explorer. (Mozilla is not currently supported on Windows.)
    • To enable JDIC on Linux or Solaris, you must install Mozilla. At present, GNOME is the only supported desktop.
    • In addition, you must set the MOZILLA_FIVE_HOME environment variable to the root directory of your Mozilla installation.

To configure JDIC for Solaris 10+x86:

  1. Download jdic-0.9.1-bin-cross-platform.zip from https://jdic.dev.java.net.
  2. Extract the zipped files.
  3. Replace the <wshome>/WEB-INF/lib/jdic.jar with the
    jdic-0.9.1-bin-cross-platform/jdic.jar.
  4. Copy jdic-0.9.1-bin-cross-platform/sunos/x86/* to <wshome>/bin/solaris/x86.

Using SSL in the BPE

To use SSL. in the BPE, open the Create new workspace wizard and change the SOAP URL protocol to https and the port number to your application’s SSL port.


Navigating the Business Process Editor

Before you start customizing Identity Manager processes or objects, you should know how to work with, view, and enter information and how to make selections in the BPE.

This information is organized into the following sections:

Working with the BPE Interface

The BPE interface includes a menu bar and dialogs for selections. The primary display is divided into two main panes:

Working in Tree View

The tree view (in the left interface pane) shows a hierarchical view of a task, form, view, or rule. This view lists each variable, activity, and sub-process in order, nesting actions and transitions under each activity.

The following example shows a sample tree view highlighting workflow.

The workflow tree view lists each activity. Other process components, such as actions and transitions, are nested below.

Figure 4. BPE Tree View

Working with Additional Display Views

BPE provides the following additional display views:

The availability of these views depend upon the object type or process you select.
For example, the BPE presents a graphical display of a form as it would appear in a browser. This view complements the property view and XML display of unique form elements.


Note  These views are introduced in the following sections.
For more detailed information about which display types are available for each Identity Manager object or workflow process, and how to work with these additional views, see Sun Java™ System Identity Manager Workflows, Forms, and Views.

Diagram View

For workflow, the Diagram view displays in the right interface pane, and provides a graphical representation of a process. Each icon represents a particular process activity.

Diagram view of a workflow

Figure 5. Diagram View (Workflow)

Graphical View

The Graphical view displays in the lower right pane of the BPE display and shows the currently selected form as seen in a browser window.

Property View

The Property view displays in the upper right pane of the BPE display and provides information about elements in the currently selected form.

Property view of a form

Figure 6. Property View (Form)

Loading Processes or Objects

To load an Identity Manager process or object use the following steps:

  1. Select File > Open Repository Object from the menu bar.

  2. Tip  You can also use the Ctrl-O shortcut. (See Keyboard Shortcuts, for a complete list of BPE shortcuts.)

  3. If prompted, enter the Identity Manager Configurator name and password in the login dialog, and then click Login.
  4. The Select objects to edit dialog displays (similar to the following figure).


    BPE Select objects to edit dialog with Library object options displayed

    Figure 7. Select objects to edit dialog (with Library options expanded)

    This dialog contains a list of objects, which can include the following object types.

    Workflow task icon

    Workflow Processes

    Library icon

    Libraries

    Workflow sub-process icon

    Workflow Sub-processes

    Generic Objects

    Form task icon

    Forms

    Configuration Objects Icon

    Configuration Objects

    Rule icon

    Rules

    View icon

    MetaViews

    Email template icon

    Email Templates

     

     


    Note  Items displayed may vary based on your Identity Manager implementation.

  5. Double-click an object type to display all of the objects that you have permission to view for that type.
  6. Select a process or object, and then click OK.

Setting Editor Options

You can set several options so that your preferences are reflected each time you launch the BPE. You can also set these options individually each time you work in the editor.

To set editor options, select Tools > Options to open the Editor Options dialog.

Editor Options dialog

Figure 8. Editor Options Dialog

You can use the options on this dialog to specify the following preferences:

Validating Workflow Revisions

You can validate your workflow revisions at different stages of the customization process:

The BPE displays validation messages that indicate the status of the process:

Validate your workflow revisions as follows:

  1. Click an indicator to display its process action.
  2. After making changes, click Re-validate to re-test the process, confirm that the error is corrected, and check for additional errors.
  3. Drag your cursor into the Workflow diagram view.
  4. The activity appears in the view.


    Tip  Any activities you create after the first activity are numbered. Re-number similar activities before creating more than two.

Saving Changes

To save your changes to a process or object and check it into the repository, select File > Save in Repository from the menu bar. When you select Save, the BPE saves the object in the location in which it was last saved (either in the repository or the file in which it was last saved). You can have multiple copies of the same object open.


Note  You can use File > Save As File to save the object or process as an XML text file. Save the file in the form Filename.xml.

You can have multiple copies of the same object open in varying states and in different files or repositories.

Inserting XPRESS

If you are editing a rule, workflow, configuration or generic object, or form in the BPE XML pane, you can quickly insert an XML template for an XPRESS element wherever you have positioned the cursor.

  1. Position the cursor where you want to add the new XPRESS statement.
  2. Click the right mouse button to display the New menu.
  3. Select the type of XPRESS statement you want to add to the XML.
  4. For example, select New > Logical > cond to add an empty cond statement at the cursor insertion point. The BPE displays the content-free cond statement, as illustrated in the following figure.


    Use menu to insert XPRESS functions into XML.

    Figure 9. Menu for Inserting XPRESS Functions into XML

  5. Complete the statement as needed.

  6. Note  If you insert the XPRESS element in an invalid location, one or two red dots (indicators) display immediately to the left of the new code lines that mark the first and last lines of the inserted code. See Validating Workflow Revisions for information about these indicators.


    Inserting an XPRESS function

    Figure 10. Inserting XPRESS Function

Using Keyboard Shortcuts

The BPE supports these keyboard shortcuts for performing tasks.

Keyboard Command/Key

Action

Ctrl-O

Open (repository object)

Ctrl-S

Save (repository object)

Ctrl-X

Cut

Ctrl-C

Copy

Ctrl-V

Paste

Delete

Delete


Accessing Javadocs

You can access Javadocs for all public method classes from any BPE window that displays XML, as follows:

  1. Right-click in an XML window to display the cascading menu.
  2. Select New > Browse Javadoc.


  3. Figure 11. Opening a Javadoc

  4. Select one of the following options from the cascading menu, which includes the following packages, subsequently broken down into component classes:
    • com.waveset.object — Lists all the classes subordinate to this parent class.
    • com.waveset.ui — Lists all the classes subordinate to this parent class.
    • com.waveset.util — Lists all the classes subordinate to this parent class.
    • com.waveset.util.jms — Lists all the classes subordinate to this parent class.
    • All Classes — Displays the frames view of the Javadoc classes, from which you can navigate through each class in the browser.
    • Selecting one of these menu options opens a browser window that displays the class Javadoc.

Inserting a Method Reference

To insert a method invocation in the XML, access the method summary section of the class Javadoc. Click the Select button that precedes the method name under the Method Summary.

Selecting the getUser Method.

Figure 12. Selecting the getUser Method

At the cursor insertion point, BPE inserts the <invoke> element that you need to call the method from the XML.


Tip  Click Validate for preliminary confirmation of the invoke statement syntax and XML.


Working with Generic and Configuration Objects

The fundamental object model for Identity Manager is the persistent object model. Because you perform almost all Identity Manager operations by creating an object, the persistent object API is the fundamental object model for customizing and controlling Lighthouse.

This section provides information about working with persistent objects. The information is organized as follows:

Common Persistent Object Classes

PersistentObject is the common base class of all persistent objects, and provides the fundamental object model for customizing and controlling Identity Manager. PersistentObject consists of a set of Java classes that are part of the infrastructure that is common to all persistent objects.

Type

A set of constants used in many methods to indicate the type of object being referenced.

PersistentObject

The common base class of all repository objects. The most significant properties are the identity, member object groups and the property list.

ObjectRef

When an object references another, the reference is encoded in this object. The reference includes the object type, name, and repository identifier.

Constants

A collection of random constants for many different system components.

ObjectGroup

This represents an organization in the Identity Manager interface. All persistent objects must belong to at least one object group. If you do not specify otherwise, the object is placed in the Top group.

Attribute

A collection of constant objects that represents common attributes that are supported by objects. Often used internally when building object queries. When a method accepts an Attribute argument, there is usually a corresponding method that takes a string containing the attribute name.

Viewing and Editing Objects

You can use the BPE to view and edit the two of the most commonly customized persistent object types:

Configuration Objects

You can directly access forms and workflows in the BPE; however, the BPE also provides access to other configuration objects that are not associated with a custom viewer. You can access these miscellaneous configuration objects from the BPE under the Configuration Object category.

The BPE lists these miscellaneous configuration objects in the left pane (tree view), as shown in the following figure:

BPE tree display of the configuration object

Figure 13. BPE Tree Display of the Configuration Object

Double-clicking on an object name in tree view displays the Object window, which provides the following object views (tabs): Main, Repository, and XML.

For example, if you double-click User Extended Attributes in tree view, the following dialog displays:

Object dialog with Main, Repository, and XML tabs

Figure 14. User Extended Attributes Object Dialog

The BPE also displays configuration objects as unfiltered XML in the left pane of the BPE window. For example, see the following figure:

BPE XML display of the Reconcile configuration object

Figure 15. BPE XML Display of Reconcile Configuration Object

Generic Objects

Generic objects are simple collections of name/value pairs you can use to represent views. BPE displays these name/value pairs in column form and lists the attribute’s data type. Valid data types include Boolean, int, string, and xmlobject.

BPE attribute display of a generic object (System Configuration)

Figure 16. BPE Attribute Display of Generic Object (System Configuration)


Note  Many customizations involve editing the System Configuration object, which is a type of generic object.

Creating a New Object

To create a new Configuration or Generic object

  1. Select File > New > GenericObject or Configuration Object.
  2. The Configuration:New GenericObject or Configuration:New Configuration dialog opens, with the Main panel displayed.

  3. Enter the new object name in the Name field.
  4. The BPE main window adds the new object name to the tree view. In addition,

    • If you created a generic object, a blank Attributes pane displays as follows:

    • New generic object display

      Figure 17. BPE New Generic Object Display

    • If you created a configuration object, the BPE displays the following window, which contains a template for the new XML object.

    • New configuration object display

      Figure 18. BPE New Configuration Object Display

  5. If you are creating a generic object, add an attribute as follows, repeating as necessary:
    1. Click New at the bottom of the Attributes pane. The BPE displays a new attribute field at the bottom of the list of attributes. Select New Attribute, then enter the name of the attribute.
    2. Assign a data type by clicking null in the Type column, and selecting a data type from the drop-down menu.

    3. New BPE generic object attribute

      Figure 19. New Attribute of BPE Generic Object Display


      Note  To delete an attribute, click the attribute name, then click Delete.

  6. Select File > Save in Repository to save the new object to the repository.

Validating a New Configuration Object

You can immediately validate the new configuration object XML by clicking Validate, in the right pane of the main BPE window.


Debugging Workflows, Forms, and Rules

The BPE includes a graphical debugger for workflows, rules, and forms. You can use the BPE debugger to set breakpoints visually, execute a workflow or form to a breakpoint, then stop process execution and examine the variables.

If you have previously used a code debugger for a procedural programming language, you will be familiar with the terms used in this section.


Note  For more information about views, workflow, forms see the relevant chapters in Sun Java™ System Identity Manager Workflows, Forms, and Views.

This section describes how to use the BPE Debugger, and is organized into the following sections:

Recommendations for Use

Use the BPE debugger under the following conditions only:

Clusters are not supported for use with the BPE debugger.

Running the Debugger Outside a Test Environment

If you find a problem in production that requires debugging, reproduce and debug it in a test environment. Setting breakpoint in the debugger can quickly bring down the application server in a production environment, where a large volume of traffic occurs. In addition depending on where breakpoints are set, users can be blocked from using the system.

If you cannot debug in a separate test environment, follow this procedure:

  1. Divert all live traffic to a subset of your cluster by taking one of the nodes in your cluster offline. (For the purpose of this task, call this node server-a.)
  2. Use the BPE to edit the System Configuration object by setting the SystemConfiguration serverSettings.server-a.debugger.enabled property to true.

  3. Note  For information about accessing the System Configuration object with the BPE, see Step Two: Edit the System Configuration Object.

  4. Restart server-a so that the change to the System Configuration property setting can take effect.
  5. Launch the debugger by selecting Tools > Debugger.
  6. Create a new workspace, where the debugger connection uses the following URL:
  7. server-a:<port>

When you have finished debugging

  1. Set serverSettings.server-a.debugger.enabled to false and restart server-a to prevent the debugger from connecting to your live production environment.
  2. Reintegrate server-a into your on-line cluster.

Disabling the Debugger

Always disable the serverSettings.server-a.debugger.enabled property in production to prevent someone from accidently connecting a debugger to the application server.

To disable the debugger, set the System Configuration object property serverSettings.<server>.debugger. to enabled=false.

Using the Debugger Main Window

The main debugger window displays the XML of the selected object and provides information about its execution. From this window, you can

The main window contains the following areas, which are described below:

Sources Area

The Sources area displays the unfiltered XML of the selected object.

The left margin of the XML panel displays a series of boxes that indicate points in the code where breakpoints can be set. Click the box immediately adjacent to the <WFProcess...> tag to set a breakpoint at the start of the workflow.

BPE Debugger main window: Sources panel

Figure 21. BPE Debugger Main Window Source Panel

Execution Stack

The Execution Stack identifies which function in the selected object is under execution. This area lists the executing function’s name and the name of the function that called it.

If additional functions appear in the call chain, these functions are listed in order. This list is also called a stack trace, and displays the structure of the execution stack at this point in the program's life.

BPE Debugger: Main window Execution Stack panel

Figure 22. BPE Debugger Main Window Execution Stack Panel

Variables Area

The Variables area lists all variables that are currently in scope at the current point of execution. Click on the variable object name to expand it and display the names of each variable.

BPE Debugger Variables panel

Figure 23. BPE Main Window Variables Panel

Variables Not Available

The Variables Not Available area displays if debugging is inactive or if the selected stack frame is not the current stack frame.

Last Result

If the current element is an XPRESS end tag, the Last Result area contains the result of that evaluation. Also applies to other tags for which last value makes sense. For example, as <Argument>'s to workflow subprocesses are evaluated, this area has the value of that argument. This area is not available if debugging is not currently in progress.

BPE Debugger: Main window Last result panel

Figure 24. BPE Debugger Main Window Last result Panel

Last Result Not Available

The Last Result Not Available area displays if debugging is inactive.

Keyboard Shortcuts

The BPE debugger supports these keyboard shortcuts for performing tasks.

Keyboard Command/Key

Action

Ctrl-O

Open (repository object)

Ctrl-R

Refresh Sources

F5

Select Current Line

F6

Step out

F7

Step into

F8

Step over

F9

Continue (Debugging)

Setting Breakpoints

A breakpoint is a command that the debugger uses to halt the execution of the object before executing a specific line of code. In the Identity Manager debugger, code breakpoints apply regardless of where the form or workflow is launched from.

While most debuggers allow you to set breakpoints only on source locations, the BPE debugger permits you to also set breakpoints at conceptual execution points, such as Refresh view. In this case, the debugger will suspend when a Refresh view operation occurs. You can then step-into the refresh view and see the underlying form processing in progress.

Setting a breakpoint is a global setting. That is, it causes the incoming request threads to suspend when the designated breakpoint is reached. This happens regardless of which user is making the request.

Setting a Breakpoint

To view a summary of all source breakpoints, click the Sources tab. The Breakpoints pane lists all source breakpoints. Navigate to a particular breakpoint by clicking the breakpoint in.

Types of Breakpoints

The Breakpoints area provides three types of breakpoint settings. Access these types of breakpoints by clicking the designated tab:

Select the Global tab to set code breakpoints by:

Checking both of these setting results in the debugger checking all breakpoints.

(Optional) Select a global setting, and click OK.

BPE Debugger Breakpoints panel: Global tab

Figure 25. BPE Debugger Breakpoints Panel: Global Tab

Select the View cycle tab to set code breakpoints based on the view processing that occurs during process execution. The most commonly invoked view operations are listed in this dialog. Each of the listed view operations are available on each view.

BPE Debugger Breakpoints panel: View Cycle tab

Figure 26. BPE Debugger Breakpoints Panel: View Cycle Tab

Select the Form cycle tab to set code breakpoints based on a designated stage of form processing. For information about the stages of form processing, see Identity Manager Workflows, Forms, and Views.

BPE Debugger Breakpoints panel: Form Cycle tab

Figure 27. BPE Debugger Breakpoints Panel: Form Cycle Tab

Stepping through an Executing Process

Stepping through describes the sequential, deliberate analysis of an executing process’ functions.

Terminology

Step into, step over, and step out are terms borrowed from debuggers of procedural programming languages, in which the execution order is implied by the structure of the language. However, in Identity Manager forms and workflow, the order in which elements occur in the code do not reflect the order in which they are executed.

Consequently, these terms have slightly different meanings as used in the Business Process Editor:

step-into

Describes moving to the next point of execution on the current thread. step-into always the smallest amount by which you can proceed through a process in the debugger XML display.

step over

Describes moving from the current begin tag to the current end tag without stopping at an interim element. Stepping over permits you skip almost everything between a start and end tag. However, if the next point of execution does not occur between the start and end tags of the current element, debugging halts there instead.

This can happen, for example, in a workflow containing multiple active virtual threads. You can step to the start tag of an action, but the next element to be executed is a different action. In this case, the process stops executing at a different point. Thus we avoid accidently skipping over a potentially significant element.

step out

Describes moving incrementally until the execution stack is one less than the current. Similar to step-over. If the next point of execution has a different parent execution stack, it will stop there instead.

General Hints

Following is a list of hints to help you successfully step through an executing process:

The following table provides snapshot of how the BPE debugger would proceed through this code sample:

<A>

   <B/>

</A>

<D/>

(A, B, and D are some xml elements)


Execution Order

Result

<A>, <B/>, </A>, <D/>

If you are clicking step-into, the debugger highlights the lines in that execution order.

If you are clicking step-over, the debugger highlights <A>, </A> (skipping B), <D/>

<A>, <D/>, <B/>, </A>

If you are clicking step-over, you will see code lines in the order <A>, <D/>, <B/>, </A>. (Step-over is equivalent to step-into for this case.)

Getting Started

The BPE includes a tutorial on using the debugger with workflow, forms, and rules. The debugger ships with sample/debugger-tutorial.xml, which contains some sample workflows, rules, and forms. These samples are used throughout this chapter for tutorial purposes.

Step One: Import Tutorial File

Use one of the following methods to import the tutorial file:

After importing the file successfully, continue to the next section.

Step Two: Edit the System Configuration Object

To edit the system configuration object, use the following steps:

  1. From the BPE, open the System Configuration object for editing by selecting
    File > Open Repository Object > Generic Objects > System Configuration.
  2. In the tree view, expand serverSettings and the default attribute, and then select debugger.
  3. In the Attributes panel, click the Value column to enable debugging.
  4. Select File > Save In Repository to save your change.
  5. Restart your application server.
  6. Caution  Do not enable this property in production.

Step Three: Launch the Debugger

After restarting the application server, you can select Tools > Debugger to launch the BPE debugger.

Example: Debugging the Tabbed User Form and Refresh View

This section provides a sample debugging procedure to illustrate how debugger breakpoints apply regardless of where a form or workflow is launched from.

The sample procedure includes the following steps:

  1. Setting a Breakpoint
  2. Creating New User
  3. Viewing Before Refresh View Results
  4. Viewing After Refresh View Results
  5. Stepping Through the Form
  6. Completing the Form Processing
Setting a Breakpoint

To set a breakpoint:

  1. Click the View cycle tab in the Breakpoints panel.
  2. Check Refresh View. The debugger now executes a breakpoint whenever a view is refreshed during execution.
Creating New User

To create a new user:

  1. In Identity Manager, select Accounts > New... User.
  2. Enter a first name (for example, jean) and a last name (for example, faux).
  3. Click the Identity tab to trigger a refresh view operation.
Viewing Before Refresh View Results

Return to the debugger frame, which is now suspended on the Refresh view breakpoint that you set. The Execution Stack lists Before Refresh View, which indicates the state of the view just before the refresh operation occurred. The Variables panel displays the view just before it has been refreshed.

Example 1: Debugging suspended on the Before Refresh View breakpoint

Figure 28. Example 1: Debugging Suspended on Before Refresh View Breakpoint

Expand the global subtree and locate the firstname and lastname values that you typed in the form. Note that the fullname is currently null.

Viewing After Refresh View Results

To view the After Refresh view results,

  1. Click Continue.
  2. The Execution Stack lists After Refresh View, which indicates that it now displays the state of the view just after refresh has occurred. Note that the fullname value is now jean faux.


    Example 1: Debugging suspended on After Refresh View breakpoint

    Figure 29. Example 1: Debugging Suspended on After Refresh View Breakpoint

  3. Click Continue again.
  4. The form has resumed execution. Return to the browser window. Change First Name to jean2 and click the Identity tab again to trigger another refresh.

  5. Return to the debugger frame.
  6. Form processing is suspended at Before Refresh View.

Stepping Through the Form

To Step Through the form,

  1. Click Step-Into to reveal the fullname expansion in execution.
  2. The debugger displays Before Expansion, which indicates that the form variables have not been expanded.


    Example 1: Debugging suspended before the first expansion pass

    Figure 30. Example 1: Debugging Suspended Before First Expansion Pass

  3. Click Step-Into again.
  4. The debugger displays Before Expansion, iteration=0, indicating that you will see the form variables before the first Expansion pass.

  5. Click Step-Into again.
  6. The debugger is now on an anonymous source. The anonymous source is a wrapper form created on the fly and is related to the MissingFields form.


    Example 1: Stepping into the start of the Tabbed User form

    Figure 31. Example 1: Stepping-into the Start of Tabbed User Form

  7. Click Step-Into two more times until you reach the beginning of Tabbed User Form.
  8. Continue to click Step-Into until you reach <Field name='global.fullName'> (Approximately 20 to 30 step-into operations.)
  9. Click Step-into 15 times or until you have reached the </Field> element.
  10. While stepping, the Last result at the </concat> tag is jean2 faux.

    The form_outputs contains global.fullname: jean2 faux.


    Example 1: Completed debugging of Tabbed User form

    Figure 32. Example 1: Completed Debugging of Tabbed User Form

Complete Form Processing

To complete form processing:

  1. Click Step-out seven times.
  2. At this point, your stack should indicate:

    Refresh View (User)
    After Expansion

    The Variables panel reflects the state of the form variables after all expansions have run.

  3. Click Step-out again.
  4. You have now reached After refresh view. The variables now displayed are the view variables.

  5. Expand the global subtree.
  6. Note that fullname is now jean2 faux.

  7. Click Continue.

Debugging Workflows

This section provides information about debugging your workflows.

The Workflow Execution Model

Workflows are executed by a single Java thread and are represented in the Execution Stack panel by a single Java thread. However, within a workflow, each activity becomes its own virtual thread.

During workflow execution, the workflow engine cycles through a queue of virtual threads. Each virtual thread is in one of the states described in the following table.

Workflow Activity State

Definition

 

ready

Identifies an activity that has just been transitioned to. (This state is very temporary, as actions typically start executing immediately after being designated ready.)

executing

Identifies an activity that contains one or more actions that are currently being executed or have yet to run.

This is a logical state. It does not mean that the Java thread is currently executing it.

The action currently being executed is always the action that is highlighted in the debugger.

pending outbound

Identifies an activity after all actions within an activity have been run, it goes to the pending outbound state. In this state, it awaits an outbound transition to be taken. In the case of an or-split, it is in this state until one transition is taken. In the case of an and-split, it will be in this state until all transitions whose conditions evaluate to true are taken.

inactive

Identifies an activity in which all transitions have been taken.

pending inbound

Identifies a virtual thread whose activity is an and-join. That is, one transition to this virtual thread has occurred, but the process is still waiting for other transitions.

After all transitions have completed, the workflow process subsequently begins executing.

Example 1: Debugging a Workflow and a Rule

This example illustrates how to use the BPE debugger to debug a sample workflow and rule using a workflow provided in debugger-tutorial-workflow1 (supplied with Identity Manager). This example exemplifies how to step-into and step-through workflow debugging and rule execution.

You will complete the following steps:

  1. Launching the Process
  2. Starting Execution
  3. Stepping Through the getFirstName Thread
  4. Stepping Into and Over the getLastName Thread
  5. Stepping Into computeFullName Processing
  6. Stepping Through Rule Processing
  7. Concluding Workflow Processing
Step One: Launching the Process

To launch the workflow debugging process:

  1. From the debugger main window, select File > Open Repository Object.
  2. Click debugger-tutorial-workflow1.
  3. Note the small boxes in the left margin of the XML display. These boxes identify potential breakpoints that you can insert into the code.


    Example 2: Setting the first breakpoint

    Figure 33. Example 2: Setting the First Breakpoint

  4. Click the box adjacent to the <WFProcess> tag to set a breakpoint at the start of the workflow.
  5. Log in to Identity Manager and select Tasks > Run Tasks.
  6. Click debugger-tutorial-workflow1.
  7. The debugger frame indicates that debugging has halted at your breakpoint.


    Example 2: Debugging halted at your breakpoint

    Figure 34. Example 2: Debugging Halted at Breakpoint

    Note the following:

    • Execution Stack Panel — At the top of the Execution Stack panel, you see Thread [thread name] (suspended). This indicates that this workflow is currently being run by the thread of the given name, and that it is suspended at the breakpoint you set.
    • Below the Thread is your execution stack. This stack is an upside-down stack trace, with the calling function on top and the called function at the bottom. (It is upside down compared with how most debuggers represent execution stacks.)

      The top most frame in the stack says Checkin View (ProcessViewer), which indicates that the workflow is being called by the checkinView method of the ProcessViewer. Because you do not have access to the Java source code for this stack frame, clicking on it will not display new information. However, it provides context as to where the workflow is being launched from.

      The next frame in the stack is highlighted because it corresponds to the current point of execution, which is the beginning of the workflow process (<WFProcess>).

    • Variables panel — Lists all variables that are currently in scope at the current point of execution. You will see
      • Interactive — This variable is passed in by the view as an input to the process.
      • WF_CASE_OWNER, WF_CASE_RESULT, WF_CONTEXT — These variables are implicit workflow variables.
      • firstName, fullname, and lastName — These variables are declared in the workflow using <Variable> declarations.
  8. Select Debug > Select Current Line (F5) to re-highlight your current line of execution.
Step Two: Starting Execution

To start execution:

  1. Click Step-Into.
  2. At this point, the debugger moves to the start activity. Notice that the Execution stack contains a Virtual Thread [start, step=0] (executing), which indicates there is a Virtual Thread for the start activity that is currently in the executing state.


    Example 2: Stepping into the execution of the first virtual thread

    Figure 35. Example 2: Stepping-into the Execution of the First Virtual Thread

  3. Click two levels up on the debugger-tutorial-workflow-1 frame to highlight the WFProcess, showing you the location of the caller.
  4. Press F5 to return to the current line.
  5. Click Step-Into.
  6. At this point, the debugger moves to the </Activity> and the start virtual thread is now pending outbound.

Step Three: Stepping Through the getFirstName Thread

Use the following procedure to step-through the getFirstName thread:

  1. Click Step-Into.
  2. At this point, the debugger has highlighted the transition to getFirstName.

  3. Click Step-Into.
  4. A new Virtual Thread for getFirstName has been created as a result of this transition. This Virtual Thread is currently in the ready state. The start virtual thread is still pending outbound (because this is an and-split operation, it must take all possible transitions).


    Example 2: Stepping into the execution of getFirstName

    Figure 36. Example 2: Stepping-into the Execution of getFirstName

  5. Click Step-Into again.
  6. The debugger jumps to the getFirstName activity. The state changes from ready to executing.

  7. Click Step-Into.
  8. The debugger moves to the get action.

  9. Click Step-Into three more times or until the debugger reaches the </set> tag.
  10. The variables panel indicates that firstName has been set to myfirstname as a result of the </set>.

Step Four: Stepping Into and Over the getLastName Thread

Use the following procedure to step-into and over the getLastName thread:

  1. Click Step-Into three more times or until the debugger reaches the </Activity> for getFirstName.
  2. The getFirstName virtual thread is now pending outbound.

  3. Click Step-Into.
  4. The debugger returns to the start virtual thread, and is about to process the transition to getLastName.

  5. Click Step-Into.
  6. The start has gone to inactive because all transitions have been processed. getLastName is now in the ready state because of this transition.

  7. Click Step-Into.
  8. At this point, the start virtual thread will go away because it is inactive. Debugging moves to the getLastName virtual thread, which is now in the executing state.

  9. Click Step-Over to skip to the end of getLastName.
  10. The lastName variable in the variables panel has been set to mylastname. Both the getFirstName and getLastName virtual threads are pending outbound.

  11. Click Step-Into.
  12. The debugger is on the transition from getFirstName to computeFullName.

  13. Click Step-Into.
  14. getFirstName goes to inactive and a new virtual thread, computeFullName is created. This thread is in the pending inbound state because it is still waiting on the inbound transition from getLastName. (The wait occurs because it is an and-join operation. If it were an or-join operation, process status would immediately go to ready.)

  15. Click Step-Into.
  16. The debugger is now on the transition from getLastName to computeFullName.


    Example 2: Debugger transitioning from  getFirstName to computeFullName

    Figure 37. Example 2: Debugger Transitioning from getFirstName to computeFullName

Step Five: Stepping Into computeFullName Processing

Use the following procedure to step-into computeFullName processing:

  1. Click Step-Into.
  2. The computeFullName virtual thread goes from pending inbound to ready because of this transition.

  3. Click Step-Into.
  4. computeFullName is now executing.

  5. Click Step-Into five more times.
  6. The debugger is now on the </argument> tag for firstName. The last result panel shows <String>myfirstname</String>. This value is passed for the firstName argument.


    Example 2: Stepping into computeFullName processing

    Figure 38. Example 2: Stepping Into computeFullName Processing

Step Six: Stepping Through Rule Processing

To Step Through rule processing:

  1. Click Step-Into three more times.
  2. The debugger steps into the Compute-Full-Name rule. In the execution stack, click the frame to move up one frame. The <rule> call in debugger-tutorial-workflow-1 is highlighted to indicate from where the rule is being called. Press F5 to re-select your current line.

  3. Click Step-Into three more times or until the debugger reaches the </ref> tag.
  4. The last result panel shows <String>myfirstname</String>, which is the result of the <ref>firstName</ref>.

  5. Click Step-Into three more times or until the debugger reaches the </concat> tag.
  6. The Last result panel displays the result of the <concat> expression.

    <String>myfirstname mylastname</String>

  7. Click Step-Into twice more and Debugging returns to the </rule> tag.
Step Seven: Concluding Workflow Processing

To conclude workflow processing:

  1. Click Step-Into until you reach the </set> element.
  2. The fullname variable has been updated to myfirstname mylastname.

  3. Click Step-Into twice more.
  4. computeFullName is now pending outbound.

  5. Click Step-Into four more times. end goes to ready, then executing.
  6. The debugger reaches the </WFProcess> tag, indicating that the process has now completed.

  7. Click Step-Into.
  8. The Execution Stack displays After Checkin view, meaning that the checkin-view operation that launched this workflow has completed.


    Example 2: Completion of Check-in opertation

    Figure 39. Example 2: Completion of Check-in View Operation

  9. Click Continue to resume execution.
  10. If the browser request has not timed out, the Task Results diagram with the process diagram is displayed.

Example 2: Debugging a Workflow Containing a Manual Action and a Form

The following example illustrates how to use the debugger to debug a sample workflow containing a manual action. Use workflow2 from the debugger tutorial files.

  1. Select File > Open Repository Object.
  2. Expand Workflow Processes, and select debugger-tutorial-workflow2.
  3. Set a breakpoint on the <WFProcess...> tag.
  4. Log in to Identity Manager, and navigate to Tasks > Run Tasks.
  5. Click debugger-tutorial-workflow2.
  6. The debugger has stopped at the breakpoint you set.

  7. Click Step-Into six times or until the debugger marks <ManualAction... name='getNameAction'>).

  8. Example 3: Stepping into a manual action

    Figure 40. Example 3: Stepping Into a Manual Action

  9. Click Step-Into.
  10. When a dialog displays to explain that form processing occurs in a different thread, set a breakpoint on the <Form> tag to see the processing occur.

  11. Example 3: Debugger stepping into Manual Action dialog

    Figure 41. Example 3: Debugger Stepping Into Manual Action Popup Dialog

  12. Click Yes or Always.
  13. After form processing has completed, the workflow continues execution in a separate thread. Consequently, you must set a breakpoint on the </ManualAction> to observe workflow processing after the form has completed processing.


    Example 3: Breakpoint marking start of the form

    Figure 42. Example 3: Breakpoint Marking Start of Form

    Note that the debugger has set breakpoints on the <Form> and </ManualAction> tags as indicated. In addition, the execution stack indicates After checkin view... and you have stepped out of the workflow process because workflow processing has proceeded as far as possible (until the manual action completes).

  14. Click Continue, and the debugger stops processing at the breakpoint set on the <Form> element.

  15. Example 3: Debugger displaying manual action processing

    Figure 43. Example 3: Debugger Displaying Manual Action Processing

    Note the following In the Execution Stack area:

    • Checkout View (WorkItem:...) — Indicates that processing is occurring in the context of a checkout view for the given work item.
    • ManualAction forms — Operate against the work item view and manipulate workflow variables through the variables object. Expand the variables object to see the non-null workflow variables.
    • Derivation — Indicates that form execution is on the Derivation pass.
  16. Because this form contains no <Derivation> expressions, proceed to the next phase or processing by clicking Continue. The HTML Generation (root component) pass of form processing begins.
HTML Generation Phase (Root Component)

To generate HTML for the root component:

  1. Click Step-Into twice.
  2. The debugger has just processed the title <Property> element. The Last result panel contains the value of this property.

  3. Click Step-Into three more times.
  4. The debugger skips the fields in the form and goes directly to the </Form> element because this pass focuses only building the root component of the page.

  5. Click Continue.
  6. The HTML Generation (subcomponents) pass of form processing begins.

HTML Generation (Subcomponents)

To generate HTML for the subcomponents:

  1. Click Step-Into 13 times or until the debugger reaches the </Form> tag.
  2. The debugger iterates over each of these fields and evaluates their display properties.

  3. Click Continue.
  4. The debugger displays No suspended threads because execution has resumed. Control has now returned to your browser window.

  5. Return to your browser window, and enter your first and last name as prompted, and click Save.
  6. Return to your debugger frame. The debugger is now suspended on your breakpoint.

  7. Expand the Variables subtree.
  8. The firstName and lastName are the values that you just entered. The debugger is currently in the Confirmation phase of form processing.


    Example 3: Form processing confirmation phase

    Figure 44. Example 3: Form Processing Confirmation Phase

Confirmation

Because this form has no confirmation fields, no processing occurs.
Click Continue to begin the Validation phase of form processing.

Validation and Expansion

Because this form contains no Validation expressions, no obvious processing occurs.

  1. Click Continue to skip the Validation phase.
  2. You are now on the Expansion phase of form processing.

  3. Click Step-Into six times.
  4. The debugger is now on the <rule> tag of the <Expansion> of the variables.fullName field.


    Example 3: Stepping into rule processing

    Figure 45. Example 3: Stepping Into Rule Processing

  5. Click Step-Into five times, and the debugger has now stepped into the <rule> element.
  6. Click Step-Into seven times or until the debugger reaches the </Rule> element.
  7. The Last result contains the full name.

  8. Click Step-Into again and processing resumes in the form.
  9. Click Step-Into again.
  10. The top-level variables.fullName has the value of the Expansion expression that just ran. This is top-level entity rather that a child of the variables data structure because during form processing, form outputs are kept in their own temporary form_outputs data structure, with path expressions flattened.

    After form processing, form outputs are assimilated back into the view. In the implicit variables form_inputs and form_outputs, form_inputs shows the unmodified workitem view, and form_outputs shows the output fields that are assimilated back into the view after form processing completes.


    Example 3: Debugger displaying completed execution of variable.fullName

    Figure 46. Example 3: Debugger Displaying Completed Execution of variable.fullName

    In general, form_inputs identifies the view, and form_outputs contains data to be assimilated back into the view. However, not all forms are necessarily tied to a view (for example, active sync forms). The form engine is a general data mapping engine, mapping from form inputs to form outputs. The view handler is responsible for passing the view into the form engine and assimilating the outputs back into the view.

  11. Click Continue.
  12. The debugger reaches the </ManualAction> breakpoint, which was set before when the debugger stepped into the Manual Action. The variables firstName and lastName are the values that you entered. fullName is the result of the Expansion expression that was just run.


    Example 3: Debugger displaying result of expansion processing

    Figure 47. Example 3: Debugger Displaying the Result of Expansion Processing

  13. Click Step-Into five times until <ManualAction... name='displayNameAction'>.
  14. Click Step-Into again. (Click Yes or Always, if prompted.)
  15. Click Continue.
  16. The debugger is now on the Derivation pass for displayNameForm.

Derivation and HTML Generation (Root Component)

To complete the derivation and HTML generate phase

  1. Click Continue to begin the HTML Generation (root component) processing for displayNameForm.
  2. Click Step-Into eight times or until the debugger reaches the </Property> element for subTitle.
  3. Click Continue twice.
  4. The debugger displays the following message:

    No suspended threads because execution has resumed. Control has now returned to the browser window.

  5. Return to your browser window.
  6. The information displayed is the same you entered.

  7. Click Save and return to your debugger frame.
  8. The debugger is now on the Confirmation pass, processing the displayNameForm.

Validation and Expansion

To begin validation and expansion,

  1. Click Continue to begin the Validation pass.
  2. Click Continue to begin the Expansion pass.
  3. Click Continue again.
  4. The debugger is now on the </ManualAction> tag because the manual action is complete. At this point, workflow processing has resumed.

  5. Click Step-Into five times or until the debugger reaches the </WFProcess> tag, indicating that the workflow has completed execution.
  6. Click Continue.
  7. The debugger displays the following message:

    No suspended threads because resumed execution has resumed. Control has now returned to your browser window.

  8. Return to your browser window to observe the workflow process diagram.

Debugging Forms

Forms are processed in a series of passes. Depending on which pass is in progress, certain elements are processed and others are ignored. The Execution stack in the debugger main window indicates the current phase of form processing. The execution stack frame preceding the outermost form always has the name of the pass.

Derivation

During Derivation phase of form execution, the form engine iterates over each field. It also processes each <Disable> expression. For fields whose <Disable> expressions return false, you will also see it process the <Derivation> expression.

Expansion

The debugger iterates over each field and processes each <Disable> expression. For those fields whose <Disable> expressions return false, it processes the <Expansion> expression.

The Expansion processing phase continues to run until either

  1. No more changes occur.
  2. maxIterations has been exceeded. maxIterations is a parameter that is passed into the form engine form Expansion element processing.

By default, maxIterations is set to one. Consequently, the debugger makes only one pass, which is why the Execution stack panel displays Expansion, iteration=0 when expansions are run.

Validation

The debugger iterates over each field, processing each <Disable> expression.
For those fields whose <Disable> expressions return false, the form engine also processes the following:

Confirmation

The debugger iterates over each field, processing each <Disable> expression. For those fields whose <Disable> expressions return false and that also have a confirm attribute, the debugger confirms that the field referenced by confirm matches this field. If the fields do not match, it adds an error to display.errors in the Variables panel.

Assimilation

The debugger iterates over each field and processes each <Disable> expression. For those fields whose <Disable> expressions return false, the debugger processes the <Property> objects of the field's <Display> element.

Note that this phase is typically skipped. It is relevant only for certain forms (such as the login form) that do not contain display.mementos. This is necessary for these forms to reconstruct the HTML components during post data assimilation.

HTML Generation (Root Component)

The debugger iterates over only the top level form and the form's <FieldDisplay> element. The goal of this pass is to build the top-level HTML component. HTML Generation (subcomponents) pass follows immediately.

HTML Generation (Subcomponents)

The debugger iterates over each field. It also processes each <Disable> expression. For those fields whose <Disable> expressions return false, the debugger processes the <Property> elements of the field's <Display> element.

Custom View Processing

Certain views require additional passes over the form. During these passes, the debugger iterates over each field and processes each <Disable> expression.

Working with Anonymous Sources

When stepping through forms, the debugger can identify an anonymous source. An anonymous source is a form (or portion of a form) that is generated on the fly. As a result, an anonymous source does not correspond to a persistent form that resides in the Identity Manager repository. (Examples of anonymous sources include the login forms and the MissingFields form.)

You cannot set individual breakpoints on an anonymous source because they do not reside in the Identity Manager repository and thus lack a unique identifier.

However, you can step through an anonymous source.

To set a breakpoint on all anonymous sources, select the Global tab in the Breakpoints panel. The debugger subsequently breaks any time it encounters a line from an anonymous source. For example, to debug the login form, select this option, and go to the login page.



Previous      Contents      Index      Next     


Copyright 2006 Sun Microsystems, Inc. All rights reserved.