Customization > Deploying Code and Configuration Package > Customization Examples with CCD > Use Case 1: Customizing and Loading Workflow Templates
Use Case 1: Customizing and Loading Workflow Templates
1. Consider that the following folder structure is of a CCD module that consists of a single workflow template.
<customizationRootDirectory>
├── configurations
│ ├── loadFiles
│ │ └── custom
│ │ └── acmeLoadSet.xml
│ │ ├── workflowTemplate
│ │ │ └── acmeOneLevelRouting_WF.xml
│ │ │ └── acmeOneLevelRouting_WF.zip
2. To transport a new or updated workflow template, you must prepare an XML load file. This load file should be included in a loadFileSet. You must reference that loadFileSet as a <loadFileSet> tag in your deploy.xml.
Following is an example of deploy.xml:
<module>
<loadFileSet>custom/acmeLoadSet.xml</loadFileSet>
</module>
3. The acmeLoadSet.xml file should include <loadFile> tags for each of the load files in your module.
Following is an example of acmeLoadSet.xml:
<?xml version-"1.0"?>
<!-- Xml.UUID=f89506ef-57d5-402a-ab24-053cafced09f -->
<!DOCTYPE loadFileList SYSTEM "/wt/load/windchillLoad.dtd">
<!--
List of files to load in order for Windchill PDMLink demo data.
File formats should follow the format as outlined in the
windchillLoad.dtd At a very minimum the filename
and title should be declared.
-->
<loadFileList>
<loadFile filename="custom/workflowTemplate/CustomOneLevelRouting_WF.xml">
</loadFile>
</loadFileList>
4. Alternatively, if you want to load multiple workflow templates, you can select them all and export the custom workflow templates in a single zip. For more information, see Exporting Workflow Templates.
* 
The export format must be a .ZIP file.
5. Create a loader to load this zip, and place it under configurations/loadFiles as described above for single workflow template.
Following is an example of BusinessRuleLoader.xml:
<?xml version="1.0"?>
<!DOCTYPE NmLoader SYSTEM "standardX24.dtd">
<NmLoader>
<csvExecuteImport handler="wt.load.LoadImport.executeImport">
<csvimportFilename>loadFiles/custom/ixbImport/BusinessRuleObjects.zip
</csvimportFilename>
</csvExecuteImport>
</NmLoader>
6. In the Windchill shell, execute the following command:
ant load.data -Dadministrator.username=<siteadminuser>
The updated workflow template is loaded into the system.
If the workflow template has custom expressions, you must first externalize them. While externalizing, use your package name, such as com.acme.workflow. Then, copy the JAVA files to your custom module, such as <customizationRootDirectory>\<module>\main\src\com\acme\workflow\WorkflowExpression.java
Following is an example of WorkflowExpression.java:
package com.acme.workflow;
public class WorkflowExpression {
public static Object[]
wfAssignedActivityTemplate_189837_START(java.lang.Boolean result) throws Exception {
Object[] wfAutoExternResult = {result};
return wfAutoExternResult;
}//wfAssignedActivityTemplate_189837_START - TRANSITION : null
}
Any subsequent addition or modification of expressions for the workflow will then occur in the Java file in the module and not directly through workflow expressions.
Was this helpful?