Package com.dotmarketing.portlets.workflows.model

Examples of com.dotmarketing.portlets.workflows.model.WorkflowAction


                        List<WorkflowTask> tasks=wapi.findExpiredTasks();
                        for (WorkflowTask task : tasks) {
                            String stepId=task.getStatus();
                            WorkflowStep step=wapi.findStep(stepId);
                            String actionId=step.getEscalationAction();
                            WorkflowAction action=wapi.findAction(actionId, APILocator.getUserAPI().getSystemUser());
                           
                            Logger.info(this, "Task '"+task.getTitle()+"' " +
                                    "on contentlet id '"+task.getWebasset()+"' "+
                                "timeout on step '"+step.getName()+"' " +
                                "excecuting escalation action '"+action.getName()+"'");
                           
                            // find contentlet for default language
                            Contentlet def=APILocator.getContentletAPI().findContentletByIdentifier(task.getWebasset(), false,
                                    APILocator.getLanguageAPI().getDefaultLanguage().getId(),
                                    APILocator.getUserAPI().getSystemUser(), false);
                            String inode=def.getInode();
                           
                            Contentlet c;

                            // if the worflow requires a checkin
                            if(action.requiresCheckout()){
                                c = APILocator.getContentletAPI().checkout(inode, APILocator.getUserAPI().getSystemUser(), false);
                                c.setStringProperty("wfActionId", action.getId());
                                c.setStringProperty("wfActionComments", wfActionComments);
                                c.setStringProperty("wfActionAssign", wfActionAssign);
                               
                                c = APILocator.getContentletAPI().checkin(c, APILocator.getUserAPI().getSystemUser(), false);
                            }
                           
                            // if the worflow requires a checkin
                            else{
                                c = APILocator.getContentletAPI().find(inode, APILocator.getUserAPI().getSystemUser(), false);
                                c.setStringProperty("wfActionId", action.getId());
                                c.setStringProperty("wfActionComments", wfActionComments);
                                c.setStringProperty("wfActionAssign", wfActionAssign);
                                wapi.fireWorkflowNoCheckin(c, APILocator.getUserAPI().getSystemUser());
                            }
                        }
View Full Code Here


        step3.setResolved(true);
        step3.setSchemeId(scheme.getId());
        APILocator.getWorkflowAPI().saveStep(step3);
       
        // Save as Draft Step1 -> Step1
        WorkflowAction saveDraft=new WorkflowAction();
        saveDraft.setId(UUIDGenerator.generateUuid());
        saveDraft.setName("Save as Draft");
        saveDraft.setOrder(1);
        saveDraft.setNextStep(step1.getId());
        saveDraft.setRequiresCheckout(true);
        saveDraft.setStepId(step1.getId());
        saveDraft.setNextAssign(APILocator.getRoleAPI().loadCMSAnonymousRole().getId());
        APILocator.getWorkflowAPI().saveAction(saveDraft,
                Arrays.asList(new Permission[] {
                        new Permission(
                                saveDraft.getPermissionType(),
                                saveDraft.getId(),
                                APILocator.getRoleAPI().loadCMSAnonymousRole().getId(),
                                PermissionAPI.PERMISSION_USE) }));
       
     // Save as Draft Step1 -> Step1
        WorkflowAction escalate=new WorkflowAction();
        escalate.setId(UUIDGenerator.generateUuid());
        escalate.setName("Save and Assign");
        escalate.setOrder(2);
        escalate.setNextStep(step1.getId());
        escalate.setRequiresCheckout(true);
        escalate.setStepId(step1.getId());
        escalate.setAssignable(true);
        escalate.setCommentable(true);
        escalate.setNextAssign(APILocator.getRoleAPI().loadCMSAnonymousRole().getId());
        APILocator.getWorkflowAPI().saveAction(escalate,
                Arrays.asList(new Permission[] {
                        new Permission(
                                escalate.getPermissionType(),
                                escalate.getId(),
                                APILocator.getRoleAPI().loadCMSAnonymousRole().getId(),
                                PermissionAPI.PERMISSION_USE) }));
       
        // Send for review Step1 -> Step2
        WorkflowAction sendReview=new WorkflowAction();
        sendReview.setId(UUIDGenerator.generateUuid());
        sendReview.setName("Send for review");
        sendReview.setOrder(3);
        sendReview.setNextStep(step2.getId());
        sendReview.setRequiresCheckout(false);
        sendReview.setStepId(step1.getId());
        sendReview.setNextAssign(APILocator.getRoleAPI().loadCMSAnonymousRole().getId());
        APILocator.getWorkflowAPI().saveAction(sendReview,
                Arrays.asList(new Permission[] {
                        new Permission(
                                sendReview.getPermissionType(),
                                sendReview.getId(),
                                APILocator.getRoleAPI().loadCMSAnonymousRole().getId(),
                                PermissionAPI.PERMISSION_USE) }));
       
        // reject Step2 -> Step1
        WorkflowAction reject=new WorkflowAction();
        reject.setId(UUIDGenerator.generateUuid());
        reject.setName("Reject");
        reject.setOrder(1);
        reject.setNextStep(step1.getId());
        reject.setRequiresCheckout(false);
        reject.setStepId(step2.getId());
        reject.setNextAssign(APILocator.getRoleAPI().loadCMSAnonymousRole().getId());
        APILocator.getWorkflowAPI().saveAction(reject,
                Arrays.asList(new Permission[] {
                        new Permission(
                                reject.getPermissionType(),
                                reject.getId(),
                                APILocator.getRoleAPI().loadCMSAnonymousRole().getId(),
                                PermissionAPI.PERMISSION_USE) }));
       
        // publish Step2 -> Step3
        WorkflowAction publish=new WorkflowAction();
        publish.setId(UUIDGenerator.generateUuid());
        publish.setName("Publish");
        publish.setOrder(2);
        publish.setNextStep(step3.getId());
        publish.setRequiresCheckout(false);
        publish.setStepId(step2.getId());
        publish.setNextAssign(APILocator.getRoleAPI().loadCMSAnonymousRole().getId());
        APILocator.getWorkflowAPI().saveAction(publish,
                Arrays.asList(new Permission[] {
                        new Permission(
                                publish.getPermissionType(),
                                publish.getId(),
                                APILocator.getRoleAPI().loadCMSAnonymousRole().getId(),
                                PermissionAPI.PERMISSION_USE) }));
        WorkflowActionClass publishlet=new WorkflowActionClass();
        publishlet.setActionId(publish.getId());
        publishlet.setClazz(com.dotmarketing.portlets.workflows.actionlet.PublishContentActionlet.class.getCanonicalName());
        publishlet.setName("publish");
        publishlet.setOrder(1);
        APILocator.getWorkflowAPI().saveActionClass(publishlet);
       
