Package org.apache.lenya.workflow

Examples of org.apache.lenya.workflow.WorkflowException


                canInvoke = canInvoke && wfManager.canInvoke(workflowable, event);
            }
            return canInvoke;

        } catch (ServiceException e) {
            throw new WorkflowException(e);
        } finally {
            if (wfManager != null) {
                manager.release(wfManager);
            }
        }
View Full Code Here


        try {
            wfManager = (WorkflowManager) manager.lookup(WorkflowManager.ROLE);
            Workflowable workflowable = new DocumentWorkflowable(document, logger);
            return wfManager.hasWorkflow(workflowable);
        } catch (ServiceException e) {
            throw new WorkflowException(e);
        } finally {
            if (wfManager != null) {
                manager.release(wfManager);
            }
        }
View Full Code Here

            WorkflowEngine engine = new WorkflowEngineImpl();
            Situation situation = getSituation();
            Workflow workflow = getWorkflowSchema(workflowable);

            if (force && !engine.canInvoke(workflowable, workflow, situation, event)) {
                throw new WorkflowException("The event [" + event
                        + "] cannot be invoked on the document [" + workflowable
                        + "] in the situation [" + situation + "]");
            }
            engine.invoke(workflowable, workflow, situation, event);
        }
View Full Code Here

                Document document = SourceUtil.readDOM(uri, this.manager);
                WorkflowBuilder builder = new WorkflowBuilder(getLogger());
                workflow = builder.buildWorkflow(uri, document);
            }
        } catch (final Exception e) {
            throw new WorkflowException(e);
        }

        return workflow;
    }
View Full Code Here

        Transition firingTransition = null;
        List firingTransitions = getFiringTransitions(workflowable, workflow, situation, event);

        if (firingTransitions.size() == 0) {
            throw new WorkflowException("No transition can fire!");
        } else if (firingTransitions.size() > 1) {
            throw new WorkflowException("More than one transitions can fire!");
        } else {
            firingTransition = (Transition) firingTransitions.get(0);
        }

        String destination = firingTransition.getDestination();
View Full Code Here

     * @return A variable.
     * @throws WorkflowException if no variable with the given name exists.
     */
    public BooleanVariableImpl getVariable(String _name) throws WorkflowException {
        if (!this.variables.containsKey(_name)) {
            throw new WorkflowException("Workflow does not contain the variable '" + _name + "'!");
        }

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

        for (int i = 0; i < variables.length; i++) {
            if (variables[i].getName().equals(variableName)) {
                return variables[i].getInitialValue();
            }
        }
        throw new WorkflowException("The variable [" + variableName + "] does not exist.");
    }
View Full Code Here

                    workflowId);
            historyElement.appendChild(initialVersionElement);

            DocumentHelper.writeDocument(helper.getDocument(), file);
        } catch (Exception e) {
            throw new WorkflowException(e);
        }
    }
View Full Code Here

        NamespaceHelper helper;
        try {
            Document document = DocumentHelper.readDocument(getHistoryFile());
            helper = new NamespaceHelper(Workflow.NAMESPACE, Workflow.DEFAULT_PREFIX, document);
        } catch (Exception e) {
            throw new WorkflowException(e);
        }
        return helper;
    }
View Full Code Here

     */
    protected String getWorkflowId(NamespaceHelper helper) throws WorkflowException {
        String workflowId = helper.getDocument().getDocumentElement().getAttribute(
                WORKFLOW_ATTRIBUTE);
        if (workflowId == null) {
            throw new WorkflowException("The attribute '" + WORKFLOW_ATTRIBUTE + "' is missing!");
        }
        if ("".equals(workflowId)) {
            throw new WorkflowException("The workflow ID must not be empty!");
        }
        return workflowId;
    }
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.