Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
4 replies
Subscribers
7 subscribers
Views
1523 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
I have an expression rule that implements a common component that is going to be
mikej117
over 9 years ago
I have an expression rule that implements a common component that is going to be called from multiple forms. While the bulk of this component is common, there are some context-specific parts to it, such as custom validation, which depends on the context.
What I would like to do is to pass some custom validation code into the common component rule. What is the best way to go about doing this?
OriginalPostID-150902
OriginalPostID-150902
Discussion posts and replies are publicly visible
Parents
0
Conor Cahill
Certified Lead Developer
over 9 years ago
You could pass in an integer or string that tells the common component which form you are calling it from. This way you can have all the custom validation in the common component, and you just conditionally check some of it depending on the form-type parameter that was passed to it.
You won't be able to access and use the rule's local variables from outside the rule, so you'd have to implement all the constraints within the rule. My solution allows you to choose which constraints you'll actually validate.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
Conor Cahill
Certified Lead Developer
over 9 years ago
You could pass in an integer or string that tells the common component which form you are calling it from. This way you can have all the custom validation in the common component, and you just conditionally check some of it depending on the form-type parameter that was passed to it.
You won't be able to access and use the rule's local variables from outside the rule, so you'd have to implement all the constraints within the rule. My solution allows you to choose which constraints you'll actually validate.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data