a!localVariables( local!chooseValue:1, local!buttonChoice, a!formLayout( label:choose(local!chooseValue,"KONE Maintenanence System","New User Registration System","Update User System","Delete User System"), contents:{ a!radioButtonField( label: "Please Choose", labelPosition: "COLLAPSED", choiceLabels: {"Registration", "Update","Delete"}, choiceValues: {"Registration", "Update","Delete"}, value:local!buttonChoice, saveInto: {a!save(target:local!buttonChoice,value:save!value), if(local!buttonChoice="Registration", a!save(target:local!chooseValue,value:2), if(local!buttonChoice="Update", a!save(target:local!chooseValue,value:3), if(local!buttonChoice="Delete", a!save(target:local!chooseValue,value:4), {} ) ) ) }, choiceLayout: "STACKED", validations: {} ), a!imageField( label: "Image", labelPosition: "COLLAPSED", images: { a!documentImage( document: cons!KONE_IMAGE01 ) }, showWhen:local!chooseValue=1, size: "LARGE", isThumbnail: false, style: "STANDARD" ), choose(local!chooseValue,{}, rule!KONE_Development_Insert_Interface( backupuseraudit:rule!KONE_Development_backupuseraudit_castType(), userrole:rule!KONE_Development_USER_ROLE_castType(), ), rule!KONE_Development_UserUpdate_Interface( userrole:rule!KONE_Development_USER_ROLE_castType(), backupuseraudit:rule!KONE_Development_backupuseraudit_castType()), rule!KONE_Development_deletefromuserrole_Interface( userrole:rule!KONE_Development_USER_ROLE_castType(), csetender:rule!KONE_Development_CSE_TENDER_castType(), cseservicecatalogue:rule!KONE_Development_CSE_SERVICE_CATALOGUE_castType(), pricingaudit:rule!KONE_Development_PRICING_AUDIT_castType(), csepriceapprovalphase:rule!KONE_Development_CSE_PRICE_APPROVAL_PHASE_castType(), priceapproval:rule!KONE_Development_PRICE_APPROVAL_castType(), csetenderphases:rule!KONE_Development_CSE_TENDER_PHASES_castType(), cseservicecataloguesubtask:rule!KONE_Development_CSE_SERVICE_CATALOGUE_SUBTASK_castType(), cseservicecataloguephases:rule!KONE_Development_CSE_SERVICE_CATALOGUE_PHASE_castType(), cseservicecataloguesubtaskphase:rule!KONE_Development_CSE_SERVICE_CATALOGUE_SUBTASK_PHASE_castType(), backupuseraudit:rule!KONE_Development_backupuseraudit_castType(), backupuserrole:rule!KONE_Development_BACKUP_USER_ROLE_castType(), ) ) } ) )
but error report as follow:
Interface Definition: Expression evaluation error [evaluation ID = bda39:2247c] in rule 'kone_development_insert_interface' : An error occurred while executing a save: Expression evaluation error: The save target must be a local variable that does not refresh on every evaluation or on an interval, a process variable, or a node input (or a rule input passed one of those three), but instead was: [recordid=5, koneusername=lixiaolong, firstname=li, lastname=xiaolong, email=lixoalong@.com, role=Customer HQ branch CSE Engineer, branch=CNGY, region=SO, managerrole=Customer HQ branch CSE Engineer, language=Mandarin, active=1, celevel=1, telephonenumber=12345678901, exceptinlcselibrryviewright=1, updatetime=9/27/2021 10:45 AM GMT+00:00, reason=Insert, backupby=, backupon=, ticketnumber=]
why??
Discussion posts and replies are publicly visible
Because you pass the result of an expression call directly into the rule inputs in line 42. Appian can not store a value into that.
rule!KONE_Development_Insert_Interface( backupuseraudit:rule!KONE_Development_backupuseraudit_castType(), userrole:rule!KONE_Development_USER_ROLE_castType(), ),
Storing these values in local variables and then pass them, might help.
May I know which way i will not let it store values?
cast( 'type!{urn:com:appian:types:KONE}KONE_Development_userrole', a!queryEntity( entity: cons!KONE_Development_userrole_Constant, query: a!query( pagingInfo: a!pagingInfo( startIndex: 1, batchSize:-1 ) ) ).data )
My rule write like this
You can not make a queryEntity into something that can store data. You need a local variable or rule input to store data in interfaces.
"May I know which way i will not let it store values?". I do not understand this question. In that called interface you have a saveInto to store data somewhere. If you do not want to do this, remove the saveInto and the rule input.
I just made it by your hint, by the way, why it have to let the rule save into local variable instead then put it in parenthesis but can never let rules put into parenthesis directly since they are almostly the same??
I do not understand. Please elaborate.