View Full Code Here

      db.loadResult();
    }

    // update workflowScheme mod date
    WorkflowActionClass actionClass = findActionClass(param.getActionClassId());
    WorkflowAction action = findAction(actionClass.getActionId());
    WorkflowStep step = findStep(action.getStepId());
    WorkflowScheme scheme = findScheme(step.getSchemeId());
    saveScheme(scheme);
  }
View Full Code Here

        db.addParam(param.getId());
        db.loadResult();
       
        // update scheme mod date
        WorkflowActionClass clazz = findActionClass(param.getActionClassId());
        WorkflowAction action = findAction(clazz.getActionId());
        WorkflowStep step = findStep(action.getStepId());
        WorkflowScheme scheme = findScheme(step.getSchemeId());
        saveScheme(scheme);
    }
View Full Code Here

    BeanUtils.copyProperties(obj, map);
    return obj;
  }

  private WorkflowAction convertAction(Map<String, Object> row) throws IllegalAccessException, InvocationTargetException {
    final WorkflowAction action = new WorkflowAction();
    row.put("stepId", row.get("step_id"));
    row.put("condition", row.get("condition_to_progress"));
    row.put("nextStep", row.get("next_step_id"));
    row.put("nextAssign", row.get("next_assign"));
    row.put("order", row.get("my_order"));
View Full Code Here

    db.setSQL(sql.DELETE_ACTION_CLASS);
    db.addParam(actionClass.getId());
    db.loadResult();

    // update scheme mod date
    WorkflowAction action = findAction(actionId);
    WorkflowStep step = findStep(action.getStepId());
    WorkflowScheme scheme = findScheme(step.getSchemeId());
    saveScheme(scheme);
  }
View Full Code Here

    db.setSQL(sql.DELETE_ACTION_CLASS_PARAM_BY_ACTION_CLASS);
    db.addParam(actionClass.getId());
    db.loadResult();

    // update scheme mod date
    WorkflowAction action = findAction(actionClass.getActionId());
    WorkflowStep step = findStep(action.getStepId());
    WorkflowScheme scheme = findScheme(step.getSchemeId());
    saveScheme(scheme);

  }
View Full Code Here

  public void saveAction(WorkflowAction action) throws DotDataException,AlreadyExistException {

    boolean isNew = true;
    if (UtilMethods.isSet(action.getId())) {
      try {
        final WorkflowAction test = this.findAction(action.getId());
        if (test != null) {
          isNew = false;
        }
      } catch (final Exception e) {
        Logger.debug(this.getClass(), e.getMessage(), e);
View Full Code Here

      db.loadResult();
    }
    // cache.remove(step);

    // update workflowScheme mod date
    WorkflowAction action = findAction(actionClass.getActionId());
    WorkflowStep step = findStep(action.getStepId());
    WorkflowScheme scheme = findScheme(step.getSchemeId());
    saveScheme(scheme);
  }
View Full Code Here

        boolean includeFake = UtilMethods.isSet(request.getParameter( "includeFake" ))&&request.getParameter( "includeFake" ).equals("true");

        try {
            String actionId = request.getParameter( "actionId" );
            WorkflowAction action = APILocator.getWorkflowAPI().findAction( actionId, getUser() );
            Role role = APILocator.getRoleAPI().loadRoleById( action.getNextAssign() );
            List<Role> roleList = new ArrayList<Role>();
            List<User> userList = new ArrayList<User>();
            if ( !role.isUser() ) {
                if ( action.isRoleHierarchyForAssign() ) {
                    userList = APILocator.getRoleAPI().findUsersForRole( role, true );
                    roleList.addAll( APILocator.getRoleAPI().findRoleHierarchy( role ) );
                } else {
                    userList = APILocator.getRoleAPI().findUsersForRole( role, false );
                    roleList.add( role );
View Full Code Here

TOP

Related Classes of com.dotmarketing.portlets.workflows.model.WorkflowAction

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.