Posted: 26 Apr 2016 3:45 EDT Last activity: 6 May 2016 13:40 EDT
What is the difference between declare on change and declare trigger? At what point of time declare on change will act?
I had a little confusion between declare on change and declare trigger. i knew that declare trigger will run an activity on save or delete (DB changes) from DB and declare on change will also run activity on change of property values defined on the rule.
As per statement of declare on change, whenever change in any defined property declare on change should fire. But here I have implemented one on change activity with some property, Whenever i changed any value I don't see on change activity.
Have you try to check with the tracer ? You need first to verify if your OnChange rule is called and then if the onchange Activity is called. If none of those two rules are called then maybe you are updating the wrong property on the wrong class ?
Can you share your XML tracer output ? I have to be careful with few things. The activity type for example should be "OnChange" and the activity will not update any activity forcing the OnChange rule to fire again.
I don't know how you check the values been updated but the OnChange rule isn't having auto commit so the changes might be lost if you are not saving the object holding the properties.
Actually i just want to understand that how Declare Trigger and Declare OnChange will work. I knew that Declare exp will work whenever input change, it will update the target property accordingly.
Here my doubt is how declare on Change will works. As per my understanding DExp will work as i explain above and D OnChange will run an activity whenever defined property changes and D Trigger will run activity whenever defined properties commited to DB. Please correct if i am wrong.
I had an requirement, like i had an section which is having different country hub numbers as text fields [like Qatar Hub Number, Oman Hub Number] and Relation Country [Dropdown]. And i had another section in the same screen with field name called just hub number this is also text field.
Requirement: Whenever user select relation country as Qatar and if Qatar Hub Number has an value then Hub Number field should update immediatly with Qatar Hub Number.
Please suggest me which Declare rule is best suitable and weather Declare-OnChage Will Works here or not?
For that, I don't think you need a declare-rule at all. On the source field whose change should cause various target fields to change, in your design view, put in a behavior action that says "refresh section". Then in your activity or data transform rule associated with the refresh action, set the target properties. When the refresh is complete, you should see the updated target properties.
However, if are other places than the user editing the source field where such an update should occur, for example if there are places where you programmatically update the source property and expect the target properties to automatically update, then you may want to consider a declare-change or declare-expression rule. If you do this, you still need your action that says to refresh the section when the user changes the source field, but you may not need to associate an activity or data transform rule with the refresh action, since your declare-change or declare-expression rule should kick in. /Eric
One of the tabs on a decl-expr rule lets you decide whether every time the input properties change, the target property should be re-computed (forward chaining), or whether only when the target property is needed, only then is it computed from the latest values of the input properties (backward chaining).
If your inputs change more often than you need to actually use the target property, then backward chaining may be more efficient for you. On the other hand, if you know that any time one of the input properties change, it is important that the target property be updated, then forward chaining may be better. /Eric