How to use a custom function to order by in zone queue strategy ?

How to use a custom function to order by in zone queue strategy ?

nicolas_membrez4BM5L
Enthusiast Enthusiast
1,240 Views
6 Replies
Message 1 of 7

How to use a custom function to order by in zone queue strategy ?

nicolas_membrez4BM5L
Enthusiast
Enthusiast

[ FlexSim 23.1.4 ]

I would like to order the entrance of tokens by theirs labels. Choice 1 : Duration, Choice 2 NbEtapes (Model Parameters).

I would like to use a custom function to determinate de queue strategy in the zone. But the error message :

"syntax error, unexpected identifier Object, expecting end of code. Make sure commas, parentheses, etc. are placed correctly".

1) How to use the custom function ind the Zone Queue strategy field ?

1692113349907.png


2) I would like to controle the order, by cloning the result in a globale table for exemple. Is this possible ?

Thanks in advance


Zone_OrderBy_CustomRequest.fsm

0 Likes
Accepted solutions (1)
1,241 Views
6 Replies
Replies (6)
Message 2 of 7

jason_lightfoot_adsk
Autodesk
Autodesk
Accepted solution

You can do this by setting the node to an option value using the OnSet of the parameter:

1692195555053.png

zone-orderby-customrequest_jl.fsm

To see the result I would use a statistics collector to detect tokens entering the zone. You can query that as if it were a global table.

Message 3 of 7

nicolas_membrez4BM5L
Enthusiast
Enthusiast
ok, it's another way to do it, and it works, thanks a lot !


However, I would like to anderstand why this error appears ?

0 Likes
Message 4 of 7

joerg_vogel_HsH
Mentor
Mentor
@Nicolas M25, if this code gets precompiled, then variable requete is empty. Maybe you can assign instead the else assigned value as default declared value.
0 Likes
Message 5 of 7

nicolas_membrez4BM5L
Enthusiast
Enthusiast

@Joerg Vogel thanks for your answer. Sorry, I don't anderstand very well (not a dev ;)). Can you show me an example in the micro model attached please ? Thanks in advance

0 Likes
Message 6 of 7

jason_lightfoot_adsk
Autodesk
Autodesk
I don't think that field is evaluated to find an expression for the order by clause, it uses the value as the order by clause.
0 Likes
Message 7 of 7

Matthew_Gillespie
Autodesk
Autodesk

@Nicolas Mbz That field was incorrectly showing the option to open the code editor.

This issue has been fixed in 23.0.11 and 23.2.1 released today.



Matthew Gillespie
FlexSim Software Developer

0 Likes