Retreiving an object where xpath constraint is [id = $Object]. What does this do?

0
​​​I was taking a look at a friend’s project and in one microflow he retrieves the object shopping cart with a xpath constraint : [id = $shoppingcart]. I’m not understanding what this does in Mendix. Also the contrary, [id != $shoppingcart], what does this do? Appreciate all the help!
asked
1 answers
4

What it does is that it retrieves from the database the Entity ShoppingCard that has the same id (unique key) as the object  ShoppingCard in memory and stores it in the Object ShoppingCard_2. With this, you can check for the differences between the two and act on them in a Microflow.  In short, you can use it to act on differences of the object in memory and in the database (on disk).

 

After the commit of $ShoppingCard, and retrieving $ShoppingCard_2, they are identical.

 

The != is retrieving a list of all ShoppingCard excluding the one in menory.

answered