Package org.apache.lenya.workflow

Examples of org.apache.lenya.workflow.WorkflowException


        if (hasWorkflow(workflowable)) {
            WorkflowEngine engine = new WorkflowEngineImpl();
            Workflow workflow = getWorkflowSchema(workflowable);

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


            if (uri != null) {
                workflow = (WorkflowImpl) this.uri2workflow.get(uri);
                if (workflow == null) {
                    Document document = SourceUtil.readDOM(uri, this.manager);
                    if (document == null) {
                        throw new WorkflowException("Could not read workflow schema from URI ["
                                + uri + "]!");
                    }
                    WorkflowBuilder builder = new WorkflowBuilder(getLogger());
                    workflow = builder.buildWorkflow(uri, document);
                    this.uri2workflow.put(uri, workflow);
                }
            }
        } catch (final Exception e) {
            throw new WorkflowException(e);
        }

        return workflow;
    }
View Full Code Here

        if (hasWorkflow(workflowable)) {
            WorkflowEngine engine = new WorkflowEngineImpl();
            Workflow workflow = getWorkflowSchema(workflowable);

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

            if (uri != null) {
                workflow = (WorkflowImpl) this.uri2workflow.get(uri);
                if (workflow == null) {
                    Document document = SourceUtil.readDOM(uri, this.manager);
                    if (document == null) {
                        throw new WorkflowException("Could not read workflow schema from URI ["
                                + uri + "]!");
                    }
                    WorkflowBuilder builder = new WorkflowBuilder(getLogger());
                    workflow = builder.buildWorkflow(uri, document);
                    this.uri2workflow.put(uri, workflow);
                }
            }
        } catch (final WorkflowException e) {
            throw e;
        } catch (final Exception e) {
            throw new WorkflowException(e);
        }

        return workflow;
    }
View Full Code Here

        Transition firingTransition = null;
        List firingTransitions = getFiringTransitions(workflowable, workflow, 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

        try {
            wfManager = (WorkflowManager) manager.lookup(WorkflowManager.ROLE);
            Workflowable workflowable = getWorkflowable(manager, session, logger, document);
            wfManager.invoke(workflowable, event);
        } 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 = getWorkflowable(manager, session, logger, document);
            wfManager.invoke(workflowable, event, force);
        } catch (ServiceException e) {
            throw new WorkflowException(e);
        } finally {
            if (wfManager != null) {
                manager.release(wfManager);
            }
        }
View Full Code Here

                        logger);
                wfManager.invoke(workflowable, event, force);
            }

        } catch (ServiceException e) {
            throw new WorkflowException(e);
        } finally {
            if (wfManager != null) {
                manager.release(wfManager);
            }
        }
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.