(Adding in duplicating a project & verifying it section, for ticket #15457)
|
(Script added)
|
Line 775: | |||
* '''<font color=red>THERE IS A BUG IN THE AnthillClient</font>''' that will cause some errors to appear with the CodestationIndexService. So run this as an evaluate script step instead. | * '''<font color=red>THERE IS A BUG IN THE AnthillClient</font>''' that will cause some errors to appear with the CodestationIndexService. So run this as an evaluate script step instead. | ||
+ | <pre>import com.urbancode.anthill3.persistence.UnitOfWork; | ||
+ | import com.urbancode.anthill3.domain.project.*; | ||
+ | import com.urbancode.anthill3.domain.workflow.*; | ||
+ | /********************************** | ||
+ | * GET THIS JOB'S UNIT OF WORK * | ||
+ | **********************************/ | ||
+ | uow = UnitOfWork.getCurrent(); | ||
+ | /********************************** | ||
+ | * CREATE DUPLICATE OF SOURCE * | ||
+ | **********************************/ | ||
+ | Project srcProj = ProjectFactory.getInstance().restore(11); //CVS Anthill-Example Project (Default) | ||
+ | Project tgtProj = srcProj.duplicate(); | ||
+ | tgtProj.store(); //should create 'CVS Anthill-Example (copy)' | ||
+ | uow.commit(); //commit the change | ||
+ | /********************************** | ||
+ | * DIAGNOSTIC INFORMATION * | ||
+ | **********************************/ | ||
+ | //Original Project Information | ||
+ | commandOutput.println("[SRCPROJ] ID is #" + srcProj.getId()); | ||
+ | commandOutput.println("[SRCPROJ] Name is " + srcProj.getName()); | ||
+ | commandOutput.println("[ ]"); | ||
+ | //Target Project Information (duplicated project info.) | ||
+ | commandOutput.println("[TGTPROJ] ID is #" + tgtProj.getId()); | ||
+ | commandOutput.println("[TGTPROJ] Name is " + tgtProj.getName()); | ||
+ | commandOutput.println("[ ]"); | ||
+ | //Verify all the workflows are present in the new project | ||
+ | for(workflow:tgtProj.getWorkflowArray()){ | ||
+ | commandOutput.println("[TGTPROJ] Workflow found with name " + workflow.getName()); | ||
+ | commandOutput.println("[TGTPROJ] " + workflow.getName() + " has ID #" + workflow.getId()); | ||
+ | } | ||
+ | //End | ||
+ | // Brad M. Galla</pre> | ||
= Dynamic Dependency Selection = | = Dynamic Dependency Selection = | ||