Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Verified Answer
+1
person also asked this
people also asked this
Replies
22 replies
Subscribers
7 subscribers
Views
8412 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
User Interface
with() declarations refresh on any user action regardless of connection
marky
over 8 years ago
Hello:
I have noticed that anything declared in a with will get refreshed on any action the user takes on an interface, even if the with is unrelated to the action (such as a summary section at the top of the screen and a comments text box at the bottom, with no connection between the two).
Is this expected behavior for Appian?
It seems like with declared variables/rules/components should only refresh if one of the input variables changes.
If you see in the attached interface, changing the value in the textbox is refreshing the with variable, even though they are not related.
OriginalPostID-251823
example_interface.txt
Discussion posts and replies are publicly visible
Top Replies
marky
over 8 years ago
+1
I already know how to refactor the code, so thank you for the suggestions. The problem is that I doubt more than 10% of Appian developers actually understand the way with() scope works. So I ask which…
0
rodgraham
Certified Lead Developer
over 8 years ago
That is the expected behaviour in a with
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
+1
Jacob Cohen - Project Leader - Macedon Technologies
over 8 years ago
This is expected. You can find more about with() here:
forum.appian.com/.../Evaluation_Functions.html
Cancel
Vote Up
0
Vote Down
Sign in to reply
Reject Answer
Cancel
0
sikhivahans
over 8 years ago
@marky To the best of my knowledge, a connection isn't required and the code present in with() evaluates for each and every user interaction (with a component that has saveInto, that is, editable) carried out anywhere in the entire interface. This is the expected behavior (and in fact the architecture) of SAIL.
If you can pick up an example from the documentation at https://forum.appian.com/suite/help/16.3/SAIL_Design.html#saving-input-into-variables under the section named 'with() and load()' you can observe that the variable named 'local!withVariable' refreshes upon interaction with 3rd and 4th(textField and button) components as they have 'saveInto'(or are editable).
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
gautams778
Certified Lead Developer
over 8 years ago
yes, This is expected behavior of with() annotation.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
marky
over 8 years ago
This seems extremely wasteful, as things will be re-evaluated regardless of whether they should be re-evaluated, causing extra performance overhead on every single user action. We noticed that completely unrelated functionality was re-triggering query entities on every user interaction, which lead to our DB Connections hitting the limit during load tests. I guess I will try to get a support ticket opened to change this in a future release.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Omkar K
over 8 years ago
Yes, I agree with you Mark. Let me know if you get more details from the support ticket.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Luke Schurman
Appian Employee
over 8 years ago
I think you will find this link helpful:
forum.appian.com/.../SAIL_Performance.html
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Josh
Certified Lead Developer
over 8 years ago
@Mark you can refactor your code to use load() variables instead of with() variables and target reevaluations for certain variables based on certain actions
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
marky
over 8 years ago
That's a good description of the way things currently work, but I see lots of room for improvement: 1) with should not re-evaluate for unrelated things. 2) When an expression rule is called multiple times by apply, each instance of the expression rule should have its own unique load variables and not share load variables. 3) The entire interface should not being transmitted for small changes to the interface.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Jacob Cohen - Project Leader - Macedon Technologies
over 8 years ago
Mark, take a look at a!applyComponents. That should take care of number 2.
forum.appian.com/.../System_Functions.html
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
>