Jump to content

Comparing list reference property with parent object name


AGarcia

Recommended Posts

Hello,

This model corresponds to an assembly line for three models.

ModelA and ModelB are processed from Station1 to Station9 and the leave the line.

ModelC must have additional work, which is to be done in Auxiliar (in between Station 8 and Station9), so that it leaves the line after Station 8and gets back to Station9 after the extra operations.

A sucbomponent must be ordered in advance to be integrated to ModelC in Auxiliar.

The logic I want to implement is the following.

I have a list containing all stations (object list lstStations).

A list property pointint to that list (rpSynchroStation).

For every output node of every station, I want to check if the list property coincides with the name of the corresponding station (and if it's model C in that station). If so, an event is triggered, and a source corresponding to the supplier produces a part that will be delivered some time later.

The problem I am having is within the decide step, when comparing:


ModelEntity.Location.Parent.Name == rpSynchroStation && ModelEntity.EntityType == ModelC


In Decide2 step in procCheckIfSynchro process.

I get an error when comparing ModelEntity.Location.Parent.Name == rpSynchroStation.

Could you please help me with this?

Many thanks

Best regards,

model_tractors.spfx

Link to comment
Share on other sites

Unfortunately I cannot open Academic licenses but from what you wrote you are comparing your list reference rpSynchroStation to a name and thus get a mismatch comparing reference to a string.


To solve it you need to search through your list to actually get the name. I do not know how the model is set up, but if you need to do a multi-level search (for every output node search through the list), you need two searches after each other. Mind that if there are a lot of elements in these searches, and if you execute it often, you might get performance issues.

Link to comment
Share on other sites

Hi,

Many thanks for your reply.

I have created a Seach step that searches through the list lstStations with the Match Condition candidate.Object.Name == ModelEntity.Location.Parent.Name and I get Station8, wich is the object were the entity is.

I would like to compare this with the value of rpSynchroStation, but this I am having trouble with.

Many thanks, anyways. I am aware that if you cannot open the model, it is not easy to figure what my issue is.

Regards,

Link to comment
Share on other sites

Many thanks for your interest and your post.

I understood the reason why it is not working. Since I am comparing a name and a number.

I tried with the double search. In the first search through the list i getto store the index found corresponding to the station where the entity is, but I could not figure what to do in the second search.

If you could provide me with some help, I would appreciate.

Regards,

Link to comment
Share on other sites

Hi,

many thanks for your interest.

I have created a new and simplified versión of my issue with a commercial version (attached).


Entities flow along a series of servers. The user will select a server so that every time an entity is processed in that server a user defined event will be triggered.

For that the model contains:

• Source, servers, sink and an entity.

• An object list containing all server names (lstServers)

• A list property (rpSelectedServer).

• A process that it’s called within the entered add-on process of every server.

• A state (stRowInList) that will get the number row in the list that contains the name of the server corresponding to the server when the process is run.

When an entity is processed, by means of Process1, I can get the number in the list corresponding to the server that just processed the entity.

What cannot do is how to compare the element in that row of the list with the value of the property containing the element in the list.

Many thanks for your assistance.

Regards,

simple_example.spfx

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

Many thanks for spending the time to redo it.

I am trying to open it and have a compatibility issue.

I just downloaded the lastest version but it seems not to work. My version is 8.139.13727 (32bit) and running a full commercial version.

Although this goes beyond my initial post, do you have a clue or I might do to open yor model.

Best regards,

Link to comment
Share on other sites

I think with commercial license you can not open a model which is developed by an academic edition. I took snapshots of all inclusions and pasted them in the word file atached as a whole. You can easily track the inclusions from these snapshots. The trick is the definition of a table (i.e., table1 in the model). When the search is performed stRowList returns the rank of object in the object list (i.e., LstServers). I can not manage to compare whether returned server name equals to the server name specified with "whichserver" property in the search step alone (Note that, as far as I remember I changed the type of this model propery as "object" instead of "objectlist", otherwise it does not work). Then I defined a data table which replicates the object list then used a decide step for performing this comparison (i.e., whether returned server name equals to the server name specified with "whichserver" property). Note that, string type state variable definition is irrelevant. It is defined for only verification purposes.

Contents_simple_sample_redo.docx

Link to comment
Share on other sites

Hi,

Thank you so much for taking the trouble of creating the doc document! I am afraid that the three first images refer to the same step (first Search), and the properties of Decide1 and Assign1 cannot be seen.

I have tried to open the model with the academic licence I have and have the same issue (I am using in 8.139.13727 release).

Sorry for the inconvenience and many thanks for your help.

Best regards,

Link to comment
Share on other sites

Hi,

I was using a previous version. I was able to rebuild the model and it just works fine.

I have implemented the extra logic along with what you did and works just fine.

Thank you so much for your time and your experience (and your patience).

Best regards,

Link to comment
Share on other sites

×
×
  • Create New...