use of com.walmartlabs.concord.client.ProcessEntry in project concord by walmartlabs.
the class ProcessIT method testMetaWithExit.
/**
* Test the process metadata with exit step.
*/
@Test
public void testMetaWithExit() throws Exception {
Payload payload = new Payload().archive(resource("exitWithMeta")).arg("name", "Concord");
ConcordProcess proc = concord.processes().start(payload);
ProcessEntry pe = expectStatus(proc, ProcessEntry.StatusEnum.FINISHED);
// ---
proc.assertLog(".*Hello, Concord!.*");
assertNotNull(pe.getMeta());
assertEquals("init-value", pe.getMeta().get("test"));
}
use of com.walmartlabs.concord.client.ProcessEntry in project concord by walmartlabs.
the class AbstractGeneralTriggerIT method waitProcesses.
protected Map<ProcessEntry.StatusEnum, ProcessEntry> waitProcesses(String orgName, String projectName, ProcessEntry.StatusEnum first, ProcessEntry.StatusEnum... more) throws Exception {
ProcessApi processApi = new ProcessApi(getApiClient());
List<ProcessEntry> processes;
while (true) {
processes = processApi.list(orgName, projectName, null, null, null, null, null, null, null, null, null);
if (processes.size() == 1 + (more != null ? more.length : 0)) {
break;
}
Thread.sleep(1000);
}
Map<ProcessEntry.StatusEnum, ProcessEntry> ps = new HashMap<>();
for (ProcessEntry p : processes) {
ProcessEntry pir = waitForStatus(processApi, p.getInstanceId(), first, more);
ProcessEntry pe = ps.put(pir.getStatus(), pir);
if (pe != null) {
throw new RuntimeException("already got process with '" + pe.getStatus() + "' status, id: " + pe.getInstanceId());
}
}
return ps;
}
use of com.walmartlabs.concord.client.ProcessEntry in project concord by walmartlabs.
the class ProcessIT method testOnFailureVariables2.
@Test
public void testOnFailureVariables2() throws Exception {
ConcordProcess proc = concord.processes().start(new Payload().archive(resource("onFailureVars2")));
proc.expectStatus(StatusEnum.FAILED);
// wait for the onFailure process
ConcordProcess onFailureProc;
while (true) {
List<ProcessEntry> l = proc.subprocesses();
if (!l.isEmpty()) {
onFailureProc = concord.processes().get(l.get(0).getInstanceId());
break;
}
Thread.sleep(1000);
}
onFailureProc.expectStatus(StatusEnum.FINISHED);
onFailureProc.assertLog(".*abc: Hello.*");
onFailureProc.assertLog(".*Last error was:.*PropertyNotFoundException.*");
}
use of com.walmartlabs.concord.client.ProcessEntry in project concord by walmartlabs.
the class ProcessIT method testGetProcessErrorMessageFromBpmnError.
@Test
public void testGetProcessErrorMessageFromBpmnError() throws Exception {
byte[] archive = archive(ProcessIT.class.getResource("throwBpmnError").toURI());
// start the process
ConcordProcess proc = concord.processes().start(new Payload().archive(archive));
// wait for completion
ProcessEntry pe = proc.expectStatus(StatusEnum.FAILED);
assertProcessErrorMessage(pe, ".*myBnpmError.*");
}
use of com.walmartlabs.concord.client.ProcessEntry in project concord by walmartlabs.
the class ProcessIT method testDisableProcess.
@Test
public void testDisableProcess() throws Exception {
byte[] archive = archive(ProcessIT.class.getResource("disableProcess").toURI());
// ---
ConcordProcess proc = concord.processes().start(new Payload().archive(archive));
// ---
proc.expectStatus(StatusEnum.FINISHED);
// ---
ProcessEntry pe = proc.disable();
assertTrue(pe.isDisabled());
}
Aggregations