Developer

Document Mapping

A document mapping definition is a child to a file document management step and defines the correlation between the file produced by that step to a property definition, normally of type External Data. The specific behavior of a document mapping differs depending on the type of definition for which the parent step was defined. For objects and fetches, the document mapping defines where and how to access the file produced by the parent step’s command. For a transaction, the document mapping defines how and where the file should be provided to the step’s command.

Because of the differences between a document mapping for an object and fetch, and one for a transaction, there are different attributes for this definition type depending the how the parent step has been defined.

When a document mapping is defined within a file document management step for an object or fetch, the purpose of the document mapping is to capture output from the parent step definitions document script and map it to a property within the object or fetch. This output is primarily intended to be a file that is mapped to an external data property. This file will be transferred down to the Agentry Client. Other outputs may be captured from the document script, including output written to standard out and standard error, as well as the command’s exit code as returned to the operating system.

When a document mapping is defined within a file document management step for a transaction, the purpose of the document mapping is to provide the contents of a property to the parent step definition’s document script. This input to the command may be provided from an external data property and passed to the command by either writing the file to the file system, or by piping it to the commands standard input. When piped to standard input, the option exists to pass the EOF character to that command after all file data has been passed in. When writing the file to the file system, the command is then expected to look for the file at that location and process it accordingly. When the command has completed processing the file, the option exists to delete the file from the file system. Note that this option will not be available if the parent document management step has been defined to not wait for the document script to complete execution.

Document Mapping Attributes - Object and Fetch

  • Property: This attributes specifies the property to which the output from the parent step’s command will be mapped. For a file produced by the command this should be a property of type External Data. For other output types, the proper data type of the property will vary.
  • Output Type: This attribute specifies which output from the command to map to the selected property. The options to this attribute are:
    • Command Exit Code: This selection specifies that the exit code returned by the command to the operating system should be captured and mapped to the selected property.
    • File Created By Command: This selection specifies that a file created by the command should be mapped to the selected property. For this output type the Property attribute should be set to a property of type External Data.
    • STDERR: This selection specifies that any output written by the command to standard error should be mapped to the selected property. This may be done to determine if an error has occurred, and the nature of that error.
    • STDOUT: This selection specifies that any output written by the command to standard out should be mapped to the selected property.
  • File Name: This attribute is enabled when the selected Output Type is “File Created By Command.” The File Name attribute specifies the name of the file to be mapped to the selected property. This value may include SDML tags, with the default being <<script>>-1.tmp.
  • Delete File: This attribute is enabled when the selected Output Type is “File Created By Command.” The Delete File attribute specifies whether to keep the file created by the command after it has been transferred, or if it should be deleted.

Document Mapping Attributes - Transaction

  • Property: This attribute specifies the transaction property containing the value to be passed to the document command. If the Input Type is “File Input to Command Line,” this should be an External Data property.
  • Input Type: This attribute specifies how the value or file referenced by the selected property will be passed to the document command of the parent step. This can be set to one of the following options:
    • File Input to Command Line: This selection specifies that file referenced by the selected property should be written to the file system and that the command will the read it in from that location. The File Name attribute is enabled when this option is selected, and specifies the file name to which the file will be saved.
    • STDIN: This selection specifies that the value of the selected property should be piped to the document command through standard input. For external data properties the file data will be streamed directly to the command without being written to the file system. When this selection is made the Send EOF attribute is enabled, indicating whether the EOF character should be sent to the command after the property data as been piped to the command.
  • File Name: This attribute is enabled when the Input Type attribute is set to “File Input to Command Line.” This attribute contains the name to be given to the file when it is saved to the file system. This value may include SDML tags. It is set to <<script>>-1.tmp by default.
  • Delete: This attribute is enabled when the Input Type attribute is set to “File Input to Command Line.” The Delete attributes specifies whether the file saved to the file system by the Server should be deleted after the document command has finished processing it.
  • Send EOF: This attribute is enabled when the Input Type attribute is set to “STDIN.” This attribute specifies whether or not to send an End of File character to the document command at the end of the file data. This is provided in support of those processes that require this character to indicate no further input is being sent.