Package org.apache.lenya.workflow

Examples of org.apache.lenya.workflow.WorkflowException


     *
     * @throws WorkflowException DOCUMENT ME!
     */
    public EventImpl getEvent(String name) throws WorkflowException {
        if (!events.containsKey(name)) {
            throw new WorkflowException("Workflow does not contain the event '" + name + "'!");
        }

        return (EventImpl) events.get(name);
    }
View Full Code Here


     * @throws WorkflowException DOCUMENT ME!
     */
    public BooleanVariableImpl getVariable(String name)
        throws WorkflowException {
        if (!variables.containsKey(name)) {
            throw new WorkflowException("Workflow does not contain the variable '" + name + "'!");
        }

        return (BooleanVariableImpl) variables.get(name);
    }
View Full Code Here

     */
    public void setExpression(String expression) throws WorkflowException {
        super.setExpression(expression);
        String[] sides = expression.split("=");
        if (sides.length != 2) {
            throw new WorkflowException(
                "The expression '" + expression + "' must be of the form 'name = [true|false]'");
        }
       
        variableName = sides[0].trim();
        value = Boolean.valueOf(sides[1].trim()).booleanValue();
View Full Code Here

        try {
            Document document = DocumentHelper.readDocument(file);
            workflow = buildWorkflow(document);
        } catch (Exception e) {
            throw new WorkflowException(e);
        }

        return workflow;
    }
View Full Code Here

            log.debug("Resolving executable events");
        }

        WorkflowInstance[] instances = getInstances();
        if (instances.length == 0) {
            throw new WorkflowException("The set must contain at least one workflow instance!");
        }

        Event[] events = mainInstance.getExecutableEvents(situation);
        Set executableEvents = new HashSet(Arrays.asList(events));
View Full Code Here

        try {
            Class clazz = Class.forName(className);
            condition = (Condition) clazz.newInstance();
            condition.setExpression(expression);
        } catch (ClassNotFoundException e) {
            throw new WorkflowException(e);
        } catch (InstantiationException e) {
            throw new WorkflowException(e);
        } catch (IllegalAccessException e) {
            throw new WorkflowException(e);
        }

        return condition;
    }
View Full Code Here

     * @throws WorkflowException when the event may not be invoked.
     */
    public void invoke(Situation situation, Event event)
        throws WorkflowException {
        if (!Arrays.asList(getExecutableEvents(situation)).contains(event)) {
            throw new WorkflowException("The event '" + event +
                "' cannot be invoked in the situation '" + situation + "'.");
        }

        fire(getNextTransition(event));

View Full Code Here

        for (int i = 0; i < transitions.length; i++) {
            if (transitions[i].getEvent().equals(event)) {
               
                if (nextTransition != null) {
                    throw new WorkflowException("More than one transition found for event [" + event + "]!");
                }
               
                nextTransition = (TransitionImpl) transitions[i];
            }
        }
       
        if (nextTransition == null) {
            throw new WorkflowException("No transition found for event [" + event + "]!");
        }
       
        return nextTransition;
    }
View Full Code Here

     * @throws WorkflowException when the variable instance was not found.
     */
    protected BooleanVariableInstance getVariableInstance(BooleanVariable variable)
        throws WorkflowException {
        if (!variableInstances.containsKey(variable)) {
            throw new WorkflowException("No instance for variable '" + variable.getName() + "'!");
        }

        return (BooleanVariableInstance) variableInstances.get(variable);
    }
View Full Code Here

            Element initialVersionElement = createInitialVersionElement(helper, situation, workflowId);
            historyElement.appendChild(initialVersionElement);
           
            DocumentHelper.writeDocument(helper.getDocument(), file);
        } catch (Exception e) {
            throw new WorkflowException(e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.lenya.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.