How to save a value of local variable to rule input.
Discussion posts and replies are publicly visible
under saveinto Parameter use a!save(ri!{varName},local!{localVariablName}). For example a!save(ri!data,local!data).
I'm not using this in interface, I'm doing this in rule expression.
You cannot update the values of variables in an expression rule. Also, you should not be needing it. Rule inputs are for bringing inputs from outside the rule. For returning a value, you can just write it in the expression rule, as the last statement and it should be returned.
I thought that rule inputs are like parameters of the function and local variables are like function variables,.....I have to do some process with parameters and local variables.
Your understanding is absolutely right. And on that track, in a traditional programming lang, you use parameters only to bring in inputs. You use a dedicated return statement to push the output. Same is here. You just avoid return rather you just write that statement.
I'm not facing any problems regarding getting inputs and setting output, My problems is in implementing logic using rule inputs and local variables.
What exactly yoou are trying to get from expression rule. What are your inputs?
My input is a ID......in the expression rule first I will get the value and do some process with that value and then processed data will be my output.
In this case I thought of using local variables for processing (like in traditional programming languages) and once its done I will assign back to output variable.
THERE ARE NO OUTPUT VARIABLES!!!!!
I did get that point. My only point is how to work with both local variables and rule inputs.
Did you see the screenshot?
I did. How to do the other way around.
local!var1 : "sample data",
ri!data : local!var1
You cannot do that. Values of RI cannot be changed. As a matter of fact, values of local variables also cannot be changed once defined.