Package com.dotmarketing.portlets.workflows.model

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


    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


    }
    return actions;
  }

  public WorkflowScheme findDefaultScheme() throws DotDataException {
    WorkflowScheme scheme = cache.getDefaultScheme();
    if (scheme == null) {
      try {
        final DotConnect db = new DotConnect();
        db.setSQL(sql.SELECT_DEFAULT_SCHEME);
        try {
View Full Code Here

    return map;

  }

  public WorkflowScheme findScheme(String id) throws DotDataException {
    WorkflowScheme scheme = cache.getScheme(id);
    if (scheme == null) {
      try {
        final DotConnect db = new DotConnect();
        db.setSQL(sql.SELECT_SCHEME);
        db.addParam(id);
View Full Code Here

    if (LicenseUtil.getLevel() < 200) {
      return this.findDefaultScheme();
    }

    WorkflowScheme scheme = null;
    scheme = cache.getSchemeByStruct(structId);

    if (scheme != null) {
      return scheme;
    }
View Full Code Here

    return step;
  }

  public WorkflowStep findStepByContentlet(Contentlet contentlet) throws DotDataException {
    WorkflowStep step = cache.getStep(contentlet);
    final WorkflowScheme scheme = this.findSchemeForStruct(contentlet.getStructureInode());
    if ((step == null) || !step.getSchemeId().equals(scheme.getId())) {
      try {
        final DotConnect db = new DotConnect();
        db.setSQL(sql.SELECT_STEP_BY_CONTENTLET);
        db.addParam(contentlet.getIdentifier());
        step = (WorkflowStep) this.convertListToObjects(db.loadObjectResults(), WorkflowStep.class).get(0);
      } catch (final Exception e) {
        Logger.debug(this.getClass(), e.getMessage());
      }

      if (step == null) {
        try {
          step = this.findSteps(scheme).get(0);
        } catch (final Exception e) {
          throw new DotDataException("Unable to find workflow step for content id:" + contentlet.getIdentifier());
        }
      }

      // if the existing task belongs to another workflow schema, update
      // to the latest schema
      if (!step.getSchemeId().equals(scheme.getId())) {
        step = this.findSteps(scheme).get(0);
        final DotConnect db = new DotConnect();
        db.setSQL(sql.RESET_CONTENTLET_STEPS);
        db.addParam(step.getId());
        db.addParam(contentlet.getIdentifier());
View Full Code Here

    proxy.setId(action.getStepId());
    cache.removeActions(proxy);

    // update workflowScheme mod date
    WorkflowStep step = findStep(action.getStepId());
    WorkflowScheme scheme = findScheme(step.getSchemeId());
    saveScheme(scheme);

  }
View Full Code Here

    // 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

  public void saveScheme(WorkflowScheme scheme) throws DotDataException, AlreadyExistException {

    boolean isNew = true;
    if (UtilMethods.isSet(scheme.getId())) {
      try {
        final WorkflowScheme test = this.findScheme(scheme.getId());
        if (test != null) {
          isNew = false;
        }
      } catch (final Exception e) {
        Logger.debug(this.getClass(), e.getMessage(), e);
      }
    } else {
      scheme.setId(UUIDGenerator.generateUuid());
    }

    scheme.setModDate(new Date());

    final DotConnect db = new DotConnect();
    try {
      WorkflowScheme schemeWithSameName = findSchemeByName(scheme.getName());
      if(UtilMethods.isSet(schemeWithSameName) && UtilMethods.isSet(schemeWithSameName.getId()) && !schemeWithSameName.getId().equals(scheme.getId())){
        throw new AlreadyExistException("Already exist a scheme with the same name ("+schemeWithSameName.getName()+"). Create different schemes with the same name is not allowed. Please change your workflow scheme name.");
      }
      if (isNew) {
       
        db.setSQL(sql.INSERT_SCHEME);
        db.addParam(scheme.getId());
View Full Code Here

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

    // update workflowScheme mod date
    WorkflowScheme scheme = findScheme(step.getSchemeId());
    saveScheme(scheme);

  }
View Full Code Here

    // 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

TOP

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

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.