cancel
Showing results for 
Search instead for 
Did you mean: 

Context versus variables

Former Member
0 Kudos

Hi experts,

I have been reading regarding the Variables, and I have understood that they behave like Context, but the only thing that they cant do is to be use as Preconditions for the rules within a Ruleset.

What else should be considered to define a parameters at context level or at variable level?

Many thanks,

Mario

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member191643
Active Contributor
0 Kudos

Have you considered using XML schema within the rules?

Former Member
0 Kudos

Hi Siddhant,

What would be the benefit of using a XML schema?

Thanks.

ttrapp
Active Contributor
0 Kudos

Good question. AS ABAP has no schema validation - only DTD validation using XML library. This can be useful if you control XML Import and exporting using BRFplus. But I don't see the connection to the context.

BR Tobias

former_member191643
Active Contributor
0 Kudos

When you create the XML schema in the BPM project and give that as the datatype of the Data Object of the Process Context, it will always point to the XML Structure and not hold the structure itself. This makes the process context a bit lighter than holding the whole list structure itself.

Former Member
0 Kudos

Hi Siddhant, So that is related to Netweaver BPM/BRM, not to BRFplus.

former_member191643
Active Contributor
0 Kudos

Yes

ttrapp
Active Contributor
0 Kudos

It is described in SAP Library:

Variables            

If you need to exchange additional data between the function assigned to a ruleset and the rules inside of the ruleset, you can extend the ruleset's signature by adding variables to it. You can use any of the data objects available in the application as variables. Inside of the ruleset, the variables are treated very much like context elements and can therefore be accessed by most of the context-related actions like        Assign Value to Context or        Initialize Context. The near relationship between context data and variables is also illustrated by the fact that for a ruleset, the        Context Overview function displays not only the context data objects of the assigned functions but also the ruleset variables.

Note

Although variables can be used similarly to context data objects, it is          not possible to define a ruleset precondition based on variables. For a ruleset precondition, it is mandatory to refer to context data objects. In contrast to this, it is perfectly allowed to define a ruleset          exit condition based on variables.

There are many reasons to introduce variables:

  • you want to store (temporary results) - this can be important if the calculation is expensive.
  • you will keep the context of a function or ruleset small: a large context resp. signature of a function is difficult to understand
  • variables have a local character and declaring this as variable makes the explicit and so the rule system easier to understand.

Best Regards,

Tobias