My customer want to know how to control 'enable' of the inter-arrival source activity to On/Off.
Is there a way to control the Enable field to 'check' or 'uncheck' using custom code activity?
My customer want to know how to control 'enable' of the inter-arrival source activity to On/Off.
Is there a way to control the Enable field to 'check' or 'uncheck' using custom code activity?
Hi @David Seo, was Felix Möhlmann'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.
activity.as(Object).setVariable("enabled", value); // OR setvarnum(activity, "enabled", value);
These can set the source to be enabled (value == 1) or not (value == 0). To immediately update the icon, add
function_s(activity, "updateIcon");
The necessary code can be auto-generated by choosing a process flow source as reference for a parameter in the Parameters table.
Since you are asking about doing this is a custom code activity I presume your customer wants to switch the source on/off while the model is running? In that case a different solution would be required, since the "enabled" setting only takes effect on a reset.
A simple decide activity controlled by a global variable or process flow label that sends created tokens directly to a sink can achieve this. (You could of course also have the decide look at the "enabled" variable that is changed in the above code but that seems unnecessarily complicated).
My customer wants to switch the source 'Enabled' on/off while the model is running as you presume. He wants to do it dynamically using parameter or global variables .
16 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