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
38 replies
Subscribers
5 subscribers
Views
11698 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Plug-Ins
Hi all, we are already defining a expression rule by using a doforeach ex
natasav
over 9 years ago
Hi all,
we are already defining a expression rule by using a doforeach expresion. Now we need to redefine it because tis plug is deprecated.
By simple changing it with apply () it does not work.
Could somebody help me with redefinition on it.
Here is the rule:
=if(count(rule!Display_Harm_Details_CDT(pv!ContractDetails.Contract_Serial_Number)),"<br> <i> <b> Contract Harmonization History: <br><br></b> </i> "&ncolumntablestyled( "CCCCCC","FFFFFF", "FFFFFF", {"Version","Harmonization Members","Folder"},rule!ListofVersion_CR(pv!ContractDetails.Contract_Serial_Number),doforeach("AllHarmonizationMembesforVersion",pv!ContractDetails.Contract_Serial_Number,rule!ListofVersion_CR(pv!ContractDetails.Contract_Serial_Number)),doforeach("rule!LinktofolderfromfolderID",pv!ContractDetails.Contract_Serial_Number,rule!ListofVersion_CR(pv!ContractDetails.Contract_Serial_Number))),"")
The problem is when rule!ListofVersion_CR(pv!ContractDetails.Contract_Serial_Number) ret...
OriginalPostID-161216
OriginalPostID-161216
Discussion posts and replies are publicly visible
0
natasav
over 9 years ago
Am sending you the error EVAL:@reason=Invalid lexer symbol found (&)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
PhilB
A Score Level 1
over 9 years ago
Try this one.
natasav2.txt
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
natasav
over 9 years ago
Nope, EVAL:@reason=Invalid lexer symbol found (_) ;(
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
PhilB
A Score Level 1
over 9 years ago
I can't really debug further without being able to run the code. What I've given you is syntactically correct and so should run fine unless you're calling it is some strange way; it looks like maybe this is in a portal report rather than a dashboard? What I suggest you do is take the code and run it separately in a rule to check that it works, replacing pv!ContractDetails.Contract_Serial_Number throughout with a valid serial number for testing.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
natasav
over 9 years ago
When I even pass with a value without calling a Pv it genereated the same error :
error EVAL:@reason=Invalid lexer symbol found (&)
The strange thing is when I just redefine by using apply when there is a multiple version it generate the following error:
Could not process expression function. Process Id 536875556; Expression: =concatenate("
",pv!InitiationChecklist,"
",if(count(rule!Display_Harm_Details_CDT(pv!ContractDetails.Contract_Serial_Number)),"
Contract Harmonization History:
"&ncolumntablestyled( "CCCCCC","FFFFFF", "FFFFFF", {"Version","Harmonization Members","Folder"},rule!ListofVersion_CR(pv!ContractDetails.Contract_Serial_Number),apply(rule!AllHarmonizationMembesforVersion,pv!ContractDetails.Contract_Serial_Number,rule!ListofVersion_CR(pv!ContractDetails.Contract_Serial_Number)),apply(rule!LinktofolderfromfolderID,pv!ContractDetails.Contract_Serial_Number,rule!ListofVersion_CR(pv!ContractDetails.Contract_Serial_Number))),""),"
"). com.appiancorp.process.expression.ExpressionEvaluationException: The expression function 'apply([type 88, value rule!AllHarmonizationMembesforVersion],"C0191/2013",{"0.1","0.2"})' (user=testo10) could not be evaluated: Expression evaluation error : Array is expected as second parameter, but received: C0191/2013.
Maybe it will give you an idea that I shall do. As I can see doforeach() do something more that apply could not do, but am not aware what is , that is why I share it on forum and ask for help.
Thanks for your commitment to help me.
BR,Natasa
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
natasav
over 9 years ago
I just solve it I change the Contract SN with Version and put the version as first variable and now it works.
Thanks for your time and help.
BR,Natasa
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
PhilB
A Score Level 1
over 9 years ago
The error tells you exactly what you need to know; the second parameter for the apply() function is expected to be the array that you wish to loop over. Your first parameter is not an array and so it doesn't work. If you wish to loop over the second parameter, then either the order of the rule inputs must change or you must use partial evaluation, as I've sent.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
PhilB
A Score Level 1
over 9 years ago
No problem!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
<