Examples of WorkflowAction


Examples of co.cask.cdap.api.workflow.WorkflowAction

    int step = 0;
    while (running && iterator.hasNext()) {
      WorkflowActionSpecification actionSpec = iterator.next();
      workflowStatus = new WorkflowStatus(state(), actionSpec, step++);

      WorkflowAction action = initialize(actionSpec, classLoader, instantiator);
      try {
        action.run();
      } catch (Throwable t) {
        LOG.warn("Exception on WorkflowAction.run(), aborting Workflow. {}", actionSpec);
        // this will always rethrow
        Throwables.propagateIfPossible(t, Exception.class);
      } finally {
View Full Code Here

Examples of com.agiletec.plugins.jpcontentworkflow.apsadmin.workflow.WorkflowAction

 
  public void testEdit() throws Throwable {
    String typeCode = "ART";
    String result = this.executeEdit("admin", typeCode);
    assertEquals(Action.SUCCESS, result);
    WorkflowAction action = (WorkflowAction) this.getAction();
    String role = this._workflowManager.getRole(typeCode);
    assertEquals(role, action.getRole());
  }
View Full Code Here

Examples of com.dotmarketing.portlets.workflows.model.WorkflowAction

                        List<WorkflowTask> tasks=wapi.findExpiredTasks();
                        for (WorkflowTask task : tasks) {
                            String stepId=task.getStatus();
                            WorkflowStep step=wapi.findStep(stepId);
                            String actionId=step.getEscalationAction();
                            WorkflowAction action=wapi.findAction(actionId, APILocator.getUserAPI().getSystemUser());
                           
                            Logger.info(this, "Task '"+task.getTitle()+"' " +
                                    "on contentlet id '"+task.getWebasset()+"' "+
                                "timeout on step '"+step.getName()+"' " +
                                "excecuting escalation action '"+action.getName()+"'");
                           
                            // find contentlet for default language
                            Contentlet def=APILocator.getContentletAPI().findContentletByIdentifier(task.getWebasset(), false,
                                    APILocator.getLanguageAPI().getDefaultLanguage().getId(),
                                    APILocator.getUserAPI().getSystemUser(), false);
                            String inode=def.getInode();
                           
                            Contentlet c;

                            // if the worflow requires a checkin
                            if(action.requiresCheckout()){
                                c = APILocator.getContentletAPI().checkout(inode, APILocator.getUserAPI().getSystemUser(), false);
                                c.setStringProperty("wfActionId", action.getId());
                                c.setStringProperty("wfActionComments", wfActionComments);
                                c.setStringProperty("wfActionAssign", wfActionAssign);
                               
                                c = APILocator.getContentletAPI().checkin(c, APILocator.getUserAPI().getSystemUser(), false);
                            }
                           
                            // if the worflow requires a checkin
                            else{
                                c = APILocator.getContentletAPI().find(inode, APILocator.getUserAPI().getSystemUser(), false);
                                c.setStringProperty("wfActionId", action.getId());
                                c.setStringProperty("wfActionComments", wfActionComments);
                                c.setStringProperty("wfActionAssign", wfActionAssign);
                                wapi.fireWorkflowNoCheckin(c, APILocator.getUserAPI().getSystemUser());
                            }
                        }
View Full Code Here

Examples of org.apache.oozie.client.WorkflowAction

    }

    private RunningJob submitAction(Context context) throws Exception {
        PigActionExecutor ae = new PigActionExecutor();

        WorkflowAction action = context.getAction();

        ae.prepareActionDir(getFileSystem(), context);
        ae.submitLauncher(getFileSystem(), context, action);

        String jobId = action.getExternalId();
        String jobTracker = action.getTrackerUri();
        String consoleUrl = action.getConsoleUrl();
        assertNotNull(jobId);
        assertNotNull(jobTracker);
        assertNotNull(consoleUrl);

        Element e = XmlUtils.parseXml(action.getConf());
        XConfiguration conf =
                new XConfiguration(new StringReader(XmlUtils.prettyPrint(e.getChild("configuration")).toString()));
        conf.set("mapred.job.tracker", e.getChildTextTrim("job-tracker"));
        conf.set("fs.default.name", e.getChildTextTrim("name-node"));
        conf.set("mapreduce.framework.name", "yarn");
View Full Code Here

Examples of org.apache.oozie.client.WorkflowAction

        evaluateLauncherJob(launcherJob);
        assertTrue(launcherJob.isSuccessful());
        assertTrue(LauncherMapper.hasStatsData(launcherJob));

        PigActionExecutor ae = new PigActionExecutor();
        WorkflowAction wfAction = context.getAction();
        ae.check(context, wfAction);
        ae.end(context, wfAction);

        assertEquals("SUCCEEDED", wfAction.getExternalStatus());
        String stats = wfAction.getStats();
        assertNotNull(stats);
        // check for some of the expected key values in the stats
        Map m = (Map)JSONValue.parse(stats);
        // check for expected 1st level JSON keys
        assertTrue(m.containsKey("PIG_VERSION"));

        String expectedChildIDs = wfAction.getExternalChildIDs();
        String[] childIDs = expectedChildIDs.split(",");
        assertTrue(m.containsKey(childIDs[0]));

        Map q = (Map)m.get(childIDs[0]);
        // check for expected 2nd level JSON keys
View Full Code Here

Examples of org.apache.oozie.client.WorkflowAction

        final RunningJob launcherJob = submitAction(context);
        evaluateLauncherJob(launcherJob);
        assertTrue(launcherJob.isSuccessful());

        PigActionExecutor ae = new PigActionExecutor();
        WorkflowAction wfAction = context.getAction();
        ae.check(context, wfAction);
        ae.end(context, wfAction);

        assertEquals("SUCCEEDED", wfAction.getExternalStatus());
        String externalIds = wfAction.getExternalChildIDs();
        assertNotNull(externalIds);
        assertNotSame("", externalIds);
        // check for the expected prefix of hadoop jobIDs
        assertTrue(externalIds.contains("job_"));
View Full Code Here

Examples of org.apache.oozie.client.WorkflowAction

        final RunningJob launcherJob = submitAction(context);
        evaluateLauncherJob(launcherJob);
        assertTrue(launcherJob.isSuccessful());

        PigActionExecutor ae = new PigActionExecutor();
        WorkflowAction wfAction = context.getAction();
        ae.check(context, wfAction);
        ae.end(context, wfAction);

        // action should fail as the size of pig stats will always be greater
        // than 1 byte
        assertEquals("FAILED/KILLED", wfAction.getExternalStatus());
        assertNull(wfAction.getStats());
    }
View Full Code Here

Examples of org.apache.oozie.client.WorkflowAction

        evaluateLauncherJob(launcherJob);
        assertTrue(launcherJob.isSuccessful());
        assertFalse(LauncherMapper.hasStatsData(launcherJob));

        PigActionExecutor ae = new PigActionExecutor();
        WorkflowAction wfAction = context.getAction();
        ae.check(context, wfAction);
        ae.end(context, wfAction);

        assertEquals("SUCCEEDED", wfAction.getExternalStatus());
        assertNotNull(wfAction.getExternalChildIDs());
    }
View Full Code Here

Examples of org.apache.oozie.client.WorkflowAction

                "<chmod path=''{5}'' permissions=''-rwxrwx---'' dir-files=''false''/>" +
                "</fs>", mkdir, delete, source, target, chmod1, chmod2);


        Context context = createContext(actionXml);
        WorkflowAction action = context.getAction();

        assertFalse(fs.exists(ae.getRecoveryPath(context)));

        ae.start(context, action);
View Full Code Here

Examples of org.apache.oozie.client.WorkflowAction

        Context context = createContext(actionXml);
        ((WorkflowJobBean) context.getWorkflow()).setId(id);
        ((WorkflowActionBean) context.getWorkflow().getActions().get(0)).setJobId(id);
        ((WorkflowActionBean) context.getWorkflow().getActions().get(0)).setId(id + "-FS");

        WorkflowAction action = context.getAction();

        assertFalse(fs.exists(ae.getRecoveryPath(context)));

        try {
            ae.start(context, action);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.