ITPRunCrtRun

The command ITPRunCrtRun is used to run an ITP Model, compile (create) the generated result document to a second model, and run this generated ITP Model. The general use for such a phased setup is to implement variables in the post include files of the first model. Normally, when you run an ITP Model, variables in post include files are not processed anymore. Setting up the initial model in such a way that its result can be compiled and run, will include the result of the variables of the include document(s) in the final result document.

This setup is only needed in special cases in which it is not possible to resolve all variables in the first run.

Note

For efficiency reasons the documents that are post included in the initial ITP Model are in fact not post-included after the first run, but pre-included in the Create phase. This means that you must make sure that these documents are located in the correct includes folder (by default the Includes folder).

Error handling

We advise to use the ITPError handler to handle ITPRunCrtRun errors.

Usage
ITPRunCrtRun     =
Model("initial model by name")
Result("final result document path, name and extension")

The following section is optional. Keys and extras are expected in a certain order from top to bottom in a model. The order in which they are listed here must be the same. Note that it is possible to pass an empty value; value 2 of the Keys below is empty as is value three of the extras Set up keys and extras: this script does NOT support parameter files. Keys and extras must be provided as a list of values, separated by semicolons.

	      Did ("Name of a DID")
Keys("value1;;value3;value4")
Extras("value1;value2;;")
Environment ("name of the environment")

The following section is AS/400 only and optional. See also AS/400 Connection parameters below.

      PreCMD("…")
OnSuccessCMD("…")
OnFailureCMD("…")
PostCMD("…")
;

Note

Closing semicolon is required.

Parameters

Model: Required, string.
The initial model name without the .itp extension. No path, models are always located in the folder Models of the folder ITPWORK within an ITP/Server setup.

However, if a model cannot be placed in the folder Models an absolute path can be used. Note that in a multi machine setup the model must be accessible using the path passed on all machines. This means either placing the model on all machines in the path specified or sharing the location of the model on a machine and passing an UNC path.

Result: Required, string.
Path, name and extension of the final result document. What the format of the result document is depends on the model document used to create the model. If this was a Microsoft Word document (.doc), the result document will be a Microsoft Word document.

Strictly speaking the path is optional, if no path is provided ITP will write the result document in the system folder Temp.

DID: Optional, string.
Name of a DID with which the second model is created. This DID must be located in the folder DID of the folder ITPWORK within you ITP/Server setup. Either a DID must be specified here or a default DID must be set in the configuration file.
For setting a default DID in the configuration file add the following line to the configuration file:

ITPSELECTEDDID=<name of your DID>

This DID also has to be located in the folder DID of the folder ITPWORK of your ITP/Server installation.

Keys: Optional, string.
The Keys that are given here are only passed to the initial model (the first run).

Keys are used to pass information to an ITP Model. You can e.g., use the key to identify the customer for whom you want to create a policy or an invoice. The ITP Model can then use the identifying information to retrieve the full customer name and address.
Keys are passed as a string of values divided by semicolons (;). The sequence must be the same as the order in which they are expected in the model.

It is possible to specify an empty parameter by following a semicolon with another one (;;). This will ensure that the empty parameter will count in the sequence.

Note

This script does not support parameter files.

Extras: Optional, string.
The Extras that are given here are only passed to the initial model (the first run).

Extra parameters are used to pass information to an ITP Model. You can for example use the extra parameters to switch between optional Text Blocks at run time. Extras are typically used to pass information to the model that is not available from the database and that cannot be derived from the database data.
Extras are specified as a string of values divided by semicolons (;). The sequence must be the same as the order in which they are expected in the model.

It is possible to specify an empty parameter by following a semicolon with another one (;;). This will ensure that the empty parameter will count in the sequence.

Environment: Optional, string.
ITP Models are always run in an environment. Here, the name of the environment in which the ITP Model is run can be given. If no environment parameter is given, the default environment will be used to run the model. If an environment is passed that does not exist, an error is given.

The next parameters are AS/400 only.

PreCMD: Optional, string.
The command Pre is executed for the initial model as well as for the second generated model.
Thecommand Pre is executed after the library list is set, but before the model is executed.

OnSuccessCMD: Optional, string.
The command OnSucces is executed for the initial model as well as for the second generated model.
The command OnSuccess is executed if the model is completed successfully.

OnFailureCMD: Optional, string.
The command OnFailure is executed for the initial model as well as for the second generated model.
The command OnFailure is executed if the model failed.

PostCMD: Optional, string.
The command Post is executed for the initial model as well as for the second generated model.
The command Post is executed at the end of the run (after OnSuccess or OnFailure).