Pageflow and Form Guide

CHAPTER 4

Working with Links

This chapter introduces the links you can use in a pageflow process. It includes these topics:

 
Top of page

About links

The following types of explicit links are supported within a pageflow:

Pageflows also support smart linking. Unlike the other types of links, smart links are not actually drawn on the pageflow diagram.

Links are mutually exclusive   The links in a pageflow process are mutually exclusive. At runtime, the pageflow engine will follow only one link out of a particular activity, even if more than one of the link expressions might evaluate to true.

Links are evaluated in order of precedence   When a particular activity is linked to more than one activity, the pageflow engine uses precedence to determine which link to follow. Each link has a precedence number associated with it. In cases where more than one link expression might evaluate to true, the pageflow engine evaluates the links in precedence order, following the first link that returns true.

What happens when all link expressions return false    You can mark a particular link as the default path to follow out of a particular activity. When all the link expressions evaluate to false, the pageflow engine follows the default link.

 
Top of page

Simple link

SimpleLink

A simple link represents a simple path from one activity to another. Simple links allow you to specify expressions that evaluate to true or false. When the expression for a simple link evaluates to true, the link is followed to the next activity. When the expression evaluates to false, the path is not followed.

Simple links provide an easy way to choose between multiple target activities. When an activity finishes processing, you can use expressions on simple links to determine which activity should be executed next. For example, you could use expressions on Link 2 and Link 3 in the following pageflow to determine whether HTML 2 or HTML 3 would be displayed after HTML 1:

LinkExample1

If you do not specify an expression for a simple link, the pageflow engine automatically moves to the target activity when the source activity finishes. For example, you would not need an expression on Link 2 in this pageflow, since the HTML 1 activity has only one outgoing link:

LinkExample2

A simple link has these properties:

Property Inspector tab

Property name

Description

Link

Name

A unique reference to this link that can be accessed in the flow.

Description

A description of the link intended for the Pageflow Modeler user.

Copy Scoped Paths

Use to copy scoped data to another scope. The scope gets copied after the link is evaluated and before the target activity is executed. The copy scope operation is performed only when the link expression evaluates to true.

For more information    For details on using scoped paths, see the chapter on scoped paths in Developing exteNd Director Applications.

Default

Select to make this path the default. Use if you have multiple links to or from an activity. The default is the path that is used if no other path evaluates to true.

Expression

Use to build a logical expression that evaluates to true or false. If you do not build an expression, the path will evaluate to true and the path will execute.

The expression for a simple link should check the value of a request parameter passed by the source activity.

For more information    For details on specifying an expression, see Creating link expressions.

Precedence

Specify the order in which you want this link to be evaluated. Use if you have multiple links to or from an activity.

Design UI

Design UI properties control the design-time appearance of the link. For more information, see Setting object display properties.

HTML page with a simple link   To initiate a simple link, an HTML page must have a submit button that sets a request parameter to a value specified in the link expression.

For example, if the source activity were an HTML activity, the HTML source for this activity might have a Next button that passes a value of next for the parameter named verb:

  <form name="form1" method="post" action="wsrp_rewrite?wsrp-urlType=blockingAction/wsrp_rewrite">
   <p>Enter your name
      <input type="name" name="name">
      <br><br>
      <input type="submit" name="verb" value="next">
      <input type="submit" name="verb" value="help">
  </form>

The action for the form specifies the wsrp_rewrite token, an industry-standard token defined by the WSRP specification:

  action="wsrp_rewrite?wsrp-urlType=blockingAction/wsrp_rewrite"

NOTE:   This version of exteNd Director does not provide full support for the WSRP protocol. However, support for many WSRP features has been implemented. For example, the wsrp_rewrite token is required in the action for a form.

 
Top of page

Condition link

ConditionLink

Like a simple link, a condition link represents a path from one activity to another. However, a condition link does not have an expression directly associated with it. Instead, it executes a condition macro created by using the Rule Editor. A condition macro executes a set of conditions that contain reusable business logic.

ConditionLinkExample

Condition links evaluate to true or false. When a condition link evaluates to true, the link is followed to the next activity. When it evaluates to false, the path is not followed.

A condition link has these properties:

Property Inspector tab

Property name

Description

Condition Link

Name

A unique reference to this link that can be accessed in the flow.

Description

A description of the link intended for the Pageflow Modeler user.

Copy Scoped Paths

Use to copy scoped data to another scope. The scope gets copied after the link is evaluated and before the target activity is executed. The copy scope operation is performed only when the link expression evaluates to true.

For more information    For details on using scoped paths, see the chapter on scoped paths in Developing exteNd Director Applications.

Default

Select to make this path the default. Use if you have multiple links to or from an activity. The default is the path that is used if no other path evaluates to true.

Condition macro ID

The name of the condition macro XML descriptor, as specified in the Rule Editor.

Precedence

Specify the order in which you want this link to be evaluated. Use if you have multiple links to or from an activity.

Design UI

Design UI properties control the design-time appearance of the link. For more information, see Setting object display properties.

 
Top of page

Button link

ButtonLink

A button link creates a dynamic submit button on a form. It is used in conjunction with Form activities and must have a Form activity as its source:

ButtonLinkExample

At runtime, a navigation button is placed on the rendered form for each button link that comes out of the Form activity.

The primary benefit of the button link is that it allows you to add navigation to forms dynamically. Whenever you want to change the navigation paths from a form, you can simply add links to the pageflow; you do not need to edit the XHTML form.

Button links specify expressions that evaluate to true or false. When the expression for a button link evaluates to true, the link is followed to the next activity. When the expression evaluates to false, the path is not followed.

