<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Code: How to create a flow item using conditional script on source? in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/code-how-to-create-a-flow-item-using-conditional-script-on/m-p/13503162#M17896</link>
    <description>&lt;P&gt;Hi &lt;A rel="user" href="https://answers.flexsim.com/users/18673/perla-jazminhr.html" nodeid="18673"&gt;@Perla Jazmín HR&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;How often does the source check? If the source checks every time an item leaves the rack or the processor, you can listen to one of those events with a Wait for Event activity in Process Flow. Then, once the token is made, you can check the other condition and if it is also true, send the token to a Create Object activity.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="23646-create-flow-item.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1500629iE07ACD5B3C4F9A91/image-size/large?v=v2&amp;amp;px=999" role="button" title="23646-create-flow-item.png" alt="23646-create-flow-item.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If you're using an inter-arrival time to create the tokens, you would just add two Decide activities to verify both conditions are true.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="23647-double-decide.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1500630i244E4B725AC8A3BB/image-size/large?v=v2&amp;amp;px=999" role="button" title="23647-double-decide.png" alt="23647-double-decide.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Hopefully this helps. Let us know what feedback you have.&lt;/P&gt;</description>
    <pubDate>Wed, 20 Nov 2019 00:33:13 GMT</pubDate>
    <dc:creator>tanner_p</dc:creator>
    <dc:date>2019-11-20T00:33:13Z</dc:date>
    <item>
      <title>Code: How to create a flow item using conditional script on source?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/code-how-to-create-a-flow-item-using-conditional-script-on/m-p/13503161#M17895</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 19.1.0 ]&lt;/I&gt;&lt;/P&gt;&lt;P&gt;I am trying to code the inter-arrival time of a source to create a flowitem based on a conditional.&lt;/P&gt;
