Package org.jbpm.api

Examples of org.jbpm.api.JbpmException


public class AuthorizationInterceptor extends Interceptor {

  public <T> T execute(Command<T> command) {
    Environment environment = Environment.getCurrent();
    if (environment==null) {
      throw new JbpmException("no environment for verifying authorization");
    }
    AuthorizationSession authorizationSession = environment.get(AuthorizationSession.class);
    if (authorizationSession==null) {
      throw new JbpmException("no AuthorizationSession in environment for verifying authorization");
    }
    authorizationSession.checkPermission(command, environment);
    // if the authorization check succeeded, proceed
    return next.execute(command);
  }
View Full Code Here


    return false;
  }
 
  public void suspend() {
    if (isSuspended()) {
      throw new JbpmException("deployment is already suspended");
    }
   
    state = Deployment.STATE_SUSPENDED;

    RepositorySessionImpl repositorySession = Environment.getFromCurrent(RepositorySessionImpl.class);
View Full Code Here

    repositoryCache.remove(Long.toString(dbid));
  }

  public void resume() {
    if (!isSuspended()) {
      throw new JbpmException("deployment is not suspended");
    }
   
    state = Deployment.STATE_ACTIVE;
   
    RepositorySessionImpl repositorySession = Environment.getFromCurrent(RepositorySessionImpl.class);
View Full Code Here

    compositeElement.addProperty(descriptor);
    return this;
  }

  public CompositeBuilder endActivity() {
    throw new JbpmException("calling endActivity on a processBuilder is invalid");
  }
View Full Code Here

  public CompositeBuilder endActivity() {
    throw new JbpmException("calling endActivity on a processBuilder is invalid");
  }

  public FlowBuilder startFlow(String to) {
    throw new JbpmException("calling startFlow on a processBuilder is invalid");
  }
View Full Code Here

  // assignment ///////////////////////////////////////////////////////////////

  public void take(String userId) {
    if (assignee != null) {
      throw new JbpmException("task already taken by " + this.assignee);
    }
    setAssignee(userId, true);
  }
View Full Code Here

    return participation;
  }

  public void removeParticipant(ParticipationImpl participation) {
    if (participation == null) {
      throw new JbpmException("participant is null");
    }
    if (participations.remove(participation)) {
      participation.setTask(null);
    }
  }
View Full Code Here

    return subtask;
  }

  public void removeSubTask(Task subtask) {
    if (subtask == null) {
      throw new JbpmException("subtask is null");
    }
    if ((subTasks != null) && (subTasks.remove(subtask))) {
      ((TaskImpl) subtask).setSuperTask(null);
    }
  }
View Full Code Here

  private Map<String, Object> internalMap;

  public void addVariable(String key, Object variable) {
    if (internalMap == null) {
      if (variables != null) {
        throw new JbpmException("variables were set externally");
      }
      variables = internalMap = new HashMap<String, Object>();
    }
    internalMap.put(key, variable);
  }
View Full Code Here

  }

  // modified getters and setters /////////////////////////////////////////////
  public void setProgress(Integer progress) {
    if ((progress < 0) || (progress > 100)) {
      throw new JbpmException(
          "task progress is a percentage (integer) and must be expressed between 0 and 100");
    }
    this.progress = progress;
  }
View Full Code Here

TOP

Related Classes of org.jbpm.api.JbpmException

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.