Flow Link Region control   The button link does not work properly unless the XHTML form associated with the Form activity has a Flow Link Region control. The form needs to have only one Flow Link Region control. At runtime, this control is replaced with one or more submit buttons, depending on the number of button links added to the flow. The engine adds a button to the form for each link that does not already have a submit button associated with it.

Key parameter used to determine which button was pressed   The pageflow engine uses a special request parameter to determine which button the user pressed on the form. This key is called novell_link_key and cannot be changed.

Button link expressions   When you add a button link to a pageflow, the Pageflow Modeler automatically defines an expression for a link. The expression checks to see whether the value of the novell_link_key parameter passed on the HttpRequest object is equal to the name of this button link:

  Request/param/novell_link_key (eq) Button Link 1 [string]

If the expression is true, then this link is followed. Ordinarily, you should not change the button link expression or the name of the button link. If you edit the expression or the name, make sure the value used in the expression matches the name for the button link. Otherwise, the link will not function properly at runtime.

Button text   At runtime, the engine uses the text specified for the Description property as the text for the dynamically generated submit button.

A button link has these properties:

Property Inspector tab

Property name

Description

Button Link

Name

A unique reference to this link that can be accessed in the flow. Ordinarily, you should not change the name of the button link since it is used in the expression for the link. If you edit the name, make sure the value you specify matches the value used in the expression. Otherwise, the link will not function properly at runtime.

Description

A description of the link that is used as the text for the dynamically generated button.

Copy Scoped Paths

Use to copy scoped data to another scope. The scope gets copied after the link is evaluated and before the target activity is executed. The copy scope operation is performed only when the link expression evaluates to true.

For more information    For details on using scoped paths, see the chapter on scoped paths in Developing exteNd Director Applications.

Default

Select to make this path the default. Use if you have multiple links to or from an activity. The default is the path that is used if no other path evaluates to true.

Expression

Use to build a logical expression that evaluates to true or false. When you add a button link to a flow, the expression is created for you automatically. Ordinarily, you should not change the button link expression. If you edit the expression, make sure the value used in the expression matches the name for the button link. Otherwise, the link will not function properly at runtime.

For more information    For details on specifying an expression, see Creating link expressions.

Precedence

Specify the order in which you want this link to be evaluated. Use if you have multiple links to or from an activity.

Design UI

Design UI properties control the design-time appearance of the link. For more information, see Setting object display properties.

 
Top of page

Smart linking

You can use smart linking to reduce clutter in a pageflow diagram. Smart links do not actually appear on the pageflow diagram. Instead, they are resolved dynamically at runtime. Smart linking is particularly useful when many activities link to a common activity. For example, you might want to use smart linking to allow all of the activities within a flow to link dynamically to a common Help page:

SmartLinkingExample

Smart linking applies to the entire pageflow process, not to individual activities within the process. When smart linking is enabled, all of the activities within the flow can optionally use dynamic linking to access common activities.

NOTE:   The pageflow engine also generates dynamic links in the processing of the Exception and CheckPoint activities. Whenever a pageflow includes these types of activities, dynamic linking is used internally, regardless of whether Smart linking is enabled.

Process properties that affect smart linking   Smart linking is controlled by the following properties of the process object:

Property Inspector tab

Property name

Description

Process

Use Smartlinking

Indicates whether smart linking is enabled or disabled for the process. When smart linking is enabled, the pageflow engine identifies the target activity for a smart link and spawns a link from the current activity to the target activity. The spawned link may be cached for later use.

Smartlink Verb

A key that is used to identify the HTTP request parameter whose value will be used to determine the target activity for a dynamic link.

Activities reached through a dynamic link may or may not have outgoing links. In addition, these activities may themselves spawn other dynamic links. In any case, the pageflow engine allows control to return to any of the initiating activities. At runtime, the engine will first try to get a list of explicitly defined links (links specified in the flow diagram) or dynamic links to traverse. If no explicit or dynamic links are available from a particular activity, the engine will try to link back to the last activity executed.

HTML page with smart link   To initiate a smart link, an HTML page must have a submit button that sets the Smartlink Verb request parameter to the name of the activity that should be the target of the link. Note that this is different from the technique used to initiate a simple link, where the value of the request parameter passed must match a value specified in the link expression.

Here's an example:

  <form name="form1" method="post" action="wsrp_rewrite?wsrp-urlType=blockingAction/wsrp_rewrite">
   <p>Enter your name
      <input type="name" name="name">
      <br><br>
      <input type="submit" name="verb" value="next">
      <input type="submit" name="verb" value="help">
  </form>

The action for the form specifies the wsrp_rewrite token, an industry standard token defined by the WSRP specification:

  action="wsrp_rewrite?wsrp-urlType=blockingAction/wsrp_rewrite"

NOTE:   This version of exteNd Director does not provide full support for the WSRP protocol. However, support for many WSRP features has been implemented. For example, the wsrp_rewrite token is required in the action for a form.

XHTML page with smart link   An XHTML page might initiate a smart link in the following manner:

  <xforms:submission 
     action="?verb=help"
     id="help"
     method="post"/>

When the form is rendered at runtime, the action attribute is marked up automatically, at which point it looks like this:

  <xforms:submission 
     action="wsrp_rewrite?wsrp-urlType=blockingAction&amp;verb=help/wsrp_rewrite"
     id="help"
     method="post"/>

You can specify the fully marked-up syntax (as shown above), but this is not necessary, since the complete syntax is generated automatically.




Copyright © 2004 Novell, Inc. All rights reserved. Copyright © 1997, 1998, 1999, 2000, 2001, 2002, 2003 SilverStream Software, LLC. All rights reserved.  more ...