-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reapply changes in ActivitiTester for faster SA execution
- Loading branch information
1 parent
b4101e0
commit 910eaae
Showing
2 changed files
with
73 additions
and
33 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
src/main/groovy/betsy/bpmn/engines/activiti/ActivitiApiBasedProcessOutcomeChecker.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package betsy.bpmn.engines.activiti; | ||
|
||
import betsy.bpmn.engines.BPMNProcessInstanceOutcomeChecker; | ||
import betsy.bpmn.engines.JsonHelper; | ||
import org.json.JSONObject; | ||
|
||
|
||
public class ActivitiApiBasedProcessOutcomeChecker implements BPMNProcessInstanceOutcomeChecker { | ||
|
||
@Override | ||
public ProcessInstanceOutcome checkProcessOutcome(String name) { | ||
return isProcessDeployed(name) ? ProcessInstanceOutcome.OK : ProcessInstanceOutcome.UNDEPLOYED_PROCESS; | ||
} | ||
|
||
private boolean isProcessDeployed(String key) { | ||
String checkDeploymentUrl = ActivitiEngine.URL + "/service/repository/deployments?name="+key+".bpmn"; | ||
|
||
JSONObject result = JsonHelper.get(checkDeploymentUrl, 200); | ||
if(result.getInt("size")!=1) { | ||
return false; | ||
} | ||
|
||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters