Showing results for 
Search instead for 
Do you mean 
Solved! Go to solution

Pulling MU's from buffer depending on its attribute

Hi everyone, 


I encountered a problem that couldn't solve myself, need your help/ideas. 


To begin with, here is my setup. 


MU.Order attributes (SKU, Quantity, Duedate)

Inventory Table columns (SKU, Amount)


Simtalk logic should be like this:

1. Pull MU's from buffer/sorter depending on its attribute (duedate-3days)

2. Check MU.quantity with corresponding amount in the inventory table. If amount<quantity for the same SKU, then send MU to shipment. If not wait until amount<quantity. 

3. Call this method everyday to check all the MU's in the buffer. 


Can someone help me to build this logic? Thanks in advance. 




Re: Pulling MU's from buffer depending on its attribute

Hi Orxan,

You have to make your own experience, but I want to show the beginning.


It seems that you want to model a non-termination simulation. Therefore the Source with a delivery table is not a good way. I recommend to use a Source with Time of creation Interval Adjustable and MU selection Random. The method of inventory management must be called every day (your point 3). This is possible with the object Generator (Toolbox Information Flow). If you want to consider only the orders which are described in the tablefile SalesOrder you have a terminating simulation. Then you configuration of the Source is correct. But you want to simulated 90 days. How is that possible?


The method sort as an exit control of the Source is not necessary, since there is a corresponding Exit Strategy MU Attribute.


The second column of the tablefile WInventory should have the data type integer. The purpose of that tablefile is not clear. Please explain point 2 more detailed.




Re: Pulling MU's from buffer depending on its attribute

Hi Peter,


Thanks for your reply. 


I want to consider orders only from SalesOrder table, because this is the input I am working on. As for the 90 days, I just put it random for now, because SalesOrder table is not full entered (when ready, it will be orders for 3 months). 


After creating orders from SalesOrder table, I want to process them. Depending on the order stream values (W,S,N) orders are processed in three different ways. 


As of now, I try to create order process logic for W stream orders. And the logic is the following (MethodW):


1.When W orders comes in, it is processed (pulled out from buffer) on the date:= Duedate-3days

2.And then it is checked with the WInventory table, if we have inventory on hand (order quantity vs amount). If order quantity < inventory amount, then send that order to Shipment.

4.If not wait until inventory amount is up again (there will be another logic there to check the table if it is below certain level, if below certain level then trigger production. And after production, inventory level will be up again)

3. I already put generator to call it every day, thanks for that.


Purpose of 2 is to check from the Order--SKU--Quantity how much is the order demanded from customer for certain SKU and if we have it in hand (SKU--Amount from Winventory table). Question here is how to match MU attribute SKU and Quantity with SKU and Amount from the table. 


Kind regards, 



Accepted by topic author Orxan
‎09-06-2016 12:15 PM

Re: Pulling MU's from buffer depending on its attribute

Hi Orkhan,

the inventory table WInventory needs a column for the initial stock.

I added a reset method of the WInventory (as a custom attribute), which copies the initial stock to the current stock.

In the dayly method MethodW we read the contents by

local ContList:table;

we use a loop:

for local OrdNo := 1 to ContList.yDim loop

   OrderMU := ContList[1,OrdNo];

   print OrderMU.Duedate;

   --- add you logic by SimTalk


The advantage of the local table is that you can treat the part although the contents of the buffer is changed.



Re: Pulling MU's from buffer depending on its attribute

Hi Peter, 

Thanks for your answer. 


However, I tried to implement the content for the daily methodW but it gives an error, stating left and right side of the assignment are incompatible. 

Re: Pulling MU's from buffer depending on its attribute

I tried again with slight change and I guess it is working, thanks a lot for your help.


I will try to build logic from here on.