10-01-2020 12:27 PM
Hello.
Here the automation chain :
- 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"
Operation #3 (javascript.AS_VerifierPublier) put the value "1" in the variable nbrWrkFlowCourant
Operation #4 log in server.log the value "1"
Operation #5 Execute AC-SGTEST not AC-ToWormAuto !!!
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
I think i fail to get the value but i dont know why.
Please help !!!
TY
Steeve
10-01-2020 12:40 PM
Hello,
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.
Regards
10-01-2020 12:55 PM
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.
10-01-2020 12:58 PM
somewhere else we do conditional execution according to a property and it work so why not a variable "@{Document.parent.name=="zoneTravail" ? "AC-DemarrerReceptionOPR"
10-01-2020 01:45 PM
Something like
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
}
}
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.