Gateway Expression for a collection of values

1
0
-1

Hi, i have built a job where

1) In the first form, the user insert a collection of data
- Name (text)
- Last Name (Text)
- Flag field (boolean)

2) i would like to insert a gateway after the first step, where the condition should check if all of the flag field that belong to the collection have "true" value or not.

I tried something like that as expression for gateway:

myprocessvariablename.mycomplexfieldname.mybooleanfieldname == true

but it does not work..

2 answers

1
0
-1

unfortunally it does not work, and i can see lot of errors sin the script :(

Comments

Submitted by Sean McP on Tue, 05/09/2017 - 12:03

1) please don't add an answer as a comment, it screws thing up.
2) there are lots of errors? what are they? Why didn't you say what they were?
3) it works on my system...what errors are you getting...

1
0
-1

I think you have to explicitly read the data from the BDM in script via DAO and then return the value true or false to the condition. Use the pencil on the condition and select script to write the necessary code to get the BDM.

regards
Seán

PS: While this may not be the complete answer you're hoping for, it does indicate a possible solution, please mark as resolved.

Comments

Submitted by claudio.taragnolini on Tue, 05/09/2017 - 06:34

Do u have some code as starting point?

Submitted by Sean McP on Tue, 05/09/2017 - 07:43

Really? ;)

  • you have your gateway with two lines.
  • One must be set as default
  • for the other line Use Expression
  • Click the pencil and select script

add the following (you must find your own BDM):

import com.company.model.exempleDmande;

exempleDmande tf = exempleDmandeDAO.findByPersistenceId(0);

if(tf.getSolde() == true){
        return true
}
else{
        return false
}

NOT Tested so not totally sure it will work, post back your solution if you find it is different.

regards
Seán

Notifications