on ‎2015 Dec 08 4:47 AM
Some expression types (e.g. Loops) provide an option whereby instead of returning a value they perform an action and return an Action table. In the past I have often used loops to execute rules and in the calling code have discarded the return value. Today I decided this was not a clean solution and so looked at the perform an action.
It is not clear to me whether action means the BRF+ actions (e.g. send an email or start a workflow) or whether it can mean to perform rules.
When I simulated my new loop over a three row table the action table was empty. Can someone explain to me under what conditions I should use Actions and what will populate the Actions table ? Does it refer only to when I do emails or the like in my loop?
Thanks
Cliff
Request clarification before answering.
Hi Cliff,
the action table is a predefined data type in BRFplus (text of length 32) that contains the actions that are executed e. g. in the loop expression.
The action is indeed a BRFplus action like log message or send email
In the screenshot below you can see what happens when you execute a BRFplus action in a loop:
It gets automatically appended to the action table whenever an action is executed. If yopu do not use a action in the loop the table remains empty
When should you use actions? That is a difficult question: I would generally not use actions as the BRFplus just defines the rules but not the consequences of the rules. But that is definitely a subject to discussion
BR
Christian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for that.
Often I execute a loop expression and that contain no actions but executes rules. I don't need to return a value but the conventions of the loop expression demand I have a return value. Typically I just use the built-in Boolean and then in the calling rule I execute the loop and discard the result. I was concerned that perhaps I might not ave been using the tool correctly and that perhaps I should use the action table. You have confirmed that in my case the action table is not appropriate. It would seem that interrogating the return value is totally optional.
Cheers
Cliff
Hi Cliff,
so from my point of view in case your rule has no return value you can also use the action table which will then simply remain empty. This pattern is absolutly ok and does no "harm". I would even prefer that instead of introducing a "pseudo"-return value that you have to clear.
As you stated the interrogating of the return value is optional.
BR
Christian
| User | Count |
|---|---|
| 8 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.