Package org.apache.lenya.workflow

Examples of org.apache.lenya.workflow.Version


    protected boolean canNotifySubmitter() {
       
        boolean shallNotifySubmitter = false;
        Workflowable workflowable = WorkflowUtil.getWorkflowable(this.manager, getSession(),
                getLogger(), getSourceDocument());
        Version versions[] = workflowable.getVersions();
       
        // consider the case that there was no submit transition
        if (versions.length > 0) {
            Version version = versions[versions.length - 1];
   
            // we check if the document has been submitted, otherwise we do nothing
            if (version.getEvent().equals("submit")) {
                shallNotifySubmitter = true;
            }
        }
        return shallNotifySubmitter;
    }
View Full Code Here


            return;
        }

        Workflowable workflowable = WorkflowUtil.getWorkflowable(this.manager, getSession(),
                getLogger(), authoringDocument);
        Version versions[] = workflowable.getVersions();
       
        // obtain submitted version
        Version version = versions[versions.length - 2];
       
        String userId = version.getUserId();
        User user = PolicyUtil.getUser(this.manager, authoringDocument.getCanonicalWebappURL(),
                userId, getLogger());

        Identifiable[] recipients = { user };
View Full Code Here

                    String string = versionStrings[i];
                    int spaceIndex = string.indexOf(" ");
                    String numberString = string.substring(0, spaceIndex);
                    int number = Integer.parseInt(numberString);
                    String versionString = string.substring(spaceIndex + 1);
                    Version version = decodeVersion(versionString);
                    number2version.put(new Integer(number), version);
                }
               
                int number = 0;
                for (Iterator i = number2version.keySet().iterator(); i.hasNext(); ) {
                    Version version = (Version) number2version.get(i.next());
                    this.versions[number] = version;
                    number++;
                }
               
                if (checkedIn) {
View Full Code Here

    /**
     * @see org.apache.lenya.workflow.Workflowable#getLatestVersion()
     */
    public Version getLatestVersion() {
        Version version = null;
        Version[] versions = getVersions();
        if (versions.length > 0) {
            version = versions[versions.length - 1];
        }
        return version;
View Full Code Here

                String[] nameValue = steps[1].split("=");
                variables.put(nameValue[0], nameValue[1]);
            }
        }

        Version version = new LenyaVersion(event, state);
        for (Iterator i = variables.keySet().iterator(); i.hasNext();) {
            String name = (String) i.next();
            String value = (String) variables.get(name);
            version.setUserId(user);
            version.setDate(date);
            version.setIPAddress(machine);
            version.setValue(name, Boolean.valueOf(value).booleanValue());
        }
        return version;
    }
View Full Code Here

        entry.setValue(KEY_LAST_MODIFIED, lastModified);

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

    protected boolean canNotifySubmitter() {
       
        boolean shallNotifySubmitter = false;
        Workflowable workflowable = WorkflowUtil.getWorkflowable(this.manager, getSession(),
                getLogger(), getSourceDocument());
        Version versions[] = workflowable.getVersions();
       
        // consider the case that there was no submit transition
        if (versions.length > 0) {
            Version version = versions[versions.length - 1];
   
            // we check if the document has been submitted, otherwise we do nothing
            if (version.getEvent().equals("submit")) {
                shallNotifySubmitter = true;
            }
        }
        return shallNotifySubmitter;
    }
View Full Code Here

            return;
        }

        Workflowable workflowable = WorkflowUtil.getWorkflowable(this.manager, getSession(),
                getLogger(), authoringDocument);
        Version versions[] = workflowable.getVersions();
       
        // obtain submitted version
        Version version = versions[versions.length - 2];
       
        String userId = version.getUserId();
        User user = PolicyUtil.getUser(this.manager, authoringDocument.getCanonicalWebappURL(),
                userId, getLogger());

        Identifiable[] recipients = { user };
View Full Code Here

        User sender = getSession().getIdentity().getUser();

        String reason = getParameterAsString(REJECT_REASON);
        Workflowable workflowable = WorkflowUtil.getWorkflowable(this.manager, getSession(),
                getLogger(), authoringDocument);
        Version versions[] = workflowable.getVersions();
        // current version is reject, want originating submit
        Version version = versions[versions.length - 2];

        // we assume that the document has been submitted, otherwise we do
        // nothing
        if (version.getEvent().equals("submit")) {

            String userId = version.getUserId();
            User user = PolicyUtil.getUser(this.manager, authoringDocument.getCanonicalWebappURL(),
                    userId, getLogger());

            Identifiable[] recipients = { user };
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

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.