Hello everyone 大家好
I encountered a problem when I was trying to change the order of items in a queue based on a label value. Any time an item with label "label" = 5 enters, it should be processed before any other item in the queue. I wrote the code below for the OnEntry trigger.
当我尝试根据标签值更改队列中项目的顺序时,我遇到了一个问题。每当标签为“label”= 5 输入item时,都应先于队列中的任何其他item标签进行处理。我为 OnEntry 触发器编写了以下代码。
Now, the code results in the outputport being opened before the items are shuffled. Hence, the item initially at rank 1, so before the entry trigger, is passed to the processor, not the one I want. Only after the wrong item was passed, the remaining items are ordered correctly.
现在,该代码会导致在洗牌项之前打开输出端口。因此,item最初处于等级 1 的位置,即在进入触发器之前,被传递给处理器,而不是我想要的处理器。只有在错误item通过后,其余项目才会正确排序。
Is there an easy way to overcome the apparent delay on the item sorting step, or am I doing something wrong?
有没有一种简单的方法可以克服分拣步骤的item明显延迟,或者我做错了什么?
Many thanks in advance
提前非常感谢
- Object item = param(1);
- Object current = ownerobject(c);
- int port = param(2);
- { // ************* PickOption Start ************* //
- if (item.label == 5) {
- treenode itemConsidered = current.subnodes[current.subnodes.length];
- itemConsidered.rank = 1;
- openoutput(current);
- }
- } // ******* PickOption End ******* //