Package org.apache.lenya.workflow

Examples of org.apache.lenya.workflow.WorkflowException


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


                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(manager, session, document, logger);
            return wfManager.hasWorkflow(workflowable);
        } catch (ServiceException e) {
            throw new WorkflowException(e);
        } finally {
            if (wfManager != null) {
                manager.release(wfManager);
            }
        }
View Full Code Here

            wfManager = (WorkflowManager) manager.lookup(WorkflowManager.ROLE);
            Workflowable workflowable = getWorkflowable(manager, session, logger, document);
            if (wfManager.hasWorkflow(workflowable)) {
                return wfManager.getWorkflowSchema(workflowable);
            } else {
                throw new WorkflowException("The document [" + document + "] has no workflow!");
            }
        } catch (ServiceException e) {
            throw new WorkflowException(e);
        } finally {
            if (wfManager != null) {
                manager.release(wfManager);
            }
        }
View Full Code Here

            Class clazz = Class.forName(className);
            condition = (Condition) clazz.newInstance();
            ContainerUtil.enableLogging(condition, getLogger());
            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

     */
    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]'");
        }

        this.variableName = sides[0].trim();
        this.value = Boolean.valueOf(sides[1].trim()).booleanValue();
View Full Code Here

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

        return workflow;
    }
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

        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

     * @throws WorkflowException if something goes wrong.
     */
    public WorkflowInstanceImpl getInstance() throws WorkflowException {
        if (this.instance == null) {
            if (!isInitialized()) {
                throw new WorkflowException("The workflow history has not been initialized!");
            }

            WorkflowInstanceImpl instance = createInstance();
            NamespaceHelper helper = getNamespaceHelper();

            String workflowId = getWorkflowId(helper);
            if (null == workflowId) {
                throw new WorkflowException("No workflow attribute set in history document!");
            }

            instance.setWorkflow(workflowId);

            restoreState(instance, helper);
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.