Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Execute a Python script from a file. This operation differs from executePythonFile by executing the file for every file in the package. This operation has the same support for inputs and outputs available to it as the executePythonFile operation. In addition it has the following variables available with information about a particular file.

...

User defined outputs – an output must be defined in the workflow editor to be accessible. Within your script use the Map outputs setOutputs(type Map<Stringkey, Object>Value) function to set any outputs.

Example

Code Block
languagepy
titleOutput Example
ouptuts.putsetOutputs("MY_STRING_OUTPUT","Output result") # output will be "Output result"
ouptuts.put("MY_BOOLEAN_OUTPUT",bool("")) # output will be false

Setting Status

The status of the File can be set in your script using the packageFunctions object. This object has several functions available to it, see the example below. If an exception occurs in your script, the status will be set to Failed. Statuses will only be set when deploying.

Code Block
languagepy
titleSetting the status examples
packageFunctions.setObjectResultStatusSuccess() # Status will be Success
packageFunctions.setObjectResultStatusFailed() # Status will be Failed
packageFunctions.setObjectResultStatusSkipped() # Status will be Skipped
packageFunctions.setObjectResultStatusNotAttempted() # Status will be Not Attempted
packageFunctions.setObjectResultStatusIgnore() # Status will be Unknown

...