use of com.centurylink.mdw.model.value.process.ProcessVO in project mdw-designer by CenturyLinkCloud.
the class ControlCommandShell method performDeleteProcess.
private void performDeleteProcess(TestFileLine line) throws Exception {
logCommand(line);
String procName = parseProcessName(line.getWord(1));
int version = parseProcessVersion(line.getWord(1));
ProcessVO vo;
try {
vo = dao.getProcessDefinition(procName, version);
dao.removeProcess(vo, true);
} catch (Exception e) {
log.println("Failed to delete process " + e.getClass().getName() + ": " + e.getMessage());
}
}
use of com.centurylink.mdw.model.value.process.ProcessVO in project mdw-designer by CenturyLinkCloud.
the class GroovyTestCaseRun method getProcess.
ProcessVO getProcess(String target) throws TestException {
// qualify vcs asset processes
if (target.indexOf('/') == -1 && testCaseAsset != null && testCaseAsset.exists())
target = testCaseAsset.getPackageName() + "/" + target;
ProcessVO vo = processCache.get(target);
if (vo == null) {
try {
String procName = target;
// latest
int version = 0;
int spaceV = target.lastIndexOf(" v");
if (spaceV > 0) {
try {
version = RuleSetVO.parseVersionSpec(procName.substring(spaceV + 2));
procName = target.substring(0, spaceV);
} catch (NumberFormatException ex) {
// process name must have space v
}
}
if (testCaseAsset == null || !testCaseAsset.isVcs()) {
// trim qualifying package name for old-style
int lastSlash = procName.lastIndexOf('/');
if (lastSlash >= 0)
procName = procName.substring(lastSlash + 1);
}
vo = dao.getProcessDefinition(procName, version);
if (vo == null)
throw new TestException("Process: " + target + " not found");
vo = dao.getProcess(vo.getId(), vo);
} catch (TestException ex) {
throw ex;
} catch (Exception ex) {
throw new TestException("Cannot load " + target, ex);
}
}
return vo;
}
use of com.centurylink.mdw.model.value.process.ProcessVO in project mdw-designer by CenturyLinkCloud.
the class GroovyTestCaseScript method processes.
public TestCaseProcess[] processes(String... targets) throws TestException {
List<TestCaseProcess> processes = new ArrayList<TestCaseProcess>();
for (int i = 0; i < targets.length; i++) {
try {
ProcessVO processVo = getTestCaseRun().getProcess(targets[i]);
processes.add(new TestCaseProcess(processVo));
} catch (TestException ex) {
getTestCaseRun().log.println("Failed to load process " + targets[i]);
if (// by convention > 0 are subprocesses where
i == 0)
// exception is expected
throw ex;
}
}
return processes.toArray(new TestCaseProcess[0]);
}
use of com.centurylink.mdw.model.value.process.ProcessVO in project mdw-designer by CenturyLinkCloud.
the class TestCaseRun method getProcess.
private ProcessVO getProcess(TestFileLine line, String word) throws TestException {
ProcessVO vo = processCache.get(word);
if (vo == null) {
try {
String procName = parseProcessName(word);
int version = parseProcessVersion(word);
vo = dao.getProcessDefinition(procName, version);
vo = dao.getProcess(vo.getProcessId(), vo);
processCache.put(word, vo);
} catch (Exception e) {
throw new TestException(line, e.getMessage());
}
}
return vo;
}
use of com.centurylink.mdw.model.value.process.ProcessVO in project mdw-designer by CenturyLinkCloud.
the class TestCaseRun method getWaitKey.
private String getWaitKey(TestFileLine line, String masterRequestId) throws TestException {
ProcessVO vo = getProcess(line, line.getWord(1));
Long activityId;
String status;
if (line.getWordCount() == 5) {
// wait process_name act_logical_id status timeout
activityId = getActivityId(vo, line.getWord(2));
status = line.getWord(3);
} else if (line.getWordCount() == 4) {
// wait process_name act_logical_id timeout
activityId = getActivityId(vo, line.getWord(2));
status = WorkStatus.STATUSNAME_COMPLETED;
} else {
// wait process_name timeout
activityId = 0L;
status = WorkStatus.STATUSNAME_COMPLETED;
}
if (activityId == null)
throw new TestException(line, "Cannot find activity with logical id " + line.getWord(2));
return monitor.createKey(masterRequestId, vo.getProcessId(), activityId, status);
}
Aggregations