Package org.activiti.cdi

Examples of org.activiti.cdi.ActivitiCdiException


  }

  @Override
  public void setExecution(Execution execution) {
    if(execution == null) {
      throw new ActivitiCdiException("Cannot associate with execution: null");
    }
   
    if(Context.getCommandContext() != null) {
      throw new ActivitiCdiException("Cannot work with scoped associations inside command context.");
    }
   
    ScopedAssociation scopedAssociation = getScopedAssociation();
    Execution associatedExecution = scopedAssociation.getExecution();
    if(associatedExecution!=null && !associatedExecution.getId().equals(execution.getId())) {
      throw new ActivitiCdiException("Cannot associate "+execution+", already associated with "+associatedExecution+". Disassociate first!");
    }
   
    if (log.isLoggable(Level.FINE)) {
      log.fine("Associating "+execution+" (@"
                + scopedAssociation.getClass().getAnnotations()[0].annotationType().getSimpleName() + ")");
View Full Code Here


  }

  @Override
  public void disAssociate() {
    if(Context.getCommandContext() != null) {
      throw new ActivitiCdiException("Cannot work with scoped associations inside command context.");
    }
    ScopedAssociation scopedAssociation = getScopedAssociation();
    if (scopedAssociation.getExecution() == null) {
      throw new ActivitiException("Cannot dissasociate execution, no "
                + scopedAssociation.getClass().getAnnotations()[0].annotationType().getSimpleName()
View Full Code Here

    return null;
  }

  public Task getTask() {   
    if(Context.getCommandContext() != null) {
      throw new ActivitiCdiException("Cannot work with tasks in an activiti command.");
    }
    return getScopedAssociation().getTask();
  }
View Full Code Here

    return getScopedAssociation().getTask();
  }
 
  public void setTask(Task task) {
    if(Context.getCommandContext() != null) {
      throw new ActivitiCdiException("Cannot work with tasks in an activiti command.");
    }
    getScopedAssociation().setTask(task);
  }
View Full Code Here

  }

  @Override
  public Map<String, Object> getCachedVariables() {
    if(Context.getCommandContext() != null) {
      throw new ActivitiCdiException("Cannot work with cached variables in an activiti command.");
    }
    return getScopedAssociation().getCachedVariables();
  }
View Full Code Here

      boolean endConversation = completeTaskAnnotation.endConversation();   
      businessProcess.completeTask(endConversation);    

      return result;
    } catch (InvocationTargetException e) {
      throw new ActivitiCdiException("Error while completing task: "+e.getCause().getMessage(), e.getCause());
    }
  }
View Full Code Here

  }

  @Override
  public void setExecution(Execution execution) {
    if(execution == null) {
      throw new ActivitiCdiException("Cannot associate with execution: null");
    }
   
    if(Context.getCommandContext() != null) {
      throw new ActivitiCdiException("Cannot work with scoped associations inside command context.");
    }
   
    ScopedAssociation scopedAssociation = getScopedAssociation();
    Execution associatedExecution = scopedAssociation.getExecution();
    if(associatedExecution!=null && !associatedExecution.getId().equals(execution.getId())) {
      throw new ActivitiCdiException("Cannot associate "+execution+", already associated with "+associatedExecution+". Disassociate first!");
    }
   
    if (log.isTraceEnabled()) {
      log.trace("Associating {} (@{})", execution,
                scopedAssociation.getClass().getAnnotations()[0].annotationType().getSimpleName());
View Full Code Here

  }

  @Override
  public void disAssociate() {
    if(Context.getCommandContext() != null) {
      throw new ActivitiCdiException("Cannot work with scoped associations inside command context.");
    }
    ScopedAssociation scopedAssociation = getScopedAssociation();
    if (scopedAssociation.getExecution() == null) {
      throw new ActivitiException("Cannot dissasociate execution, no "
                + scopedAssociation.getClass().getAnnotations()[0].annotationType().getSimpleName()
View Full Code Here

    return null;
  }

  public Task getTask() {   
    if(Context.getCommandContext() != null) {
      throw new ActivitiCdiException("Cannot work with tasks in an activiti command.");
    }
    return getScopedAssociation().getTask();
  }
View Full Code Here

    return getScopedAssociation().getTask();
  }
 
  public void setTask(Task task) {
    if(Context.getCommandContext() != null) {
      throw new ActivitiCdiException("Cannot work with tasks in an activiti command.");
    }
    getScopedAssociation().setTask(task);
  }
View Full Code Here

TOP

Related Classes of org.activiti.cdi.ActivitiCdiException

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.