Package org.activiti.engine.impl.persistence.entity

Examples of org.activiti.engine.impl.persistence.entity.ExecutionEntity


    if (processDefinition == null) {
        throw new ActivitiObjectNotFoundException("No process definition found for id '" + processDefinitionId + "'", ProcessDefinition.class);
    }
 
    ActivityImpl startActivity = processDefinition.findActivity(messageEventSubscription.getActivityId());
    ExecutionEntity processInstance = processDefinition.createProcessInstance(businessKey, startActivity);

    if (processVariables != null) {
      processInstance.setVariables(processVariables);
    }
   
    processInstance.start();
   
    return processInstance;
  }
View Full Code Here


    if(commandContext.getProcessEngineConfiguration().getEventDispatcher().isEnabled()) {
      // Forced to fetch the process-instance to associate the right process definition
      String processDefinitionId = null;
      String processInstanceId = updateAttachment.getProcessInstanceId();
      if(updateAttachment.getProcessInstanceId() != null) {
        ExecutionEntity process = commandContext.getExecutionEntityManager().findExecutionById(processInstanceId);
        if(process != null) {
          processDefinitionId = process.getProcessDefinitionId();
        }
      }
     
      commandContext.getProcessEngineConfiguration().getEventDispatcher().dispatchEvent(
          ActivitiEventBuilder.createEntityEvent(ActivitiEventType.ENTITY_UPDATED, attachment, processInstanceId, processInstanceId, processDefinitionId));
View Full Code Here

    if(executionId == null) {
       signalEvents = commandContext.getEventSubscriptionEntityManager()
        .findSignalEventSubscriptionsByEventName(eventName, tenantId);             
    } else {
     
      ExecutionEntity execution = commandContext.getExecutionEntityManager().findExecutionById(executionId);
     
      if (execution == null) {
        throw new ActivitiObjectNotFoundException("Cannot find execution with id '" + executionId + "'", Execution.class);
      }
     
      if (execution.isSuspended()) {
        throw new ActivitiException("Cannot throw signal event '" + eventName
                + "' because execution '" + executionId + "' is suspended");
      }
     
      signalEvents = commandContext.getEventSubscriptionEntityManager()
View Full Code Here

    this.businessKey = businessKey;
    this.properties = properties;
  }
 
  protected ProcessInstance execute(CommandContext commandContext, ProcessDefinitionEntity processDefinition) {
    ExecutionEntity processInstance = null;
    if (businessKey != null) {
      processInstance = processDefinition.createProcessInstance(businessKey);
    } else {
      processInstance = processDefinition.createProcessInstance();
    }

    commandContext.getHistoryManager()
      .reportFormPropertiesSubmitted(processInstance, properties, null);
   
    StartFormHandler startFormHandler = processDefinition.getStartFormHandler();
    startFormHandler.submitFormProperties(properties, processInstance);

    processInstance.start();
   
    return processInstance;
  }
View Full Code Here

    Class<? extends EventLoggerEventHandler> eventHandlerClass = null;
    if (event.getType().equals(ActivitiEventType.ENTITY_INITIALIZED)) {
      Object entity = ((ActivitiEntityEvent) event).getEntity();
      if (entity instanceof ExecutionEntity) {
        ExecutionEntity executionEntity = (ExecutionEntity) entity;
        if (executionEntity.getProcessInstanceId().equals(executionEntity.getId())) {
          eventHandlerClass = ProcessInstanceStartedEventHandler.class;
        }
      }
    } else if (event.getType().equals(ActivitiEventType.ENTITY_DELETED)) {
      Object entity = ((ActivitiEntityEvent) event).getEntity();
      if (entity instanceof ExecutionEntity) {
        ExecutionEntity executionEntity = (ExecutionEntity) entity;
        if (executionEntity.getProcessInstanceId().equals(executionEntity.getId())) {
          eventHandlerClass = ProcessInstanceEndedEventHandler.class;
        }
      }
    } else {
      // Default: dedicated mapper for the type
View Full Code Here

      throw new ActivitiIllegalArgumentException("userId and groupId cannot both be null");
    }
  }
 
  public Void execute(CommandContext commandContext) {
    ExecutionEntity processInstance = commandContext.getExecutionEntityManager().findExecutionById(processInstanceId);
     
    if (processInstance == null) {
      throw new ActivitiObjectNotFoundException("Cannot find process instance with id " + processInstanceId, ExecutionEntity.class);
    }
   
    processInstance.deleteIdentityLink(userId, groupId, type);
   
    commandContext.getHistoryManager().createProcessInstanceIdentityLinkComment(processInstanceId, userId, groupId, type, false);
   
    return null
  }