&lt;P&gt;The source checks if a rack is empty and if a processor has sent an object to th next activity, then I want to create the flowitem.&lt;/P&gt;
&lt;P&gt;This is what I have written so far:&lt;/P&gt;
&lt;PRE style="margin-left: 20px;"&gt;if current.centerObjects[1].stats.state().value &amp;lt; 1 and current.inObjects[1].stats.output.value==1;&lt;/PRE&gt;
&lt;P&gt;I'm not the best using code so any suggestion is more than welcome!&lt;/P&gt;</description>
      <pubDate>Tue, 19 Nov 2019 20:51:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/code-how-to-create-a-flow-item-using-conditional-script-on/m-p/13503161#M17895</guid>
      <dc:creator>perla_jazmin_hr</dc:creator>
      <dc:date>2019-11-19T20:51:45Z</dc:date>
    </item>
    <item>
      <title>Re: Code: How to create a flow item using conditional script on source?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/code-how-to-create-a-flow-item-using-conditional-script-on/m-p/13503162#M17896</link>
      <description>&lt;P&gt;Hi &lt;A rel="user" href="https://answers.flexsim.com/users/18673/perla-jazminhr.html" nodeid="18673"&gt;@Perla Jazmín HR&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;How often does the source check? If the source checks every time an item leaves the rack or the processor, you can listen to one of those events with a Wait for Event activity in Process Flow. Then, once the token is made, you can check the other condition and if it is also true, send the token to a Create Object activity.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="23646-create-flow-item.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1500629iE07ACD5B3C4F9A91/image-size/large?v=v2&amp;amp;px=999" role="button" title="23646-create-flow-item.png" alt="23646-create-flow-item.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If you're using an inter-arrival time to create the tokens, you would just add two Decide activities to verify both conditions are true.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="23647-double-decide.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1500630i244E4B725AC8A3BB/image-size/large?v=v2&amp;amp;px=999" role="button" title="23647-double-decide.png" alt="23647-double-decide.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Hopefully this helps. Let us know what feedback you have.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2019 00:33:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/code-how-to-create-a-flow-item-using-conditional-script-on/m-p/13503162#M17896</guid>
      <dc:creator>tanner_p</dc:creator>
      <dc:date>2019-11-20T00:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: Code: How to create a flow item using conditional script on source?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/code-how-to-create-a-flow-item-using-conditional-script-on/m-p/13503163#M17897</link>
      <description>&lt;P&gt;If you are doing this in the 3D model, I would suggest putting an 'OnExit' trigger on the processor which sends a message to where you'd like the flowitem to be made. Then on the location making the flowitem, put a 'OnMessage' trigger to create the item.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="23685-dc3yd.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1500631i0784666F5A9206EF/image-size/large?v=v2&amp;amp;px=999" role="button" title="23685-dc3yd.png" alt="23685-dc3yd.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Here the flowitem rank is the number of the entry in the flowitem bin.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2019 21:12:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/code-how-to-create-a-flow-item-using-conditional-script-on/m-p/13503163#M17897</guid>
      <dc:creator>kyle_p1</dc:creator>
      <dc:date>2019-11-20T21:12:04Z</dc:date>
    </item>
    <item>
      <title>Re: Code: How to create a flow item using conditional script on source?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/code-how-to-create-a-flow-item-using-conditional-script-on/m-p/13503164#M17898</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/10084/kylep.html" nodeid="10084"&gt;@Kyle P&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;In the from object(which sends the message processor in your case),what parameters(Values for param1,param2,param3) should i be sending?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2019 11:49:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/code-how-to-create-a-flow-item-using-conditional-script-on/m-p/13503164#M17898</guid>
      <dc:creator>suhas_h2</dc:creator>
      <dc:date>2019-11-26T11:49:21Z</dc:date>
    </item>
    <item>
      <title>Re: Code: How to create a flow item using conditional script on source?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/code-how-to-create-a-flow-item-using-conditional-script-on/m-p/13503165#M17899</link>
      <description>&lt;P&gt;In the processor 'On Exit' trigger, send message option what should be sent to the queue as Parameter 1, Parameter 2 and Parameter 3?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 11:16:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/code-how-to-create-a-flow-item-using-conditional-script-on/m-p/13503165#M17899</guid>
      <dc:creator>suhas_h2</dc:creator>
      <dc:date>2019-11-27T11:16:02Z</dc:date>
    </item>
    <item>
      <title>Re: Code: How to create a flow item using conditional script on source?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/code-how-to-create-a-flow-item-using-conditional-script-on/m-p/13503166#M17900</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/14098/suhash2.html" nodeid="14098"&gt;@Suhas H2&lt;/A&gt; I typically just use custom code to send the message, this is because using the custom code allows me to pass 3 labels in the parameters.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="23926-n9ul0.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1500632iA06CF95DC004BF3D/image-size/large?v=v2&amp;amp;px=999" role="button" title="23926-n9ul0.png" alt="23926-n9ul0.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;If you use the built in functionality, you lose the ability to pass labels but the parameters would map as follows:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="23927-hzpud.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1500633i78E4CC7051BBE836/image-size/large?v=v2&amp;amp;px=999" role="button" title="23927-hzpud.png" alt="23927-hzpud.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="23928-fpnm6.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1500634iF803B918C170EF58/image-size/large?v=v2&amp;amp;px=999" role="button" title="23928-fpnm6.png" alt="23928-fpnm6.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Here, you can see that the built-in triggers use msgparam1 as the quantity and msgparam2 as the flowitem rank, but leaves no room for passing labels.&lt;/P&gt;
&lt;P&gt;Through the code you can pass 3 variables (parameters) with in the message; so you have more flexibility in what you want to achieve. If you are always creating the same flowitem and the same quantity then you can utilize the 3 variables (parameters) as a way to pass labels to the newly created flowitem.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2019 13:29:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/code-how-to-create-a-flow-item-using-conditional-script-on/m-p/13503166#M17900</guid>
      <dc:creator>kyle_p1</dc:creator>
      <dc:date>2019-12-02T13:29:07Z</dc:date>
    </item>
  </channel>
</rss>

