How to selectively Pull from from using Label Array?

How to selectively Pull from from using Label Array?

jkhedekar
Enthusiast Enthusiast
123 Views
5 Replies
Message 1 of 6

How to selectively Pull from from using Label Array?

jkhedekar
Enthusiast
Enthusiast

[ FlexSim 23.0.15 ]

I have 2 lists. One which keeps track of parts it has created. It has a label column called PartName.

Second list is parts requested by operator which also has a label column PartName.

When the a value it pushed in second list as a request by operator it triggers the flow.

The flow starts with a pull request from first list which pulls one value and Assign to token.requestpull

The flow moves to a batching step where I batch 3 token with a max wait time of 60 sec. I also track how many were batched before getting released

In batching process flow for label aggregation I have

From Label - requestpull.Partname

To Label - requestpull

Aggregation - Make Array


Then I want to pull from first list. The request quantity of pull from first list is the number of token I have batched which is store in label batchCount (this works right) I have puller token for second list as pullerrequest

For query I only want to select parts which are requested by operators so

WHERE PartName IN pullerrequest.requestpull


This however does not work and shows sql query mistake. Where am I making a mistake?



0 Likes
Accepted solutions (1)
124 Views
5 Replies
Replies (5)
Message 2 of 6

joerg_vogel_HsH
Mentor
Mentor

Try IN clause argument with brackets.

pullerrequest.requestpull datatype must be an array. Elements of this array must match with PartName. Print arguments into an output console for testing.

look for examples in https://www.w3schools.com/sql/sql_in.asp

Message 3 of 6

jkhedekar
Enthusiast
Enthusiast
Got a work around but it works now. Thanks!
0 Likes
Message 4 of 6

Jeanette_Fullmer
Community Manager
Community Manager
Can you share your solution and accept it?
0 Likes
Message 5 of 6

jkhedekar
Enthusiast
Enthusiast
Accepted solution

You can create assign a label called NameArray and in values select Array and Set Array. In that portion added the following as code.

Array values = Array(arraySize);

for(int i=1; i<=arraySize;i++){
values = token.requestpull.PartName;
}


return values;



0 Likes
Message 6 of 6

jkhedekar
Enthusiast
Enthusiast
I don't think I can accept my own answer, I did it though
0 Likes