Defining a temporary variable at rule level in RMA

I need to define a temporary variable of type String,int or datetime for each rule in RMA. (Generic Ruleset template) I am able to declare the variable in a rule but how to make it accessible to condition/action part of the same rule? I want to make it available in the dropdown of a LHS condition part. (e.g if there are 2-3 temporary variables declared above then user will be able to assign those values to some other object properties by selecting one of the dropdown values.)

You can use a variable template to define variables explicitly in your ruleset, the same way you can define rules using a rule template. Using this approach, you can assign name, type and initial value to your instances using value holders.

You can also wrap your rule template definitions inside ruleset items template definitions. A ruleset items template needs to be contained in a ruleset template, just like a rule template, but a ruleset items template can hold several different SRL entitites. This means that you can define additional variables/rules "behind the scenes".

To access your ruleset variables, use an SRL Entities Provider, and point it at your ruleset (there is an argument to the provider that lets you limit the scope of the provider to one specific ruleset). You can also filter on SRL type etc.

ok we can set Ruleset level variables but can we set it at rule level and use it in the condition or action part of the same rule. so that temporary variable will be available only to that specific rule.Is it possible?

A variable is either a global variable (available to all rulesets/functions etc), a ruleset variable (available to all rules in a ruleset) or a local variable (available only to the action part of the rule in which it is defined).

What I have done in the past is to use the concept that Jostein mentioned about making the variable part of a template that gets created for each rule. Then, use a value holder (probably similar to what you are using to crate a unique name for each rule) to give the variable a unique name related to the rule. Then just reference that variable using the name with the value holder.