Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 3 Tasks : Working with Bindings, Actions, and Rules

Working with Bindings, Actions, and Rules
This section explains how to set bindings, actions, and rules.
Setting Bindings
For an overview of bindings and their use in TIBCO Business Studio Forms, see Bindings. For most controls, many properties on the Properties View can be initialized by an inbound parameter or expression.
The properties that may be initialized in this way are identified by the presence of a Add Binding icon to the right of the field where the property’s value is set.
As explained in Setting Bindings, you can add a binding in one of the following ways:
From the General Properties tab for a control
From the Mappings tab of the Properties view for the selected element
You can also set bindings from the Properties tab of the properties sheet for some controls, such as hyperlink.
Add a Binding from the General Properties Tab for a Control
The General tab of the Properties View for a control may contain the binding icons indicating that a parameter or expression can be bound to any of the following properties: Label, Hint, Value, Visible, Enabled, and Required, which each can have only one binding or computation action.
The value property can have multiple bindings and/or computation actions. For details about these properties, see Properties View for Controls.
Figure 81 General Properties Tab for a Control with No Bindings
To add a binding:
1.
The Select Type dialog appears.
2.
Select the radio button Create a binding for this property.
3.
Click Next.
4.
Show controls and panes   If this is not selected, then only parameters will be shown in the Matching and selected items pane.
Show unbound items only   If this is selected, then any properties that already have bindings will not be shown.
This text box allows you to type in a filter expression that will restrict the items shown in the Matching and selected items pane. Names, labels, and property names are matched by the filter.
../pane/control/property
For example, select the parameter (CustAge), which will update the Guardian Name if the customer age is less than 21.
In the section property of control, the three binding directions are displayed. The binding types that are available for use are enabled, while the ones that are not available appear as disabled (grayed out).
updates property of control.
is updated by property of control
synchronizes with property of control
If the selected property can be bound the way it was selected, the Finish button in the bottom of the diagram is enabled.
5.
Figure 82 Multiple Bindings Added
Add a Binding from the Parameter Dialog
The General tab of the Properties View for a parameter contains a binding icon indicating that a parameter can be bound to a control.
To add a binding:
1.
The General Properties tab for the value Name is displayed.
Figure 83 General Properties Tab for the Parameter
2.
The Select Type dialog appears.
3.
Select the Create a binding for this property radio button and click Next.
4.
5.
Add a Binding from the Mappings Tab
The Mappings tab of the Properties view for a selected element provides a comprehensive view of all the bindings and computation actions. You can view, edit, and create bindings from the Mappings tab. Refer to Working with the Mappings Tab for further details.
Remove a Binding
Click the Remove button in the Edit Binding dialog.
The binding will be removed and the icon in the general tab.
Setting Actions
For an overview of actions and their use in TIBCO Business Studio Forms, see Actions.
Add a Script Action Using the Outline View
In the Outline View:
1.
Right-click the Shared Actions task.
Figure 84 Adding a New Script Action
2.
In the pop-up menu, select New Script Action.
3.
See Scripting for a discussion of the variables available in this script.
4.
Click Finish.
The new script action appears in the Outline View as a shared action.
Add a Computation Action Using the Outline View
In the Outline View:
1.
Right-click the Shared Actions task.
2.
In the pop-up menu, select New Computation Action.
3.
Note: Do not use a return, since you are not writing a function.
4.
Click Finish.
The new script action appears in the Outline View as a shared action.
Edit an Action
You can modify script and computation actions that are shared by selecting them in the Outline View and specifying the changes in the General Properties window for that action.
Setting Rules
For an overview of rules and their use in TIBCO Business Studio Forms, see Rules.
Add a Rule Using the Outline View
To add a new rule in the Outline View, do the following:
1.
2.
3.
In the Rule Details page of the New Rule dialog, specify data as explained in Table 11..
4.
Click Next to define the rule.
In the Rule: Pick Events page, use the button to add events or delete the button to remove events associated with the rule.
Figure 85 Rule: Pick Event Page
5.
The Select Event page , which is used to choose the events that trigger a rule, opens with a dialog Select Item.
Figure 86 Select Event Page
6.
Click the event you want to associate with the rule, such as update property. You may select multiple events by holding down the control key as you select the events.
7.
Click OK to confirm the selection.
You can add multiple events to the rule. You can also delete any of the previously associated events from the list.
8.
To define an event, click Next in the Rule: Pick Events page.
The Define Actions page opens.
Figure 87 Define Actions for the Rule
 
9.
10.
Pick an Existing Action
To pick an existing action:
1.
Click the Browse icon (...) next to Pick an existing action.
This will allow you to choose one of the system actions, or to select one of the custom shared actions defined in the form.
2.
In the Select Item dialog, select an action from the list of Matching and selected items and click OK.
A new row appears in the table with the details of the action.
3.
Click Finish.
The Define actions dialog appears.
Figure 88 Define Actions Dialog for the Rule
4.
In the Define actions dialog, you can further configure the new action by selecting (or clearing) the check boxes to enable (or disable) the action, or to designate the action to be shared.
5.
The actions will execute in the defined order when the rule is triggered by one of its events.
6.
Click Finish.
Create a New Action
To create a new action:
1.
Click the Create a New Action radio button.
Two additional radio buttons become available: Script Action and Computation Action.
2.
3.
Click Next.
4.
If you selected the Computation Action, specify the data as in Table 13.
5.
Add a Rule Using the Rule Wizard
In addition to adding new rules through the Outline View, you can also create a computation rule (a rule with a computation action) directly from property you want to create a computation rule for. To do so, follow these steps:
1.
Click the Add a binding or rule icon next to a property, such as for the Value property of the Name control.
2.
In the Select Type dialog, select the Update this property using a Computation Action radio button.
3.
Click Next.
In the Provide Expression dialog, provide the script. Note that in this case, there is no option to select the destination, since the destination is implicit on where you are adding the computation action.
4.
Click Next.
In the Events Configuration dialog, use the button to add events or the button to remove events associated with the rule.
5.
The Event Picker, which is used to choose the events that trigger a rule, opens with a dialog Select Item.
6.
7.
Click OK to confirm the selection.
You can add multiple events to associate with the rule. You can also delete any of the previously selected events from the list.
8.
Click Finish when you are done configuring the rule.
When you have finished a rule icon appears next to the property and allows easy editing of the compute action.
Additionally, the rule appears in the Outline View and can be edited as a regular rule.

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved