Jump to content

Search step problem


AGarcia

Recommended Posts

Hi,


I am having some trouble with the search step.


My model has three entities (instances of the Default Entity):

• Gear

• Housing

• Pinion


Entities have a string property called stColor


I have a table, tabPartsInfo, where I have the following fields

• EntityType (object reference property)

• Color (string property)

• Picture (integer)


Every row of this table contains the combination of what picture should be assigned to every type of entity according to their color. For example picture 1, might mean white for gears but blue for pinions.


Entities of each of the types enter the model and are given a value for stColor.


After that I want to use the search step so that I find the row where

• EntityType is the corresponding entity and

• Color is the corresponding stColor for that entity.


I have configured the step search as follows


Collection Type: TableRows

Table Name: tabPartsInfo

Match Condition: modelEntity.stColor==tabPartsInfo.Color && modelEntity = tabPartsInfo.EntityType

Although diffent values for stColor are given to entities, the picture does not change.


I hope you can provide me with some help.

Regards,

Link to comment
Share on other sites

Based only on what you wrote, the picture state wouldn't change... you need an assign step.


Assuming you have an assign step later, have you traced the search step and checked which row it is returning? If it is returning the wrong row, try using this for the second part of your match criteria:


modelEntity.Population.Name == tabPartsInfo.EntityType.Name

Link to comment
Share on other sites

Many thanks for your reply.


I do have a step assign after the search step. That I had.

I tried

modelEntity.Population.Name == tabPartsInfo.EntityType.Name

but I got the following error (at the bottom).


I am attaching the model. It is kanban model and the problem is related to the process procAssignColorStringAndPicture which is called from input@MachiningGears


Many thanks for your guidance.


Error

Item: modelEntity 'gear.63'

A runtime error was detected at time 0.0 Hours at the following process step:

Object: Model

Process: procAssignColorStringAndPicture

Token: Token.11

Step: [search] SearchPic

Step Property: Match Condition

Error evaluating the value of property 'Match Condition'.

Item: modelEntity 'gear.63'

A runtime error was detected at time 0.0 Hours at the following process step:

Object: Model

Process: procAssignColorStringAndPicture

Token: Token.11

Step: [search] SearchPic

Step Property: Match Condition

Error evaluating the value of property 'Match Condition'.

Invalid operation because types of operands must match. Both must be numeric or string.

modelo_kanban_20131121.spfx

Link to comment
Share on other sites

×
×
  • Create New...