Examples of Situation


Examples of org.apache.lenya.cms.workflow.Situation

   
    /** Returns the transitions that can fire for this user.
     *
     */
    public Transition[] getExecutableTransitions(User user) {
        Situation situation = new SituationImpl(getDocument(), user);
        Transition transitions[] = getWorkflow().getLeavingTransitions(getCurrentState());
        Set executableTransitions = new HashSet();
       
        for (int i = 0; i < transitions.length; i++) {
            if (transitions[i].canFire(situation)) {
View Full Code Here

Examples of org.apache.lenya.workflow.Situation

        boolean canFire = true;

        WorkflowFactory factory = WorkflowFactory.newInstance();
        if (factory.hasWorkflow(document)) {
            try {
                Situation situation = getSituation();

                SynchronizedWorkflowInstances instance;
                try {
                    instance = factory.buildSynchronizedInstance(document);
                } catch (WorkflowException e) {
View Full Code Here

Examples of org.apache.lenya.workflow.Situation

     */
    protected Situation getSituation() throws ParameterException {
        WorkflowFactory workflowFactory = WorkflowFactory.newInstance();
        String userId = getParameters().getParameter(PARAMETER_USER_ID);
        String machineIp = getParameters().getParameter(PARAMETER_IP_ADDRESS);
        Situation situation = workflowFactory.buildSituation(getRoleIDs(), userId, machineIp);
        return situation;
    }
View Full Code Here

Examples of org.apache.lenya.workflow.Situation

                try {
                    instance = factory.buildSynchronizedInstance(document);
                } catch (WorkflowException e) {
                    throw new ExecutionException(e);
                }
                Situation situation = factory.buildSituation(getRoleIDs(), userId, machineIp);

                Event event = getExecutableEvent(instance, situation);

                assert event != null;
View Full Code Here

Examples of org.apache.lenya.workflow.Situation

        throw new BuildException(e);
      }
      try {
        if (factory.hasWorkflow(document)) {
          String[] roles = new String[0];
          Situation situation =
            WorkflowFactory.newInstance().buildSituation(roles, getUserId(), getMachineIp());
          WorkflowFactory.initHistory(document, newdocument, situation);
        }
      } catch (WorkflowException e) {
        throw new BuildException(e);
View Full Code Here

Examples of org.apache.lenya.workflow.Situation

            throw new BuildException(e);
        }

        try {
            String[] roles = new String[0];
            Situation situation =
                WorkflowFactory.newInstance().buildSituation(roles, getUserId(), getMachineIp());
            DocumentType type =
                DocumentTypeBuilder.buildDocumentType(getDocumentType(), getPublication());
            WorkflowFactory.initHistory(document, type.getWorkflowFileName(), situation);
        } catch (Exception e) {
View Full Code Here

Examples of org.apache.lenya.workflow.Situation

        for (int i = 0; i < roles.length; i++) {
            roleIds[i] = roles[i].getId();
        }

        WorkflowFactory factory = WorkflowFactory.newInstance();
        Situation situation = factory.buildSituation(roleIds, userId, ipAddress);
        return situation;
    }
View Full Code Here

Examples of org.apache.lenya.workflow.Situation

        WorkflowFactory factory = WorkflowFactory.newInstance();

        setHasWorkflow(factory.hasWorkflow(document));

        if (hasWorkflow()) {
            Situation situation = null;

            try {
                setInstance(factory.buildSynchronizedInstance(document));
                situation = WorkflowHelper.buildSituation(objectModel);
            } catch (Exception e) {
View Full Code Here

Examples of org.apache.lenya.workflow.Situation

        WorkflowFactory factory = WorkflowFactory.newInstance();

        String[] emptyRoles = {
        };
        Situation situation = factory.buildSituation(emptyRoles, "test", "127.0.0.1");

        WorkflowFactory.initHistory(document, workflowId, situation);

        for (int situationIndex = 0; situationIndex < situations.length; situationIndex++) {
            WorkflowInstance instance = null;
View Full Code Here

Examples of org.apache.lenya.workflow.Situation

            if (getLogger().isDebugEnabled()) {
                getLogger().debug("    Invoking workflow event");
            }

            SynchronizedWorkflowInstances instance = factory.buildSynchronizedInstance(document);
            Situation situation = WorkflowHelper.buildSituation(objectModel);
            Event[] events = instance.getExecutableEvents(situation);
            Event event = null;

            for (int i = 0; i < events.length; i++) {
                if (events[i].getName().equals(eventName)) {
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.