Cancel
Showing results for 
Search instead for 
Did you mean: 

Choosing the path based on entity name

Valued Contributor
Valued Contributor

Dear community members,

I'm trying to create an exit control method for a parallelproc that, based on the entity name (entityA), moves the entity to a specific store (storeA). 

i tried with

is
do
	if @ = entityA then
		@.move(storeA)
	else
		@.delete
	end;
end;

and

is
do
	if @ = .mus.entityA then
		@.move(storeA)
	else
		@.delete
	end;
end;

and

is
do
	if @.name = entityA then
		@.move(storeA)
	else
		@.delete
	end;
end;

Hoe can I build it

Thanks

Alessandro P.

6 REPLIES

Re: Choosing the path based on entity name

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

you could try this

is
do
if @.name = "entityA" then --name returns a string --> "xxx"
@.move(storeA);
else
@.delete;
end;
end;
Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: Choosing the path based on entity name

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

You should get an error with useful information. Since entityA is a name (datatype: string), you should have something like this:

if @.name="entityA" then

...


Gert Nomden
Senior Consultant | Tecnomatix Product Manager
cardsplmsolutions.com

Re: Choosing the path based on entity name

Siemens Phenom Siemens Phenom
Siemens Phenom

Hi Alessandro,

 

Variant 1 will work when you check the class of your current MU:

if @.class = .mus.entityA then

 

Or if you put " around the name of your entity in variant 3 it should work as well:

if @.name = "entityA" then

If you don't have the quotes it will look for an object with name entityA in the current location.

Regards,

Ralf
------------------------------------------------------------------------------------------------------
Did you like the answer? Then click the Thumbs Up button.
Did the answer solve your problem? Then accept the answer as solution.

Re: Choosing the path based on entity name

Valued Contributor
Valued Contributor

Thanks for the answers

 

if @.name = "entityA" then

is not working,e.g. the method deletes the entity and do not recognize the name

if @.class = .mus.entityA then

works instead.

 

What can be the problem with 

if @.name = "entityA" then

 ?

Re: Choosing the path based on entity name

Siemens Phenom Siemens Phenom
Siemens Phenom

For the string compare the case has to match, so "entityA" is not the same as "EntityA".

 

For object names the case is ignored.

Regards,

Ralf
------------------------------------------------------------------------------------------------------
Did you like the answer? Then click the Thumbs Up button.
Did the answer solve your problem? Then accept the answer as solution.

Re: Choosing the path based on entity name

Solution Partner Valued Contributor Solution Partner Valued Contributor
Solution Partner Valued Contributor

I may have suggested using an exitstrategy type MUAttribute or MUName letting the object select the succesor.

Something good about PlantSim is not everything has to be done using SimTalk.

cortega@interlatin.com.mx
+52 (81) 10801310
InterLatin S de RL de CV