A File Document Management step is defined for a File System Connection and defines a command to be executed by the Agentry Server on the host system of the Server in support of transferring files between the Server and the Agentry Client. The command for this step is stored in a text file executed as a script by the Server. This step type also includes a child definition to encapsulate mappings between the file data and the data members of the mobile application. A File Document Management step is defined for a specific definition type within the same module.
A file document management step can define a command to be executed to retrieve a file from a file system or version control system so that it may be transferred to the Agentry Client. The child definition document mapping can then associate this file with an object property, normally of type External Data. It may also define a command that moves a file referenced by an External Data property within a transaction to a permanent location on the file system or version control system. The file is also associated with the property via the document mapping child definition.
The definition for which the step is defined may be an object, transaction, or fetch. The property referencing the file to be transferred should be a child property of the selected definition.
A component of this definition is the Document Management Script. This script contains the command or commands the Agentry Server will execute in support of the file transfer behavior. This script is by default a Windows batch script (.bat). The file extension for the script may be changed to reflect the type of script language it contains.
The document management step can be defined to wait for the command it executes to return, or it can execute the command without waiting. If defined to wait for the command, the next step to be processed in the synchronization will not be run until the command has completed execution, or until a defined wait period has been exceeded. If the wait period is exceeded, the Agentry Server will log an error and synchronization will stop.
For downstream synchronization, i.e. fetch, push, or object read step processing, the command is expected to product a file to be transferred to the Agentry Client. For upstream synchronization, i.e. transaction processing, the command is expected to process the file after it has been transferred from the Agentry Client to the Server’s host system. This may include moving it to another location on the file system, or checking it in or updating it to a version control system, or any other post-transfer processing that should occur for the file.
In addition to the file itself, it is also possible to capture values from the document management command run by the step. This is behavior is also defined in the child definition document mapping. Return values, error codes, and similar data can be assigned to properties of the appropriate data type.
The contents of the script file for this step type may be accessed directly on the Agentry Development Server for the application project. The file path listed for this file is relative to the installation location of this Server. If this file is modified it is not necessary to publish the application project for the change to be exhibited. In a production environment this file is not directly accessible in this manner and must be modified through the Agentry Editor. Changes made in a production environment must be published.
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.
ServerDirectory\Application\Development\Scripts
where ServerDirectory is the installation location of the Agentry Development Server.