Beispiel #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 GetCustomStorageStringsFromBatch(IBatch batch)
        {
            IACDataElement           setupElement = batch.ExtractSetupACDataElement(0);
            IACDataElementCollection batchClasses = GetElementsByName(setupElement, Resources.BATCH_CLASSES, Resources.BATCH_CLASS);
            IACDataElement           batchClass   = batchClasses[1];

            return(batchClass.FindChildElementByName(Resources.BATCH_CLASS_CUSTOM_STORAGE_STRINGS));
        }
Beispiel #3
0
 /// <summary>
 /// Searches for items by their name in a given IACDataElementCollection
 /// </summary>
 /// <param name="dataElement">The item containing the target items as children</param>
 /// <param name="rootName">Top level name</param>
 /// <param name="targetName">Target level name</param>
 /// <returns>The target items</returns>
 private IACDataElementCollection GetElementsByName(IACDataElement dataElement, string rootName, string targetName)
 {
     return(dataElement.FindChildElementByName(rootName).FindChildElementsByName(targetName));
 }
        private IACDataElement GetBatchElementFromBatch(IBatch batch)
        {
            IACDataElement rootElement = batch.ExtractRuntimeACDataElement(0);

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