Skip to main content
Skip table of contents

Adapting the Video Ingest Workflow [C OG]

Return to the Workflow Designer and add a task before the RegisterItem task. This will be of the type Script Task. In the Script Task one can add JavaScript code. In this example, a JavaScript code for copying the value of TargetPlatformUri to another global workflow parameter with a different name will be used. The following JavaScript code can be used to achieve this (as shown in the image below).
execution.setVariable("TargetStorageUri", TargetPlatformUri);
This script creates a new variable in the global workflow scope with name "TargetStorageUri" and assigns the value of the existing global parameter TargetPlatformUri.

One should assign this new parameter to the input parameter of the MoveFileVidispine as follows:

Please note that the following expression language syntax is used as explained in the Expression Language section.
As a consequence, the $ is used instead of the # syntax. It is recommended that one view the topics Immediate and Deferred Evaluation contained in the Expression Language section.
The short explanation is as follows:
One can always use the $ notification for already existing global workflow parameters. If one uses the #, one will implicitly create a new global workflow variable if does not already exist with that name. Next, one should focus on the global workflow parameters.

As one can see in the image above, the global parameter TargetPlatformUri is missing that is actually mandatory for workflows that are used in watchfolder use cases. This is because we removed the #TargetPlatformUri from the MoveFileVidispine agent as now the ${TargetStorageUri} is used.
The solution is to add an input variable to the Script Task that we created for copying the value. To do so:

  1. Select the Script Task
  2. Select its Input/Output tab
  3. Add an input parameter by using the "+" button on top of the input parameters box
  4. Give any name to the input parameter, e.g. "parameterToCopyValueFrom"
  5. As a value use now #{TargetPlatfromUri}

By checking the global workflow parameters once more, one can see that both mandatory parameters are present.

Try another file as described in the Start the Ingest Workflow [C OG] section. In the Workflow Monitor one should now see how the workflow process, step by step and is completed with without encountering any issues. As a consequence the file is moved from watchfolder to target folder. In addition an item is created in the object repository referencing the ingested file.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.