Jump to content

Dynamic routing priority


agraunke
 Share

Recommended Posts

Hello all,


I’m having a tough time modeling a dynamic routing priority situation. I have entity instances that I would like to route to one of N servers. I currently have node lists that I use to route out of a transfer node per entity instance (actually, I have a list property defined on my entity, and the transfer node’s repeat group references ModelEntity.NodeListProperty).


This seems to work well, but now I would like to embellish the model so that the priority can change on a given date. I already have logic to detect the date change—my question is how can I reference a new node list for each entity instance?


Potentially complicating the issue: I have an additional requirement that the routing priorities be tied to an Excel input file. Lists cannot be bound to data (a lacking feature, in my mind), so my node lists are actually references to table cells that hold nodes.

For example,

NodeList1 = 

I am flexible on the table structure required to meet the new feature of changing to a different set of nodes. I tried using a state variable to point to a different set of rows in the table (i.e. NodeList1 = ; IntState increments on each priority change). However, it appears that the list property gets initialized for the entity population on model initialization (makes sense) instead of when the entity gets created.


Also, there is not an option for a list reference state variable. I also considered having multiple list properties on each entity… but how do I dynamically change the node list property on the transfer node’s routing group?


So, any thoughts?


Thanks!

DynamicRoutingPriority.spfx

Link to comment
Share on other sites

Adam,

Instead of having the TransferNode reference a NodeList property on the entity, could you have it reference a NodeListProperty in a Table? So, instead of having a Node Property in the Table, have a NodeListProperty instead. And populate the Table with NodeList1, NodeList2, etc. Have your TransferNode reference Table2.NodeListProperty1 and then depending on what row the incoming entity has set to that Table, they'll select the appropriate NodeList. And when you want to change which node list an entity uses, you just change their row reference into that table. I made a few small changes to you model and attached it. In this example, I have two state variables that set the row of the entity as it's leaving the Source so when you want to change which row is assigned, you just change the state variable. Its built in sprint 90. Let me know if you have questions or if this doesn't meet your needs.

DynamicRoutingPriority_simio.spfx

Link to comment
Share on other sites

Spot On....


If you look at some of my posts....you will see that I have requested a dynamic array of type object....


Node lists wont work and you have to use a table and set the columns to type object....


having the first column as an index column, you should be able to index the table and reference other objects in the table by using the search and find blocks....

Capture.JPG.8ca5f5490495d400311a95c862220ecd.JPG

Link to comment
Share on other sites

×
×
  • Create New...