|
|
+ |
This page lists event trigger scripts to be used in conjunction with workflow triggers. These scripts were taken straight from the [https://bugs.urbancode.com/secure/IssueNavigator.jspa?reset=true&&pid=10110&sorter/field=issuekey&sorter/order=ASC public JIRA site]. Please note that some scripts may be ''snippets'' and '''probably WILL need''' modification to work properly for your situation. Treat these as templates that you can modify from.
|
|
|
+ |
= Determine If a Secondary Workflow Has Been Run on BuildLife =
|
|
|
+ |
This script will determine if a secondary workflow has ran on a buildlife (with a success status). If it has, it will not trigger the workflow again.
|
|
|
+ |
* '''Build Workflow''' should be changed to the name of the users Build Workflow
|
|
|
+ |
* '''Deploy Workflow''' should be changed to the name of the users secondary workflow.
|
|
|
+ |
<pre>import com.urbancode.anthill3.domain.workflow.*;
|
|
|
+ |
import com.urbancode.anthill3.domain.buildlife.*;
|
|
|
+ |
import com.urbancode.anthill3.runtime.scripting.helpers.*;
|
|
|
+ |
BuildLife bl = BuildLifeLookup.mostRecentSuccessForProjectAndWorkflowName(project, "Build Workflow");
|
|
|
+ |
WorkflowCase[] wc = WorkflowCaseFactory.getInstance().restoreArrayForBuildLife(bl);
|
|
|
+ |
String msw = "Deploy Workflow";
|
|
|
+ |
//check to see that the secondary workflow ran, and was a success.
|
|
|
+ |
for(int i = 0; i<wc.length; i++){
|
|
|
+ |
if(wc[i].getName().equals(msw)){
|