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
8 replies
Subscribers
9 subscribers
Views
7558 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
Execute rules dynamically
Dhiraj Kumar
over 8 years ago
Is there a way to execute rules in appian dynamically ?
Example execute ( <<rule Name>> , Map of parameters (<<key>> , <<Value >> ) ) .
Instead of static definition and checking rule name we want to dynamically invoke rules . So if i have the name of the rule i want to call the rule at run-time instead at compile time .
If there a handle on the uuid and we can execute the rule then it is possible .
OriginalPostID-268793
Discussion posts and replies are publicly visible
0
Poorna Guduri
A Score Level 1
over 8 years ago
Hi Dhirajk, I don't think there is a direct approach for the same. But I have come across similar situation where I went for hierarchy of rules. Meaning that, I have created a top level rule which will have a Text type rule input parameter - for rule name and list of parameters (the list should cover all the parameters for all the expected rules that may be passed). It is like calling a rule by name but within another rule but with this approach we would need to know the list of parameters before hand. It is not the exact dynamic functionality that fits as a solution to your problem statement.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Josh
Certified Lead Developer
over 8 years ago
Do you need to pass in the text name of the rule or can you pass in a rule reference? If it is the latter you can pass a rule "rule!myRule" into a sub rule that has an Any Type parameter. In the sub rule you would invoke the dynamic rule by calling "ri!myDynamicRule()"
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Dhiraj Kumar
over 8 years ago
@poornah as you correctly said that would be a purely static way of doing it
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Dhiraj Kumar
over 8 years ago
@joshi , we need to pass the name . i can write a plugin as well if required but need a handle on the dynamic function
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Poorna Guduri
A Score Level 1
over 8 years ago
@Dhiraj, It looks like you may need to look into the Public Java API provided by Appian.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
akshayan
Certified Lead Developer
over 8 years ago
Take a look at evaluateExpression method in ProcessDesignService at
docs.appian.com/.../
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Poorna Guduri
A Score Level 1
over 8 years ago
@Dhirajk, Below function might be helpful as akshayan mentioned -
docs.appian.com/.../ProcessDesignService.html
Also you might need to build supporting classes for the result-set manipulation (I mean, to make the result-set to be in an understandable format).
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
jessek2441
over 8 years ago
Exercise caution when entangling rules like this under the presumption that it saves any time or creates a more reliable application. Dynamic calls of methods/rules based upon, effectively, a map of maps will cause indeterminate behavior and simply move your coding efforts from calling static rules to dealing with a map of maps.
I also wouldn't want to be the developer on the next iteration of the app. The large majority of the debugging effort will go into figuring out what rules & arguments are being called - leading to likely mis-characterization of root causes of bugs.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel