cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with passing element value

former_member184588
Active Participant
0 Kudos

Hi,

I would like to read a value in one action and pass it to another question.

The element is defined as boolean (not bound to data dictionary) in the data elements. The actions (call procedure) are in two different rule sets. In each rule set I have the element in the list of used variables in the rule set. Both use the same function. When I debug the program the export of my boolean (as Value X) looks good. But the values is not working as importing parameter for the next procedure call. I added the element in the method signature and added the parameter to the procedures.

But when I run the program it seems as if there is some additional binding necessary that I don't know where to do.

Any ideas?

Regards, Vanessa

Accepted Solutions (1)

Accepted Solutions (1)

christianlechne
Active Contributor
0 Kudos

Hi Vanessa,

you have to distinguish two types of contexts in BRF+:

  • The (global) context that is defined on function level on the tab "signature". All elements that are defined there are available in the rulesets that are assigned to the function
  • The variables that are defined on ruleset level that enhance the global context by additional elements. These elements are available only within the ruleset and its rules and expression

So if you want to transfer the data/results from one ruleset to another within the same function the element has to be available in the context of the function.

The flow would then be:

  • Ruleset 1 -> Call Procedure 1 and assign result to the element of the context
  • Ruleset 2 -> Call Procedure 2 and use the context variable that you filled by the procedure call in ruleset 1

Hope that helps

BR

Christian

former_member184588
Active Participant
0 Kudos

Hi Christian,

that sounds really good and I think this is the point I don't understand.

- There is my boolean field "flag"

- I have the ruleset Convert (that takes an import parameter and fills some fields) There the field flag gets is set as export parameter.

- I have the ruleset Create (that creates based upon the values in the convert)

Here I need the value for flag.

Maybe I used the flag at to much places. Is it right that I don't need the field flag as variable in the ruleset? And I just need it in the global context and the context of my function?

Which context (level) are you talking about in the ruleset 1 and 2? Is it the global or the one from the function or some other context.

Thank you for bringing some light into the darkness... and sorry that the darkness is really dark.

Regards, Vanessa

christianlechne
Active Contributor
0 Kudos

Hi Vanessa,

so you have to  do the following steps:

  • Put the "flag" into the context of the function (then it is available for all rulesets)
  • Set this "flag" as exporting parameter in your ruleset Convert

Now the "flag" is assigned with an value when the procedure is called

Afterwards you have the "flag" with its value from the ruleset convert available in the ruleset create

If you have used variables in your ruleset up to now, remove them as you do not need them anymore

Let's see if the darkness became a bit brighter now 🙂

BR

Christian

former_member184588
Active Participant
0 Kudos

Hello Christian,

you switched the bulb on, thanks a lot. I was just too stupid to realize that I was using the wrong variables. But everything makes sense now.

Greetings and thanks you,

Vanessa

Answers (0)