question

Bradith_alexander Zm2 avatar image
0 Likes"
Bradith_alexander Zm2 asked Kavika F commented

Custom code - If sentence

Whats ir wrong in this custom code?


/**Custom Code*/

Object current = param(1);

treenode activity = param(2);

Token token = param(3);

treenode processFlow = ownerobject(activity);

double valor = Table("TMKN")[token.Fila][7];

if ( valor =1 ){

Model.find("TMKN_P>variables/recipetable/Port 1/Percent (0-100)").value = 100;

Model.find("TMKN_P>variables/recipetable/Port 2/Percent (0-100)").value = 0;

Model.find("TMKN_P>variables/recipetable/Port 3/Percent (0-100)").value = 0;

Model.find("TMKN_P>variables/recipetable/Port 4/Percent (0-100)").value = 0;

Model.find("TMKN_P>variables/recipetable/Port 5/Percent (0-100)").value = 0;

Model.find("TMKN_P>variables/recipetable/Port 6/Percent (0-100)").value = 0;

Model.find("TMKN_P>variables/recipetable/Port 7/Percent (0-100)").value = 0;

Model.find("TMKN_P>variables/recipetable/Port 8/Percent (0-100)").value = 0;

}else if ( valor =2 ){

Model.find("TMKN_P>variables/recipetable/Port 1/Percent (0-100)").value = 0;

Model.find("TMKN_P>variables/recipetable/Port 2/Percent (0-100)").value = 100;

Model.find("TMKN_P>variables/recipetable/Port 3/Percent (0-100)").value = 0;

Model.find("TMKN_P>variables/recipetable/Port 4/Percent (0-100)").value = 0;

Model.find("TMKN_P>variables/recipetable/Port 5/Percent (0-100)").value = 0;

Model.find("TMKN_P>variables/recipetable/Port 6/Percent (0-100)").value = 0;

Model.find("TMKN_P>variables/recipetable/Port 7/Percent (0-100)").value = 0;

Model.find("TMKN_P>variables/recipetable/Port 8/Percent (0-100)").value = 0;

} else if ( valor = 3 ){

Model.find("TMKN_P>variables/recipetable/Port 1/Percent (0-100)").value = 0;

Model.find("TMKN_P>variables/recipetable/Port 2/Percent (0-100)").value = 0;

Model.find("TMKN_P>variables/recipetable/Port 3/Percent (0-100)").value = 100;

Model.find("TMKN_P>variables/recipetable/Port 4/Percent (0-100)").value = 0;

Model.find("TMKN_P>variables/recipetable/Port 5/Percent (0-100)").value = 0;

Model.find("TMKN_P>variables/recipetable/Port 6/Percent (0-100)").value = 0;

Model.find("TMKN_P>variables/recipetable/Port 7/Percent (0-100)").value = 0;

Model.find("TMKN_P>variables/recipetable/Port 8/Percent (0-100)").value = 0;

}else if ( valor =4 ){

Model.find("TMKN_P>variables/recipetable/Port 1/Percent (0-100)").value = 0;

Model.find("TMKN_P>variables/recipetable/Port 2/Percent (0-100)").value = 0;

Model.find("TMKN_P>variables/recipetable/Port 3/Percent (0-100)").value = 0;

Model.find("TMKN_P>variables/recipetable/Port 4/Percent (0-100)").value = 100;

Model.find("TMKN_P>variables/recipetable/Port 5/Percent (0-100)").value = 0;

Model.find("TMKN_P>variables/recipetable/Port 6/Percent (0-100)").value = 0;

Model.find("TMKN_P>variables/recipetable/Port 7/Percent (0-100)").value = 0;

Model.find("TMKN_P>variables/recipetable/Port 8/Percent (0-100)").value = 0;

};


FlexSim 22.0.1
customcode
· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Joerg Vogel avatar image
1 Like"
Joerg Vogel answered Jason Lightfoot converted comment to answer

Comparator ==

5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.