示例#1
0
        /// <summary>
        /// Processes the documents of a batch
        /// </summary>
        /// <param name="batch">The batch to process</param>
        public void ProcessBatch(IBatch batch)
        {
            IACDataElement rootElement  = batch.ExtractRuntimeACDataElement(0);
            IACDataElement batchElement = rootElement.FindChildElementByName(BATCH);

            IACDataElementCollection currentDocuments = GetElementsByName(batchElement, DOCUMENTS, DOCUMENT);

            for (int i = 0; i < currentDocuments.Count; i++)
            {
                int            currentDocumentIndex = i + 1;
                IACDataElement currentDocument      = currentDocuments[currentDocumentIndex];

                Dictionary <string, string> batchFields = GetKofaxFields(batchElement, BATCH_FIELDS, BATCH_FIELD);
                Dictionary <string, string> indexFields = GetKofaxFields(currentDocument, INDEX_FIELDS, INDEX_FIELD);
                // Dictionary<string, string> batchVariables = GetKofaxFields(batchElement, ...);

                // access settings
                // batch.get_CustomStorageString("key");

                string documentFilePath = currentDocument[PDF_GENERATION_FILE_NAME];

                // ...
            }

            batch.BatchClose(KfxDbState.KfxDbBatchReady, KfxDbQueue.KfxDbQueueNext, 0, "");
        }
        private IACDataElement GetBatchElementFromBatch(IBatch batch)
        {
            IACDataElement rootElement = batch.ExtractRuntimeACDataElement(0);

            return(rootElement.FindChildElementByName(Resources.BATCH));
        }