This procedure describes how to define the steps and step usage definitions to retrieve files from the back end system to be transferred to the Agentry Client. In the example used here the files are stored in the version control system Subversion. As a part of downloading the files, the command line process export is used. This process extracts a revision of a specific file from the repository and copies it to a designated location on the file system. This copy is not maintained by the version control system, which is a desirable behavior for this logic as the copy we create will be temporary and will be removed when the Agentry Server has finished transferring it.
This procedure describes what information is needed prior to the retrieval of the actual steps. How this information is retrieved will vary from one system and one back end type to the next. However, the general information required for this processing is the same.
As will be illustrated in the portion of this procedure related to the object read steps, one of the key items is to define the proper run behavior for the Document Management step that actually retrieves the files. Files are retrieved one at a time. Therefore, the document management step must be defined to run once for each file to be retrieved. This is controlled by the Run attribute of the object read step definition that uses the document management step. Note that only the object read step definition type contains the proper setting for the Run attribute. This step cannot be run to retrieve files in a fetch step usage definition.
In order for the document management step to run properly, therefore, the files to be retrieved must be known in advance. This is a part of the general information retrieved from the back end, where presumably the information relating the files to the business objects is located. this information is used to instantiate the file objects and, therefore, must include the value of the key property for each of those objects. In the architecture recommended here, this is the name of the file to be retrieved as it will be stored on the Agentry Client.
In this example, the Customer object contains a collection of file objects named Documents. A fetch already exists to synchronize the Customers collection, including it’s nested collections Orders and Products. To this processing we will add the steps to get the document objects and the actual files to be referenced by those objects.
If not already accomplished, the user interface to display a list of the files downloaded, as well as to possibly allow the user to display those files and edit them needs to be implemented. See the procedures in this tutorial on the user interface and actions related to the files downloaded to the Agentry Client.