org.activiti.engine.impl.persistence.entity.SuspensionState Java Examples

The following examples show how to use org.activiti.engine.impl.persistence.entity.SuspensionState. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TaskQueryImpl.java    From lemon with Apache License 2.0 5 votes vote down vote up
public TaskQuery active() {
    if (orActive) {
        currentOrQueryObject.suspensionState = SuspensionState.ACTIVE;
    } else {
        this.suspensionState = SuspensionState.ACTIVE;
    }

    return this;
}
 
Example #2
Source File: TaskQueryImpl.java    From lemon with Apache License 2.0 5 votes vote down vote up
public TaskQuery suspended() {
    if (orActive) {
        currentOrQueryObject.suspensionState = SuspensionState.SUSPENDED;
    } else {
        this.suspensionState = SuspensionState.SUSPENDED;
    }

    return this;
}
 
Example #3
Source File: TaskQueryImpl.java    From activiti6-boot2 with Apache License 2.0 5 votes vote down vote up
public TaskQuery suspended() {
  if(orActive) {
    currentOrQueryObject.suspensionState = SuspensionState.SUSPENDED;
  } else {
    this.suspensionState = SuspensionState.SUSPENDED;
  }
  return this;
}
 
Example #4
Source File: TaskQueryImpl.java    From activiti6-boot2 with Apache License 2.0 5 votes vote down vote up
public TaskQuery active() {
  if(orActive) {
    currentOrQueryObject.suspensionState = SuspensionState.ACTIVE;
  } else {
    this.suspensionState = SuspensionState.ACTIVE;
  }
  return this;
}
 
Example #5
Source File: TaskQueryImpl.java    From flowable-engine with Apache License 2.0 5 votes vote down vote up
@Override
public TaskQuery suspended() {
    if (orActive) {
        currentOrQueryObject.suspensionState = SuspensionState.SUSPENDED;
    } else {
        this.suspensionState = SuspensionState.SUSPENDED;
    }
    return this;
}
 
Example #6
Source File: SignalEventSubscriptionByEventNameMatcher.java    From activiti6-boot2 with Apache License 2.0 5 votes vote down vote up
@Override
public boolean isRetained(EventSubscriptionEntity eventSubscriptionEntity, Object parameter) {
  
  Map<String, String> params = (Map<String, String>) parameter;
  String eventName = params.get("eventName");
  String tenantId = params.get("tenantId");
  
  return eventSubscriptionEntity.getEventType() != null && eventSubscriptionEntity.getEventType().equals(SignalEventSubscriptionEntity.EVENT_TYPE)
      && eventSubscriptionEntity.getEventName() != null && eventSubscriptionEntity.getEventName().equals(eventName)
      && (eventSubscriptionEntity.getExecutionId() == null || (eventSubscriptionEntity.getExecutionId() != null && eventSubscriptionEntity.getExecution() != null && eventSubscriptionEntity.getExecution().getSuspensionState() == SuspensionState.ACTIVE.getStateCode()) )
      && ( (params.containsKey("tenantId") && tenantId.equals(eventSubscriptionEntity.getTenantId())) || (!params.containsKey("tenantId") && StringUtils.isEmpty(eventSubscriptionEntity.getTenantId())) );
}
 
Example #7
Source File: ProcessInstanceQueryImpl.java    From activiti6-boot2 with Apache License 2.0 5 votes vote down vote up
public ProcessInstanceQuery active() {
  if (inOrStatement) {
    this.currentOrQueryObject.suspensionState = SuspensionState.ACTIVE;
  } else {
    this.suspensionState = SuspensionState.ACTIVE;
  }
  return this;
}
 
Example #8
Source File: ProcessInstanceQueryImpl.java    From activiti6-boot2 with Apache License 2.0 5 votes vote down vote up
public ProcessInstanceQuery suspended() {
  if (inOrStatement) {
    this.currentOrQueryObject.suspensionState = SuspensionState.SUSPENDED;
  } else {
    this.suspensionState = SuspensionState.SUSPENDED;
  }
  return this;
}
 
