![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |
• Actions Actions may contain script, and are invoked as a part of one or more rules in response to a triggering event.
• Validations Validations are scripts that determine you have specified a valid value for a control. When you specify a validation script, you configure it to run either when the form is submitted, or when the value for the control changes.
Business Analysis Capability versus Solution Design Capability To create or modify scripts as shown in this section, you must ensure that the Solution Design capability is enabled. You can change modes by clicking the Capability button on the TIBCO Business Studio toolbar to open the dropdown list, if you are not already in the desired mode:
When setting a control value via the "f" array, the changes are not realized until the whole action script ends. This means that any bindings or rules that are tied to the updating of that control is not triggered until the whole script finishes. Use the setValue() method for the control whose value you are modifying.The "f" array and "p" array functionality is deprecated. You can use control.<control-name>.getValue() instead of using "f" array and use p.get<parameter-name> instead of using the "p" array. See the Table 90, Action for details.Table 90 Action
read-only. This is a data structure that provides access to the context under which the action is invoked. There are 6 fields available within this variable:
• context.control: The control object that was the source of the event that triggered the rule. If the source was not a control, then this field is null.
• context.form: The form object where the event originated.
• context.oldValue: Provides the old value if this is a control or parameter update event.
• context.newValue: Provides the new value if this is a control or parameter update event.
• context.pane: The pane object that was the source of the event that triggered the rule. If the source was not a pane, then this field is null.
• context.record: This field is provided within the computation actions where the destination control or pane is under a collection pane (grid or record pane). The record corresponds to the object in the destination control's (or pane's) parent pane value. For example, when you are computing the value of a control at the 6th row of a grid pane, the record points to the complex object at index 5 of the grid pane value. This field can also be used within validations. Use data.get<param-name> to access the values of form parameters or data fields. This method returns either a primitive value for simple types such as Text and Boolean, or instances of objects when the type is defined in a BOM. For primitive types, data.set<param-name> is also available. Use factory.<package-name> to access factories based on packages defined within the business object models available to the form. These factories allow you to create new instances of classes defined in that package. Use pkg.<package-name> to access package objects based on packages defined within the business object models available to the form. The package object allows you access definitions of Enumerations defined within the package. Use resource.<external-resource-name>.<property-name> to access the localized values from property files. A property file can be added to the Presentation Resources folder and it can be referenced from a form by creating an External Resource in the form. For example: when a property file in the Presentation Resources folder is added as an External Resource in the form with the name resource1, all the properties in that file can be accessed in a user-defined form action script from the object returned by resource.resource1. Thus if the property file contains a property with name name1, the value of this property can be retrieved in a user-defined script as: resource.resource1.name1. read-only. Field value array that accesses the current values of controls in the form. Field values can be accessed using f.controlName. Field values can be updated by assigning a new value to them. Example: f.foo=’newValue’;Deprecated. Use control.cn.setValue(cv) instead of f.cn = cv; and var cv = control.cn.getValue(); instead of var cv = f.cn; read-only. Parameter value array that accesses the inbound values of parameters. p can replace a pane and control. Parameter values can be accessed using p.paramName.Deprecated. Use data.setPn(pv); instead of p.pn = pv; and var pv = data.getPn(); instead of var pv = p.pn; read-write. For actions that are initiated from a control event, this refers to the control object from which the event is initiated. From this, access the form object and other controls and make updates to the state of the form model.Deprecated. Use the new context variable that is available within the script.Table 91 Validation
read-only. Field value array that accesses the current values of controls in the form. Field values can be accessed using f.<control-name>. read-only. Refers to the control object upon which the validation is configured. From this, access the form object and other controls, although no updates to the form model are allowed within a form validation script.Deprecated. Use context.value to get the value of the control being validated. read-only. Within the scope of a validation script, the context variable supports only the following field:context.value: This is equal to the value of the control being validated. If the control is multi-valued, such as a text control with the list setting enabled, then the validation is run once for each value in the list. User-defined validation scripts can retrieve localized values from property files using the resource variable. The resource details provided in Table 90, Action are also applicable for validation scripts.
• Form Open event is published.
2. Form Submit event is published.
3. Form Close event is published.
• Form Close event is published.
1. Form Cancel event is published.
2. Form Close event is published.
2. Control Exit event is published.
3. Control Update event is published.
![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |