I am trying to build an AMR management logic. The flow starts with a Source Event that listens to the input event in the AMRs list.
They move to a pull from list activity from a task list. In addition to the distance label expression, there is the Zone label that is given by the token that provided the input. This label specifies a zone as a concept with a string. I have given the pull the label Container token.Container.
My question is about the next activity of the pull from the AMR list (specific to TE). In this list, there is also a Zone label with the same criteria as the previous one. The values of this label can be BL and ZI.
The selection criteria for the AMR should be as follows:
If the token that does the pull has its value token.Container.Zone=ZI, the AMR that should attend to this query are those that have ZI. If there are no AMRs with the ZI label, this task will be attended by one with the ZB label, prioritizing by distance in both groups.
If the token that does the pull has its value token.Container.Zone=BL, the AMR that should attend to this query are those that are closest, only prioritizing distance.
I have prepared this query but it gives me an error.
I have created a Custom Code in the query field of the pull from list of AMR to try to convert everything to a string. This field could only be passed text or we could resolve the query in the code and pass the selected value (value=AMR).
I have to share it as an image because the website's security blocks it even when I insert it as a code block.
When I run the code, I receive the following in the output console as the result of the debug print:
In the System Console, I receive:
time: 0.000000 exception: Exception caught in start() of activity Desarrollo lógica|código extracción en ZI/Pull from List in process flow "ProcessFlow". Continuing throw...
time: 0.000000 exception: Exception caught in Executive::processeventinlist().
In the Compiler Console, I receive this:
syntax error, unexpected exists
Invalid WHERE statement
Thank you in advance for your help.