Example #9
Source File: TaskQueryImpl.java    From flowable-engine with Apache License 2.0 5 votes vote down vote up
@Override
public TaskQuery active() {
    if (orActive) {
        currentOrQueryObject.suspensionState = SuspensionState.ACTIVE;
    } else {
        this.suspensionState = SuspensionState.ACTIVE;
    }
    return this;
}
 
Example #10
Source File: AbstractSetProcessDefinitionStateCmd.java    From flowable-engine with Apache License 2.0 5 votes vote down vote up
protected List<ProcessInstance> fetchProcessInstancesPage(CommandContext commandContext,
                                                          ProcessDefinition processDefinition, int currentPageStartIndex) {

    if (SuspensionState.ACTIVE.equals(getProcessDefinitionSuspensionState())) {
        return new ProcessInstanceQueryImpl(commandContext)
                .processDefinitionId(processDefinition.getId())
                .suspended()
                .listPage(currentPageStartIndex, commandContext.getProcessEngineConfiguration().getBatchSizeProcessInstances());
    } else {
        return new ProcessInstanceQueryImpl(commandContext)
                .processDefinitionId(processDefinition.getId())
                .active()
                .listPage(currentPageStartIndex, commandContext.getProcessEngineConfiguration().getBatchSizeProcessInstances());
    }
}
 
Example #11
Source File: ProcessInstanceQueryImpl.java    From flowable-engine with Apache License 2.0 5 votes vote down vote up
@Override
public ProcessInstanceQuery active() {
    if (inOrStatement) {
        this.currentOrQueryObject.suspensionState = SuspensionState.ACTIVE;
    } else {
        this.suspensionState = SuspensionState.ACTIVE;
    }
    return this;
}
 
Example #12
Source File: AbstractSetProcessDefinitionStateCmd.java    From activiti6-boot2 with Apache License 2.0 5 votes vote down vote up
public Void execute(CommandContext commandContext) {

    List<ProcessDefinitionEntity> processDefinitions = findProcessDefinition(commandContext);
    boolean hasActiviti5ProcessDefinitions = false;
    for (ProcessDefinitionEntity processDefinitionEntity : processDefinitions) {
      if (Activiti5Util.isActiviti5ProcessDefinition(commandContext, processDefinitionEntity)) {
        hasActiviti5ProcessDefinitions = true;
        break;
      }
    }
    
    if (hasActiviti5ProcessDefinitions) {
      Activiti5CompatibilityHandler activiti5CompatibilityHandler = Activiti5Util.getActiviti5CompatibilityHandler(); 
      if (getProcessDefinitionSuspensionState() == SuspensionState.ACTIVE) {
        activiti5CompatibilityHandler.activateProcessDefinition(processDefinitionId, processDefinitionKey, includeProcessInstances, executionDate, tenantId);
      } else if (getProcessDefinitionSuspensionState() == SuspensionState.SUSPENDED) {
        activiti5CompatibilityHandler.suspendProcessDefinition(processDefinitionId, processDefinitionKey, includeProcessInstances, executionDate, tenantId);
      }
      return null;
    }

    if (executionDate != null) { // Process definition state change is delayed
      createTimerForDelayedExecution(commandContext, processDefinitions);
    } else { // Process definition state is changed now
      changeProcessDefinitionState(commandContext, processDefinitions);
    }

    return null;
  }
 
