Jump to content

Parent ID


mmashaie
 Share

Recommended Posts

Doc1.docx

 

I’m having an issue with creating a ParentID state variable. I have an add-on process that when a person is created at the source, bags also get created based on a distribution. This all works well. I got this from a post I put on the Simio forum last year. What I want to do is match my person to bag later on based on a variable ParentID, but no matching happens. I did a trace and see that the bags have a non-zero ParentID, but all the pax have ParentID=0. I assumed that in the Assign step highlighted in the first picture is assigning a ParentID to my person, no? I tried a few things, but get errors in other places. Hints? Thanks.

Link to comment
Share on other sites

It looks like both the person and bag are from the same EntityClass: ModelEntity. Assuming that is true, before the CreateStep put Assign: Variable: ModelEntity.StringStateName New Value: ModelEntity.Name On the Create Step, set Create Type:CopyAssociatedObject and EntityType:Bag. ALL the personEntity states and properties overwrite the bagEntity's. If bag entity has settings that shouldn't be overwritten then you can subclass ModelEntity to make a bagEntityClass. If the bagEntity is from a subclass of the ModelEntity, then only states and properties in common change. No additional Assign is needed. The person and bag EntityClasses could be unrelated. If so, an additional assign Step is needed after Create with Variable: BagClass.StringStateName1 & NewValue: ModelEntity.StringStateName Then only that state changes.

Link to comment
Share on other sites

 Share

×
×
  • Create New...