Examples of WorkflowException


Examples of org.apache.lenya.workflow.WorkflowException

     * @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

Examples of org.apache.lenya.workflow.WorkflowException

    public static Situation buildSituation(Request request) throws WorkflowException {
        Role[] roles;
        try {
            roles = PolicyAuthorizer.getRoles(request);
        } catch (AccessControlException e) {
            throw new WorkflowException(e);
        }
        Session session = request.getSession(false);
        if (session == null) {
            throw new WorkflowException("Session not initialized!");
        }
        Identity identity = Identity.getIdentity(session);
       
        return WorkflowFactory.newInstance().buildSituation(roles, identity);
    }
View Full Code Here

Examples of org.apache.lenya.workflow.WorkflowException

        assert document != null;
        LanguageVersions versions;
        try {
            versions = new LanguageVersions(document);
        } catch (DocumentException e) {
            throw new WorkflowException(e);
        }
        return new WorkflowDocumentSet(versions, document);
    }
View Full Code Here

Examples of org.apache.lenya.workflow.WorkflowException

     * @return A workflow situation.
     * @throws WorkflowException when something went wrong.
     */
    public Situation buildSituation(Role[] roles, Identity identity) throws WorkflowException {
        if (identity == null) {
            throw new WorkflowException("Session does not contain identity!");
        }
        String userId = null;
        User user = identity.getUser();
        if (user != null) {
            userId = user.getId();
View Full Code Here

Examples of org.apache.lenya.workflow.WorkflowException

     * @return A state.
     * @throws WorkflowException when the state does not exist.
     */
    protected StateImpl getState(String name) throws WorkflowException {
        if (!states.containsKey(name)) {
            throw new WorkflowException("Workflow does not contain the state '" + name + "'!");
        }

        return (StateImpl) states.get(name);
    }
View Full Code Here

Examples of org.apache.lenya.workflow.WorkflowException

     * @return The event with this name.
     * @throws WorkflowException when no event with the given name exists.
     */
    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

Examples of org.apache.lenya.workflow.WorkflowException

     * @throws WorkflowException if no variable with the given name exists.
     */
    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

Examples of org.apache.oozie.workflow.WorkflowException

        try {
            invokeForkJoin(parser, def);
            fail("Expected to catch an exception but did not encounter any");
        } catch (Exception ex) {
            WorkflowException we = (WorkflowException) ex.getCause();
            assertEquals(ErrorCode.E0730, we.getErrorCode());
        }
    }
View Full Code Here

Examples of org.apache.oozie.workflow.WorkflowException

        try {
            invokeForkJoin(parser, def);
            fail("Expected to catch an exception but did not encounter any");
        } catch (Exception ex) {
            WorkflowException we = (WorkflowException) ex.getCause();
            assertEquals(ErrorCode.E0730, we.getErrorCode());
        }
    }
View Full Code Here

Examples of org.apache.oozie.workflow.WorkflowException

        try {
            invokeForkJoin(parser, def);
            fail("Expected to catch an exception but did not encounter any");
        } catch (Exception ex) {
            WorkflowException we = (WorkflowException) ex.getCause();
            assertEquals(ErrorCode.E0734, we.getErrorCode());
            // Make sure the message contains the nodes involved in the invalid transition
            assertTrue(we.getMessage().contains("two"));
            assertTrue(we.getMessage().contains("three"));
        }

    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.