NotInContextVerification

Not in context verification is a script that executes the given command and verifies that the specified field is not in the context after execution.

javascript · Common Scripts

Source

var val = invContext.keyToWatch;
var argumentsVal = args.cmdArguments;
var argsArr = argumentsVal.split(",");

var argsToCmd = {};
for (i = 0; i < argsArr.length ; i++) {
    var keyval = argsArr[i].split("=");
    if (keyval.length == 2) {
        argsToCmd[keyval[0].trim()] = keyval[1];
    }
}

var entry = executeCommand(args.cmdToRun, argsToCmd);
if(!entry[0].EntryContext[args.keyToWatch]){
    return entry;
}
else{
    throw args.keyToWatch + ' in context is not empty';
}


README

Executes the given command and verifies that the specified field is not in the context after execution.

Script Data


Name Description
Script Type javascript
Tags Utility

Inputs


Argument Name Description
cmdToRun The command or automation script to execute each while loop iteration.
cmdArguments The comma-separated list of command/automation arguments and values to run. For example, “key=val,key=val,key=val”.
keyToWatch The key to watch, if it is equal to value argument (${key}==value) then exit while loop, otherwise continue to the next loop iteration. The command will then run again.

Outputs


There are no outputs for this script.