Sunday 9 September 2018

Setting Property Values Declaratively


When a user enters a value in a form, related values can also change. Declarative processing allows you to easily configure your application so that the system can automatically update property values such as an order amount. 

Declarative Processing
Declarative processing identifies and maintains computational relationships among properties.
The primary benefit of declarative processing is that updates occur only when triggered in the application.
The system monitors the application to determine when a trigger event occurs.
Declarative rules define a trigger event and resulting action.
For example, when input values change, the declarative process automatically updates related property values.

Declarative Processing
Expression
Constraint
Data Page
OnChange
Trigger
Index

Procedural Processing
Procedural processing depends upon rules — such as data transforms, activities, or user interface (UI) rules — to instruct the application when to look for a trigger event.
Updates are not automatic. When a user enters values, nothing changes until the user submits the form.
The submit process must trigger the data transform to perform the update. To make the changes visible to users as they enter values, you must configure sections to use the data transform to refresh the fields.
 
Procedural Processing Maintenance
An Enter Order form uses a data transform to calculate the total order amount based on the item price and order quantity.
Add a Review Order form to your application, and reuse the fields for calculating the total order amount.  
If you do not add the same data transform to the Review Order form, the total order amount is not updated when the user changes the order quantity from 2 to 3.
Declare Expressions
Declare expressions use source property values to calculate and immediately update a property value.  
The property value updates after a trigger event occurs, such as when a user updates the quantity of an order.



Declarative Networks
A declarative network is a set of interdependent declare expressions.
For a list of declarative networks in an application, select Designer Studio > Process & Rules > Business Rules.
A declare expression can use the target property from another declare expression as a source property.
For example, an Order Total field displays the total value on a purchase order form.
This field uses a declare expression to calculate its target property — the order total — as the sum of the item totals.
The item total is a target value for another expression that multiplies the quantity and the unit price.

Forward Chaining
Expressions either push updates to the target property or pull values from the source properties.
Forward chaining in a declare expression pushes updates to the target value.
A declare expression uses two source properties, item cost (USD400) and quantity, to calculate the target property — item total.
The user increases the number of chairs from 5 to 6. When the user changes the quantity, the expression recalculates the item total.
Forward chaining is the default declare expressions setting.
Backward Chaining
Backward chaining pulls values from the source property or properties.
The target property value does not automatically update when a source property changes. 
An expression using backward chaining only updates its target property when the application references the property by name.
When the target property is referenced, the expression references the source property or properties to update its target.

Backward Chaining Options


Chaining and Performance
Consider where the source property is referenced and how the target property is referenced when selecting a chaining method. 
Forward chaining can slow system performance if an expression uses many source properties that change frequently.
The impact to performance might affect response time.
If you display a property at the end of a process — such as the grand total of an order — backward chaining may avoid unnecessary updates and improve response time.
 
How to Set a Property Value with a Declare Expression
Define a property value with a declare expression steps:
1.Identify the target property when you create the declare expression.
2.Identify the source properties when you define the expression.
3.Specify the chaining direction.
 
Load disqus comments

1 comments: