Package org.apache.lenya.workflow

Examples of org.apache.lenya.workflow.Version


                wfManager = (WorkflowManager) this.manager.lookup(WorkflowManager.ROLE);
                DocumentWorkflowable workflowable = new DocumentWorkflowable(document,
                        getLogger());
                if (wfManager.hasWorkflow(workflowable)) {

                    Version latestVersion = workflowable.getLatestVersion();

                    if (name.equals(STATE)) {
                        if (latestVersion == null) {
                            Workflow workflow = wfManager.getWorkflowSchema(workflowable);
                            value = workflow.getInitialState();
                        } else {
                            value = latestVersion.getState();
                        }
                    } else if (name.startsWith(VARIABLE_PREFIX)) {
                        String variableName = name.substring(VARIABLE_PREFIX.length());
                        Workflow workflow = wfManager.getWorkflowSchema(workflowable);
                        String[] variableNames = workflow.getVariableNames();
                        if (Arrays.asList(variableNames).contains(variableName)) {
                            if (latestVersion == null) {
                                value = Boolean.valueOf(workflow.getInitialValue(variableName));
                            } else {
                                value = Boolean.valueOf(latestVersion.getValue(variableName));
                            }
                        }
                    } else if (name.equals(HISTORY_PATH)) {
                        final String path = document.getPublication().getPathMapper()
                                .getPath(document.getId(), document.getLanguage());
View Full Code Here


                        getSession(), getLogger(), doc);
                resolver = (WorkflowManager) this.manager.lookup(WorkflowManager.ROLE);
                if (resolver.hasWorkflow(workflowable)) {
                    Workflow workflow = resolver.getWorkflowSchema(workflowable);
                    String[] variableNames = workflow.getVariableNames();
                    Version latestVersion = workflowable.getLatestVersion();
                    Boolean isLive = null;
                    if (latestVersion != null) {
                        setParameter(STATE, latestVersion.getState());
                        if (Arrays.asList(variableNames).contains(WORKFLOW_VARIABLE_ISLIVE)) {
                            isLive = Boolean.valueOf(latestVersion
                                    .getValue(WORKFLOW_VARIABLE_ISLIVE));
                        }
                    } else {
                        setParameter(STATE, workflow.getInitialState());
                        if (Arrays.asList(variableNames).contains(WORKFLOW_VARIABLE_ISLIVE)) {
View Full Code Here

                setParameter("canRollback", canRollback);

                if (WorkflowUtil.hasWorkflow(this.manager, getSession(), getLogger(), sourceDoc)) {
                    Workflowable workflowable = WorkflowUtil.getWorkflowable(this.manager,
                            getSession(), getLogger(), sourceDoc);
                    Version latestVersion = workflowable.getLatestVersion();
                    String state;
                    if (latestVersion != null) {
                        state = latestVersion.getState();
                    } else {
                        Workflow workflow = WorkflowUtil.getWorkflowSchema(this.manager,
                                getSession(), getLogger(), sourceDoc);
                        state = workflow.getInitialState();
                    }
View Full Code Here

TOP

Related Classes of org.apache.lenya.workflow.Version

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.