use of org.apache.oozie.executor.jpa.WorkflowIdGetForExternalIdJPAExecutor in project oozie by apache.
the class ExternalIdXCommand method execute.
@Override
protected String execute() throws CommandException {
try {
JPAService jpaService = Services.get().get(JPAService.class);
String wfId = null;
if (jpaService != null) {
wfId = jpaService.execute(new WorkflowIdGetForExternalIdJPAExecutor(externalId));
} else {
LOG.error(ErrorCode.E0610);
}
return wfId;
} catch (XException ex) {
throw new CommandException(ex);
}
}
use of org.apache.oozie.executor.jpa.WorkflowIdGetForExternalIdJPAExecutor in project oozie by apache.
the class TestWorkflowIdGetForExternalIdJPAExecutor method _testGetJobIdForExternalId.
private void _testGetJobIdForExternalId(String jobId) throws Exception {
JPAService jpaService = Services.get().get(JPAService.class);
assertNotNull(jpaService);
WorkflowIdGetForExternalIdJPAExecutor wfIdGetCmd = new WorkflowIdGetForExternalIdJPAExecutor("external-id");
String ret = jpaService.execute(wfIdGetCmd);
assertNotNull(ret);
assertEquals(jobId, ret);
}
Aggregations