<?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: In automation chain, RunOperation with condition on a contex variable not working in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/in-automation-chain-runoperation-with-condition-on-a-contex/m-p/314583#M1584</link>
    <description>&lt;P&gt;I need a conditional execution of the chain AC-ToWormAuto.  If var nbrWrkFlowCourant contain 1 then i sould execute the chain. An alternative will be to execute  AC-ToWormAuto from  javascript.AS_VerifierPublier but i dont know how.&lt;/P&gt;</description>
    <pubDate>Thu, 01 Oct 2020 19:55:26 GMT</pubDate>
    <dc:creator>steeve_gagnon</dc:creator>
    <dc:date>2020-10-01T19:55:26Z</dc:date>
    <item>
      <title>In automation chain, RunOperation with condition on a contex variable not working</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/in-automation-chain-runoperation-with-condition-on-a-contex/m-p/314581#M1582</link>
      <description>&lt;P&gt;Hello.&lt;/P&gt;
&lt;P&gt;Here the automation chain :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;- Repository.GetDocument:
    value: "@{This.get(0).id}"
- Context.SetVar:
    name: nbrWrkFlowCourant
    value: "99"
- javascript.AS_VerifierPublier
- Log:
    level: warn
    message: "@{Context[\"nbrWrkFlowCourant\"]}"
    category: DEBUGSG nbrWrkFlowCourant test 222
- RunOperation:
    id: "@{ Context[\"nbrWrkFlowCourant\"] ==\"1\" ? \"AC-ToWormAuto\" : \"AC-SGTEST\"}"
    isolate: "false"

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Operation #3 (javascript.AS_VerifierPublier) put the value "1" in the variable nbrWrkFlowCourant&lt;/P&gt;
&lt;P&gt;Operation #4 log in server.log the value "1"&lt;/P&gt;
&lt;P&gt;Operation #5 Execute AC-SGTEST not AC-ToWormAuto !!!&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;If i try id: "@{ \"1\"==\"1\" ? \"AC-ToWormAuto\" : \"AC-SGTEST\"}" IT work

if i try id: "@{ Context[\"nbrWrkFlowCourant\"] ==\"99\" ? \"AC-ToWormAuto\" : \"AC-SGTEST\"}" not working

   if i try id: "@{ Context[\"nbrWrkFlowCourant\"] ==\"\" ? \"AC-ToWormAuto\" : \"AC-SGTEST\"}" not working
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I think i fail to get the value but i dont know why.&lt;/P&gt;
&lt;P&gt;Please help !!!&lt;/P&gt;
&lt;P&gt;TY&lt;/P&gt;
&lt;P&gt;Steeve&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2020 19:27:04 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/in-automation-chain-runoperation-with-condition-on-a-contex/m-p/314581#M1582</guid>
      <dc:creator>steeve_gagnon</dc:creator>
      <dc:date>2020-10-01T19:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: In automation chain, RunOperation with condition on a contex variable not working</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/in-automation-chain-runoperation-with-condition-on-a-contex/m-p/314582#M1583</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Could you please explain what you are trying to do in this example, it is not very clear. Then, why not writing all your code in a single automation scripting? That would be far away easier to debug.&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2020 19:40:52 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/in-automation-chain-runoperation-with-condition-on-a-contex/m-p/314582#M1583</guid>
      <dc:creator>Gregory_Carlin</dc:creator>
      <dc:date>2020-10-01T19:40:52Z</dc:date>
    </item>
    <item>
      <title>Re: In automation chain, RunOperation with condition on a contex variable not working</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/in-automation-chain-runoperation-with-condition-on-a-contex/m-p/314583#M1584</link>
      <description>&lt;P&gt;I need a conditional execution of the chain AC-ToWormAuto.  If var nbrWrkFlowCourant contain 1 then i sould execute the chain. An alternative will be to execute  AC-ToWormAuto from  javascript.AS_VerifierPublier but i dont know how.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2020 19:55:26 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/in-automation-chain-runoperation-with-condition-on-a-contex/m-p/314583#M1584</guid>
      <dc:creator>steeve_gagnon</dc:creator>
      <dc:date>2020-10-01T19:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: In automation chain, RunOperation with condition on a contex variable not working</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/in-automation-chain-runoperation-with-condition-on-a-contex/m-p/314584#M1585</link>
      <description>&lt;P&gt;somewhere else we do conditional execution according to a property and it work so why not a variable  "@{Document.parent.name==&amp;amp;quot;zoneTravail&amp;amp;quot; ? &amp;amp;quot;AC-DemarrerReceptionOPR&amp;amp;quot;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2020 19:58:51 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/in-automation-chain-runoperation-with-condition-on-a-contex/m-p/314584#M1585</guid>
      <dc:creator>steeve_gagnon</dc:creator>
      <dc:date>2020-10-01T19:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: In automation chain, RunOperation with condition on a contex variable not working</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/in-automation-chain-runoperation-with-condition-on-a-contex/m-p/314585#M1586</link>
      <description>&lt;P&gt;Something like&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;function run(input, params) {
	var parent = Document.GetParent (input, {});
	var parentName = parent.name;
	if (parentName == "zoneTravail")
		{
			/// Something, or call a function, or call an automation chain
			  RunOperation(
				input, {'id': "Another_Automation_Chain"});
	
		}
	else
		{
			/// SOMETHING ELSE
		}
}

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Oct 2020 20:45:27 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/in-automation-chain-runoperation-with-condition-on-a-contex/m-p/314585#M1586</guid>
      <dc:creator>Gregory_Carlin</dc:creator>
      <dc:date>2020-10-01T20:45:27Z</dc:date>
    </item>
  </channel>
</rss>

