|
|
+ |
= Run Non-Originating Workflow On Latest BuildLife If Haven't Already =
|
|
|
+ |
This script applies to build lives created by the "Run" workflow of the project.
|
|
|
+ |
<pre>import com.urbancode.anthill3.domain.workflow.*;
|
|
|
+ |
buildLife = BuildLifeLookup.mostRecentSuccessForProjectAndWorkflowName(project, "Run");
|
|
|
+ |
workflows = WorkflowCaseFactory.getInstance().restoreArrayForBuildLife(buildLife);
|
|
|
+ |
for (int w=0; w<workflows.length; w++) {
|
|
|
+ |
if (workflow.equals(workflows[w].getWorkflow())) {
|
|
|
+ |
System.out.println("Workflow found, not running secondary workflow");
|
|
|
+ |
In 3.5 and later you can use:
|
|
|
+ |
<pre>buildLife = BuildLifeLookup.mostRecentSuccessForProjectAndWorkflowName(project, "Run");
|
|
|
+ |
if (BuildLifeLookup.hasExecutedSecondaryWorkflow(buildLife, workflow)) {
|