Search in sources :

Example 11 with WorkflowActionInsertJPAExecutor

use of org.apache.oozie.executor.jpa.WorkflowActionInsertJPAExecutor in project oozie by apache.

the class XDataTestCase method addRecordToWfActionTable.

protected WorkflowActionBean addRecordToWfActionTable(String wfId, String actionName, WorkflowAction.Status status, String execPath, boolean pending) throws Exception {
    WorkflowActionBean action = createWorkflowAction(wfId, actionName, status, pending);
    action.setExecutionPath(execPath);
    try {
        JPAService jpaService = Services.get().get(JPAService.class);
        assertNotNull(jpaService);
        WorkflowActionInsertJPAExecutor actionInsertCmd = new WorkflowActionInsertJPAExecutor(action);
        jpaService.execute(actionInsertCmd);
    } catch (JPAExecutorException je) {
        je.printStackTrace();
        fail("Unable to insert the test wf action record to table");
        throw je;
    }
    return action;
}
Also used : JPAExecutorException(org.apache.oozie.executor.jpa.JPAExecutorException) WorkflowActionInsertJPAExecutor(org.apache.oozie.executor.jpa.WorkflowActionInsertJPAExecutor) JPAService(org.apache.oozie.service.JPAService) WorkflowActionBean(org.apache.oozie.WorkflowActionBean)

Aggregations

WorkflowActionBean (org.apache.oozie.WorkflowActionBean)11 WorkflowActionInsertJPAExecutor (org.apache.oozie.executor.jpa.WorkflowActionInsertJPAExecutor)11 JPAExecutorException (org.apache.oozie.executor.jpa.JPAExecutorException)9 JPAService (org.apache.oozie.service.JPAService)7 Date (java.util.Date)4 IOException (java.io.IOException)1 SimpleDateFormat (java.text.SimpleDateFormat)1 Configuration (org.apache.hadoop.conf.Configuration)1 WorkflowJobBean (org.apache.oozie.WorkflowJobBean)1 MapReduceActionExecutor (org.apache.oozie.action.hadoop.MapReduceActionExecutor)1 MapperReducerForTest (org.apache.oozie.action.hadoop.MapperReducerForTest)1 ActionExecutorContext (org.apache.oozie.command.wf.ActionXCommand.ActionExecutorContext)1 WorkflowActionGetJPAExecutor (org.apache.oozie.executor.jpa.WorkflowActionGetJPAExecutor)1 RecoveryRunnable (org.apache.oozie.service.RecoveryService.RecoveryRunnable)1 XConfiguration (org.apache.oozie.util.XConfiguration)1 FailingDBHelperForTest (org.apache.oozie.util.db.FailingDBHelperForTest)1 Test (org.junit.Test)1