0

I have an assembler that acts as synchronization point in my network. It receives two different objects and in the "OnEnterDelay" event of this block I would like that the building of the output object starting only if I have a particular value inside the input objects.

I managed the check but I don't know how to discard the input if this condition is not matched and I tried to only remove agents from the input queues but it seems to not working

SupplierInfo supplierInfo = (SupplierInfo)self.queueGet(2, 0);

if (!supplierInfo.getStatus())
{
    self.queue1.removeFirst();
    self.queue2.removeFirst();
}
1
  • Have you checked if when the action "On Enter Delay" occurs there are elements in queue. The assembler block consumes the inputs when it is producing the output, so it might have already consumed the products in queue. Commented Nov 10, 2016 at 9:35

1 Answer 1

2

maybe you need to send the discarded objects somewhere. you could connect an enter-object to a sink, and then use:
enter.take(self.queue1.removeFirst)

if that doesn't work, you could create the check before the assembler and remove them before they enter the assembler.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.