University of Arizona
Dashboard > Kuali Implementation Technical Team > ... > Workflow Ingester Batch Process Technical Specification > WorkflowXmlIngestionStep
Site Search:

View Attachments (0) Info

WorkflowXmlIngestionStep

Create class WorkflowXmlIngestionStep in org.kuali.kfs.sys.batch. ProcurementCardLoadStep can be used as an example. According to Batch 3 documentation, add an execute method to the step.

package org.kuali.kfs.sys.batch;
...
import edu.iu.uis.eden.batch.CompositeXmlDocCollection;
import edu.iu.uis.eden.batch.FileXmlDocCollection;
import edu.iu.uis.eden.batch.XmlDoc;
import edu.iu.uis.eden.batch.XmlDocCollection;
import edu.iu.uis.eden.util.Utilities;
import edu.iu.uis.eden.web.UserLoginFilter;
import org.kuali.kfs.sys.batch.AbstractStep;

import org.apache.log4j.Logger;
...

public class WorkflowXmlIngestionStep extends AbstractStep {

    public boolean execute(String jobName) throws InterruptedException {
        ...
    }
}
The return value of the execute() method does not determine whether the Step succeeded or failed. Rather, whether the additional steps should be run or not. Any step failure is described through an InterruptedException

In the execute() Method

This is where a majority of the functionality will go.

Reading Files

  • Load the KualiConfigurationService from the KewServiceLocator
  • All XML files from
    ${staging.directory}/ingester
    should be read.
    • Do not traverse the directory
    • Use the ConfigurationService to get the
      ${staging.directory}
      kualiConfigurationService.getPropertyString(KFSConstants.STAGING_DIRECTORY_KEY)
    • Create an XmlDocCollection from the xml files found

Ingestion

After files are read from

  • Load the XmlIngesterService from the KewServiceLocator
  • Call the ingest() method on the service passing in a XmlDocCollection of files.

Creating Log

This happens automatically through the framework. There is no need to worry about the log.

  • Use Logger from the org.apache.log4j framework to do logging.
    private static final Logger LOG = Logger.getLogger(WorkflowXmlIngestionStep.class);
  • Log start and stop times of the step
  • Log number of Documents Ingested Successfully
  • Log filenames that failed to load

Spring

Create a workflowXmlIngestionStep

Create an entry in Spring for the step. Inject the KualiConfigurationService and XmlIngesterService into the Step.

<bean id="workflowXmlIngestionStep" class="org.kuali.kfs.sys.batch.WorkflowXmlIngestionStep" parent="step">
    <property name="xmlIngesterService"        ref="xmlIngesterService" />
    <property name="kualiConfigurationService" ref="kualiConfigurationService" />
</bean>

View a printable version of the current page.

Browse Space
- Pages
- Labels
- Attachments
- Mail
- Bookmarks
- News
- Activity
- Advanced

Explore Confluence
- Popular Labels
- Notation Guide

Your Account
Log In

 

Add Content


Powered by Atlassian Confluence 1115, the Enterprise Wiki.. Contact administrators.