Example #13
Source File: AbstractSetProcessDefinitionStateCmd.java    From activiti6-boot2 with Apache License 2.0 5 votes vote down vote up
protected List<ProcessInstance> fetchProcessInstancesPage(CommandContext commandContext, ProcessDefinition processDefinition, int currentPageStartIndex) {

    if (SuspensionState.ACTIVE.equals(getProcessDefinitionSuspensionState())) {
      return new ProcessInstanceQueryImpl(commandContext).processDefinitionId(processDefinition.getId()).suspended()
          .listPage(currentPageStartIndex, commandContext.getProcessEngineConfiguration().getBatchSizeProcessInstances());
    } else {
      return new ProcessInstanceQueryImpl(commandContext).processDefinitionId(processDefinition.getId()).active()
          .listPage(currentPageStartIndex, commandContext.getProcessEngineConfiguration().getBatchSizeProcessInstances());
    }
  }
 
Example #14
Source File: ProcessInstanceQueryImpl.java    From flowable-engine with Apache License 2.0 5 votes vote down vote up
@Override
public ProcessInstanceQuery suspended() {
    if (inOrStatement) {
        this.currentOrQueryObject.suspensionState = SuspensionState.SUSPENDED;
    } else {
        this.suspensionState = SuspensionState.SUSPENDED;
    }
    return this;
}
 
Example #15
Source File: ProcessInstanceQueryImpl.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
public SuspensionState getSuspensionState() {
    return suspensionState;
}
 
Example #16
Source File: ProcessDefinitionQueryImpl.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
public void setSuspensionState(SuspensionState suspensionState) {
    this.suspensionState = suspensionState;
}
 
Example #17
Source File: TaskQueryImpl.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
public SuspensionState getSuspensionState() {
    return suspensionState;
}
 
Example #18
Source File: ProcessDefinitionQueryImpl.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
@Override
public ProcessDefinitionQuery active() {
    this.suspensionState = SuspensionState.ACTIVE;
    return this;
}
 
Example #19
Source File: ProcessInstanceQueryImpl.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
public void setSuspensionState(SuspensionState suspensionState) {
    this.suspensionState = suspensionState;
}
 
Example #20
Source File: ActivateProcessInstanceCmd.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
@Override
protected SuspensionState getNewState() {
    return SuspensionState.ACTIVE;
}
 
Example #21
Source File: SuspendProcessDefinitionCmd.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
@Override
protected SuspensionState getProcessDefinitionSuspensionState() {
    return SuspensionState.SUSPENDED;
}
 
Example #22
Source File: SuspendProcessInstanceCmd.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
@Override
protected SuspensionState getNewState() {
    return SuspensionState.SUSPENDED;
}
 
Example #23
Source File: ActivateProcessDefinitionCmd.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
@Override
protected SuspensionState getProcessDefinitionSuspensionState() {
    return SuspensionState.ACTIVE;
}
 
Example #24
Source File: ExecutionQueryImpl.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
public SuspensionState getSuspensionState() {
    return suspensionState;
}
 
Example #25
Source File: ExecutionQueryImpl.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
public void setSuspensionState(SuspensionState suspensionState) {
    this.suspensionState = suspensionState;
}
 
Example #26
Source File: TaskQueryImpl.java    From lemon with Apache License 2.0 4 votes vote down vote up
public SuspensionState getSuspensionState() {
    return suspensionState;
}
 
Example #27
Source File: ProcessDefinitionQueryImpl.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
@Override
public ProcessDefinitionQuery suspended() {
    this.suspensionState = SuspensionState.SUSPENDED;
    return this;
}
 
Example #28
Source File: ProcessDefinitionQueryImpl.java    From activiti6-boot2 with Apache License 2.0 4 votes vote down vote up
public ProcessDefinitionQuery suspended() {
  this.suspensionState = SuspensionState.SUSPENDED;
  return this;
}
 
Example #29
Source File: ProcessDefinitionQueryImpl.java    From activiti6-boot2 with Apache License 2.0 4 votes vote down vote up
public SuspensionState getSuspensionState() {
  return suspensionState;
}
 
Example #30
Source File: ProcessDefinitionQueryImpl.java    From activiti6-boot2 with Apache License 2.0 4 votes vote down vote up
public void setSuspensionState(SuspensionState suspensionState) {
  this.suspensionState = suspensionState;
}