Use the CompileInstanceScripts tool

In the Docker environment, to update and compile the constants, user scripts, and user library scripts for KCM Core, use the CompileInstanceScripts tool. This tool does not operate on a KCM Core instance directly. Instead, it uses a folder on the Docker container. This allows the synchronization between two locations using a pull operation and push operation. Between these operations, the folder on the Docker container can be manipulated.

The scripts folder must follow certain rules to be compiled and applied successfully. We recommend that you always start with a pull command to get this folder as it has the correct structure and contains the required exit points. In addition, this folder shows the KCM Core services currently running on the instance, so that you can avoid pushing an incomplete set of scripts.

Pull scripts

You can use the CompileInstanceScripts tool to pull the complete set of the KCM Core scripts and constants of the running instance container into the given folder. It will populate the folder with the following components:

  • The script specification file. This XML file contains the constant definitions as well as the KCM Core service definitions.

  • The XSD file that the script specification file needs to adhere to.

  • The scripts that implement the KCM Core services.

For more details about the KCM Core scripting, see the Kofax Communications Manager Core Scripting Language Developer's Guide.

Push scripts

You can use the CompileInstanceScripts tool to push the scripts and the specification file from the given folder into the running Docker instance container, which will compile the scripts.

KCM Core will not use the newly pushed scripts until they are applied successfully. When pushing these scripts, set the Script!Apply parameter to true. The scripts will be applied if no compilation errors occur.

For more details, see the Kofax Communications Manager Core Scripting Language Developer's Guide.

Parameters

The following table lists and describes the CompileInstanceScripts tool parameters.

Parameter Required / Optional Description
Scripts!Direction Optional. Defaults to Push.
  • Pull: Stores the scripts as active on the container in the given Scripts!Folder. Writes the specifications to the CompileInstanceScripts.xml file containing the script specification, as well as to the CompileInstanceScripts.xsd file describing the structure of the XML document that the script specification file needs to adhere to.

    Any changes in this folder that are not yet successfully pushed and applied will be overwritten by the currently active scripts.

  • Push: Pushes the scripts from the given Scripts!Folder and the CompileInstanceScripts.xml specification file to the Docker container and compiles the scripts according to the specifications. These scripts are applied if the compilation succeeds and the parameter Scripts!Apply is set to true.

Scripts!Folder Required

The folder containing the scripts to update. When pushing, the folder must contain the following components:

  • The compileinstancescripts.xml file that adheres to the compileinstancescripts.xsd file.
  • The Userlibrary subfolder with the Userlibrary scripts.

Scripts!Apply=<true or false> Optional

When set to True, applies the results of the script compilation to KCM Core. Only applicable when Scripts!Direction is set to push. The result is applied only if no compilation errors are reported.

By default, is set to False.

Instance!Number Required when not on Docker. Indicates the instance for which scripts should be compiled.

On Docker, this parameter must be omitted. It is provided for future compatibility with non-Docker installations.

Example

See the following example of the CompileInstanceScripts.xml specification file:

<?xml version="1.0" encoding="utf-8"?>
<Configuration Version="5.0" xmlns="urn:KCCMConfigExport5">
	<Instance Version="5.5" >
		<Environment key="WatermarkPdfConcept" value="watermarkconcept.pdf" />
		<Environment key="AllowRepositoryModelRun" value="Y" />
		<Environment key="_ValidateInput" value="N" />
  ...
  <Environment key="MyConstant" value="myvalue> 
		<Service Name="RunMdl">
			<Parameter Name="Model" Value="$1" />
			<Parameter Name="Result" Value="$2" />
			<Parameter Name="Keys" Value="$3" />
			<Parameter Name="Extras" Value="$4" />
			<Parameter Name="Environment" Value="$5" />
			<Parameter Name="MetaData" Value="$6" />
			<Parameter Name="DBB_XMLInput" Value="$7" />
			<Parameter Name="DBB_XMLOutput" Value="$8" />
		</Service>
		<Service Name="RunDocumentPackTemplate">
			<Parameter Name="DocumentPackTemplate" Value="$1" />
			<Parameter Name="Result" Value="$2" />
			<Parameter Name="Environment" Value="$3" />
			<Parameter Name="DBB_XMLInput" Value="$4" />
		</Service>
  ...
		<Service Name="MyScripts">
			<Parameter Name="MyParameter" Value="$1" />
		</Service>
	</Instance>
</Configuration>