Package org.apache.oozie.workflow

Examples of org.apache.oozie.workflow.WorkflowException


        return nodeDef;
    }

    public synchronized void fail(String nodeName) throws WorkflowException {
        if (status.isEndState()) {
            throw new WorkflowException(ErrorCode.E0718);
        }
        String failedNode = failNode(nodeName);
        if (failedNode != null) {
            log.warn(XLog.STD, "Workflow Failed. Failing node [{0}]", failedNode);
        }
View Full Code Here


        status = Status.FAILED;
    }

    public synchronized void kill() throws WorkflowException {
        if (status.isEndState()) {
            throw new WorkflowException(ErrorCode.E0718);
        }
        log.debug(XLog.STD, "Killing job");
        List<String> killedNodes = killNodes();
        if (killedNodes.size() > 1) {
            log.warn(XLog.STD, "workflow killed, killing [{0}] nodes", killedNodes.size());
View Full Code Here

        status = Status.KILLED;
    }

    public synchronized void suspend() throws WorkflowException {
        if (status != Status.RUNNING) {
            throw new WorkflowException(ErrorCode.E0716);
        }
        log.debug(XLog.STD, "Suspending job");
        this.status = Status.SUSPENDED;
    }
View Full Code Here

        return (status == Status.SUSPENDED);
    }

    public synchronized void resume() throws WorkflowException {
        if (status != Status.SUSPENDED) {
            throw new WorkflowException(ErrorCode.E0717);
        }
        log.debug(XLog.STD, "Resuming job");
        status = Status.RUNNING;
    }
View Full Code Here

    }

    public void loopDetection(Context context) throws WorkflowException {
        String flag = getLoopFlag(context.getNodeDef().getName());
        if (context.getVar(flag) != null) {
            throw new WorkflowException(ErrorCode.E0709, context.getNodeDef().getName());
        }
        context.setVar(flag, "true");
    }
View Full Code Here

        String signalValue = context.getSignalValue();
        if (context.getNodeDef().getTransitions().contains(signalValue)) {
            return signalValue;
        }
        else {
            throw new WorkflowException(ErrorCode.E0721, context.getNodeDef().getName(), signalValue);
        }
    }
View Full Code Here

    public static class JoinNodeHandler extends NodeHandler {

        public void loopDetection(Context context) throws WorkflowException {
            String flag = getLoopFlag(context.getNodeDef().getName());
            if (context.getVar(flag) != null) {
                throw new WorkflowException(ErrorCode.E0709, context.getNodeDef().getName());
            }
            String parentExecutionPath = context.getParentExecutionPath(context.getExecutionPath());
            String forkCount = context.getVar(ForkNodeDef.FORK_COUNT_PREFIX + parentExecutionPath);
            if (forkCount == null) {
                throw new WorkflowException(ErrorCode.E0720, context.getNodeDef().getName());
            }
            int count = Integer.parseInt(forkCount) - 1;
            if (count == 0) {
                context.setVar(flag, "true");
            }
View Full Code Here

        public boolean enter(Context context) throws WorkflowException {
            String parentExecutionPath = context.getParentExecutionPath(context.getExecutionPath());
            String forkCount = context.getVar(ForkNodeDef.FORK_COUNT_PREFIX + parentExecutionPath);
            if (forkCount == null) {
                throw new WorkflowException(ErrorCode.E0720, context.getNodeDef().getName());
            }
            int count = Integer.parseInt(forkCount) - 1;
            if (count > 0) {
                context.setVar(ForkNodeDef.FORK_COUNT_PREFIX + parentExecutionPath, "" + count);
                context.deleteExecutionPath();
View Full Code Here

     */
    public static class StartNodeHandler extends NodeHandler {

        public boolean enter(Context context) throws WorkflowException {
            if (!context.getSignalValue().equals(StartNodeDef.START)) {
                throw new WorkflowException(ErrorCode.E0715, context.getSignalValue());
            }
            return true;
        }
View Full Code Here

    }

    public LiteWorkflowApp addNode(NodeDef node) throws WorkflowException {
        ParamChecker.notNull(node, "node");
        if (complete) {
            throw new WorkflowException(ErrorCode.E0704,
                                        XLog.format("Definition [{0}] already complete", name));
        }
        if (nodesMap.containsKey(node.getName())) {
            throw new WorkflowException(ErrorCode.E0705,
                                        XLog.format("Node [{0}] already defined", node.getName()));
        }
        if (node.getTransitions().contains(node.getName())) {
            throw new WorkflowException(ErrorCode.E0706,
                                        XLog.format("Node [{0}] cannot transition to itself", node.getName()));
        }
        nodesMap.put(node.getName(), node);
        if (node instanceof EndNodeDef) {
            complete = true;
View Full Code Here

TOP

Related Classes of org.apache.oozie.workflow.WorkflowException

Copyright © 2018 www.massapicom. 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.