Hello, I'm using Apache Commons Chains to run a series of commands that acomplish a task. My current catalog looks like this:
CODE
<?xml version="1.0" ?>
<!--
| Configures chains of commands for processing metadata.
|
| TODO add configurability to commands ?
-->
<catalog>
<!-- Process HFIR TAS metadata. -->
<chain name="ProcessHfirTasRun">
<!-- Parse HFIR scan file and add properties to context. -->
<command className="gov.ornl.sns.translation.process.commands.hfir.ParseScanFile" />
<!-- Parse HFIR "Proposal" file and add to context. -->
<command className="gov.ornl.sns.translation.process.commands.hfir.LoadProposalFile" />
<!-- Generate properties from proposal information for the scan. -->
<command className="gov.ornl.sns.translation.process.commands.hfir.SetExperimentProperties" />
<!-- Special processing for some HFIR properties (dates, users). -->
<command className="gov.ornl.sns.translation.process.commands.hfir.ProcessHfirProperties" />
<!-- Uses metadata mappings to create DOM. -->
<command className="gov.ornl.sns.translation.process.commands.CreateMetadataDocument" />
<!-- Validate DOM against XML schema. -->
<command className="gov.ornl.sns.translation.process.commands.ValidateMetadataDocument" />
<!-- Save DOM as file. -->
<command className="gov.ornl.sns.translation.process.commands.SaveMetadataDocument" />
</chain>
<!-- Process HFIR SANS metadata -->
<chain name="ProcessHfirSansRun">
<!-- Parse the HFIR sans file and add properties to context -->
<command className="gov.ornl.sns.translation.process.commands.hfir.ParseSansFile" />
<!-- Uses metadata mappings to create DOM. -->
<command className="gov.ornl.sns.translation.process.commands.CreateMetadataDocument" />
<!-- Validate DOM against XML schema. -->
<command className="gov.ornl.sns.translation.process.commands.ValidateMetadataDocument" />
<!-- Save DOM as file. -->
<command className="gov.ornl.sns.translation.process.commands.SaveMetadataDocument" />
</chain>
<!-- Process Tarball Run. -->
<chain name="ProcessTARBRun">
<!-- Runs an MD5 checksum to ensure the file wasn't corrupted -->
<command className="gov.ornl.sns.translation.process.commands.CheckMD5OnFile" />
<!-- Untar the file -->
<command className="gov.ornl.sns.translation.process.commands.UntarFile" />
</chain>
<chain name="ProcessIPNSRun">
<!-- Parse the IPNS file and add properties to context -->
<command className="gov.ornl.sns.translation.process.commands.hfir.ParseIPNSFile" />
<!-- Uses metadata mappings to create DOM. -->
<command className="gov.ornl.sns.translation.process.commands.CreateMetadataDocument" />
<!-- Validate DOM against XML schema. -->
<command className="gov.ornl.sns.translation.process.commands.ValidateMetadataDocument" />
<!-- Save DOM as file. -->
<command className="gov.ornl.sns.translation.process.commands.SaveMetadataDocument" />
</chain>
</catalog>
As you can see, the Create/Validate/Save Metadata commands are run often and I would like to create a separate chain in this catalog and then just run that chain in each chain above that uses these commands. What is the exact syntax to do that? Thank you for any suggestions.
Joe Mansour