View Full Code Here

    ActivityImpl activity = (ActivityImpl) execution.getActivity();
    ActivityImpl parentActivity = activity.getParentActivity();
   
    if(Context.getProcessEngineConfiguration() != null && Context.getProcessEngineConfiguration().getEventDispatcher().isEnabled()) {
      if (execution instanceof ExecutionEntity) {
        ExecutionEntity executionEntity = (ExecutionEntity) execution;
        Context.getProcessEngineConfiguration().getEventDispatcher().dispatchEvent(
            ActivitiEventBuilder.createActivityEvent(ActivitiEventType.ACTIVITY_COMPLETED, execution.getActivity().getId(),
                (String) executionEntity.getActivity().getProperties().get("name"),
                execution.getId(),
                execution.getProcessInstanceId(), execution.getProcessDefinitionId(),
                (String) executionEntity.getActivity().getProperties().get("type"),
                executionEntity.getActivity().getActivityBehavior().getClass().getCanonicalName()));
      }
    }

    // if the execution is a single path of execution inside the process definition scope
    if ( (parentActivity!=null)
View Full Code Here

    if(commandContext.getProcessEngineConfiguration().getEventDispatcher().isEnabled()) {
      // Forced to fetch the process-instance to associate the right process definition
      String processDefinitionId = null;
      String processInstanceId = attachment.getProcessInstanceId();
      if(attachment.getProcessInstanceId() != null) {
        ExecutionEntity process = commandContext.getExecutionEntityManager().findExecutionById(processInstanceId);
        if(process != null) {
          processDefinitionId = process.getProcessDefinitionId();
        }
      }
      commandContext.getProcessEngineConfiguration().getEventDispatcher().dispatchEvent(
          ActivitiEventBuilder.createEntityEvent(ActivitiEventType.ENTITY_DELETED, attachment, processInstanceId, processInstanceId, processDefinitionId));
    }
View Full Code Here

  /* (non-Javadoc)
* @see org.activiti.engine.impl.history.HistoryManagerInterface#recordTaskAssignment(org.activiti.engine.impl.persistence.entity.TaskEntity)
*/
  @Override
public void recordTaskAssignment(TaskEntity task) {
    ExecutionEntity executionEntity = task.getExecution();
    if(isHistoryLevelAtLeast(HistoryLevel.ACTIVITY)) {
      if (executionEntity != null) {
        HistoricActivityInstanceEntity historicActivityInstance = findActivityInstance(executionEntity);
        if(historicActivityInstance != null) {
          historicActivityInstance.setAssignee(task.getAssignee());
View Full Code Here

* @see org.activiti.engine.impl.history.HistoryManagerInterface#recordTaskId(org.activiti.engine.impl.persistence.entity.TaskEntity)
*/
  @Override
public void recordTaskId(TaskEntity task) {
    if(isHistoryLevelAtLeast(HistoryLevel.ACTIVITY)) {
      ExecutionEntity execution = task.getExecution();
      if (execution != null) {
        HistoricActivityInstanceEntity historicActivityInstance = findActivityInstance(execution);
        if(historicActivityInstance != null) {
          historicActivityInstance.setTaskId(task.getId());
        }
View Full Code Here

TOP

Related Classes of org.activiti.engine.impl.persistence.entity.ExecutionEntity

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.