0

Hello everyone, I am having a problem with checking if an article already exists in my order. This is how the relevant part of my domain looks. The idea is that an order is made up of plural order_rules, and a order can have different functions/states. order_rules is an generalisation from my product_template. I want to do this in a microflow, so that is the proctuct is already in the order I can increment it. Hope this is enough information, if not ask away (: Peter

asked

Peter Sabel (Zabel)

5 answers

2

Hi Peter,

I understand that you want to check if a list contains an certain object.

For that you can use the activity list operation with option Contains: https://docs.mendix.com/refguide7/list-operation

When it returns true you know the object already is in the list.

Hope that helps.

answered

Jeffrey Draaijer

0

thanks for the quick reaction.

I indeed forgot to include what I did, mostly because what I did wasnt really that substancial.

I am rather new to the XPath's and expressions, I had a brief look into the contains but can't seem to figure it out.

What I tried to do was make a list.

from this I tried searching with an expression in a 'exclusive split'

the expression I used was: $Order_RegelList.contains('$Product/artikelnummer')

I have found different ways of how people use contains, the idea I had here was to look through the list.

And then see if $Product/artikelnummer was in it (%Product is the product that I pass into the microflow, with the intent of placing it in my order. artikelnummer is the artikel number used to identity the product.)

Any thoughs on what I missed/did wrong?

btw, with this expression I get the error 'missing EOF at '.'' which reffers to the period before contains.

thanks in advance for looking at it and trying to lend me a hand

answered

Peter Sabel (Zabel)

0

Here's an update of what I did, I tried to implement a loop that iterates over all the Order_Regels in Order.

But for some reason it never finds a match, I have the linguering feeling that I have missed something obvious.

Although I've searched for a bit, I cant seem to find an example I understand of how to do a microflow in a loop. At least not one that explains what error I made in mine, hope someone can point out my mistake.

I tried to include all relevant information, hope its enough.

answered

Peter Sabel (Zabel)

0

here is the second part of my flow, now with inclusion of a breakpoint in the loop.

answered

Peter Sabel (Zabel)

0

here by also the iterator loop, and the part of my doman model I though would be relevant.

answered

Peter Sabel (Zabel)