I would like to get the string value (OffSchedule - Unavailable) of the status of a location to use in a Decide Activity.
Thanks.
I would like to get the string value (OffSchedule - Unavailable) of the status of a location to use in a Decide Activity.
Thanks.
Hi @Tee Hiett, was Arun Kr's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.
If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.
Hi,
If you are particular about using the status string of a resource, you can use the following code in the decide activity.
Object ResourceObj = Model.find("ResourceObjName"); // Getting Reference Of Object string Status = ReosurceObj.stats.state().valueString; // Getting the status String if(Status == "scheduled down" || Status == "down") { return 1; } return 2;
For getting the exact string names of the states, you can refer to the state profile of the object to which you are trying to write the logic.
Alternately, you can use the state numbers which is easier to implement.
Object ResourceObj = Model.find("ResourceObjName"); // Getting Reference Of Object int Status = ReosurceObj.stats.state().value // Getting the status num if(Status == STATE_SCHEDULED_DOWN || Status == STATE_DOWN) // using the macros { return 1; } return 2;
Regards,
Arun KR
13 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved