Hello All,
I have a 2 column layout. in left section I have a tree with multiple node like shown in below.
In right section I have to display the selected node's interface. For example if "Interface1" node is clicked then it should call an expression rule which returns the interface name to be loaded for that node. Now as expression rule returns string value, I am not able to render that interface in right section.
Please note - Each node has associated interface and entire list is maintained in records. On tree node click that expression rule finds the interface name for selected node.
Kindly help if there is any other way to achieve this?
Thanks in Advance.
Discussion posts and replies are publicly visible
Not sure what your use case is here, but an expression can return a reference to an interface which you can then call from your other code.
docs.appian.com/.../expression-advanced-evaluation.html
And, without applying some known, but not recommended black magic, you cannot store such a reference in the database. Which, I think, is not an issue, because you have only a finite number of options. A simple expression that maps some string-identifier to the actual reference to the interface.
Hi vijayan544557 So, you are storing categories and interfaces related to those categories in one record?And when one node is clicked you are calling an expression right, can you send the expression rule code for reference. Like on what basis that expression rule is fetching the interface name.If you need another approachIf there are some static values for nodes, you can handle them using choose condition based on the node selected.
Thanks for your reply Stefan.
Let me explain the usecase here - We have a requirement of generating tree structure and selection of tree node, show the respective interface on the right side of the same interface. (Similar to our windows explorer)
Our current Interface structure -> 2 Pane layout. In left side pane showing the tree structure and in right side pane want to show the respective interface of selected node.
Data in DB - Below is the data available in DB.
and so on.
Now as I mentioned above we are generating tree structure in the left side of pane using Group and Nodename columns. Now once the tree is generated and anyone clicks on the node, its respective interface need to be taken from DB and rendered in the right side pane.
Now when we try to get the selected node's interface, it returns name of the interface (string data type). Which doesnt help.
I need rule!Interface1(). Not the string value.
Please suggest how to achieve this functionality. I do not want to hard code anything in using condition, which can be one of way. I just want to keep referencing to the DB data for interface name.
Any optimal way to achieve this?
Thanks Teja for your reply. Yes, I am storing categories and interfaces related to those categories in one record.
Answer to second question - I already have all data available on that interface using records, so as of now no need of any expression rule to get the interface name. As soon as the node is clicked I am storing its interface name of that node, in one local variable. It gives me a string value and not sure how to convert that into an interface value.
As I mentioned above, you cannot call an interface by its name. But, as all your interfaces need to be built, you can create an expression that maps a name (as string) to a reference to that interface.
Edit: Yes, I know that using some plugins and other things, we can call a function just by its name, but that's not a design I would want to recommend!
Hi Stefan, can you please elaborate in detail? I can check if we can take that route or not.
Plugin: Content Tools
Function: getrulereferencebyname
Code could be: getrulereferencebyname("YOU_RULE_NAME")()
But keep in mind, you will still have to develop each individual interface. Trying to call them by name, just for the sake of being able to, is a questionable design decision. At least in my opinion.
Thanks Stefan! this helps.