当前位置: 首页>>代码示例>>Java>>正文


Java HistoricActivityInstanceEntity.getEndTime方法代码示例

本文整理汇总了Java中org.activiti.engine.impl.persistence.entity.HistoricActivityInstanceEntity.getEndTime方法的典型用法代码示例。如果您正苦于以下问题:Java HistoricActivityInstanceEntity.getEndTime方法的具体用法?Java HistoricActivityInstanceEntity.getEndTime怎么用?Java HistoricActivityInstanceEntity.getEndTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.activiti.engine.impl.persistence.entity.HistoricActivityInstanceEntity的用法示例。


在下文中一共展示了HistoricActivityInstanceEntity.getEndTime方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: recordExecutionReplacedBy

import org.activiti.engine.impl.persistence.entity.HistoricActivityInstanceEntity; //导入方法依赖的package包/类
@Override
@SuppressWarnings({ "unchecked", "rawtypes" })
public void recordExecutionReplacedBy(ExecutionEntity execution, InterpretableExecution replacedBy) {
    if (isHistoryLevelAtLeast(HistoryLevel.ACTIVITY)) {

        // Update the cached historic activity instances that are open
        List<HistoricActivityInstanceEntity> cachedHistoricActivityInstances = getDbSqlSession().findInCache(HistoricActivityInstanceEntity.class);
        for (HistoricActivityInstanceEntity cachedHistoricActivityInstance : cachedHistoricActivityInstances) {
            if ((cachedHistoricActivityInstance.getEndTime() == null)
                    && (execution.getId().equals(cachedHistoricActivityInstance.getExecutionId()))) {
                cachedHistoricActivityInstance.setExecutionId(replacedBy.getId());
            }
        }

        // Update the persisted historic activity instances that are open
        List<HistoricActivityInstanceEntity> historicActivityInstances = (List) new HistoricActivityInstanceQueryImpl(Context.getCommandContext())
                .executionId(execution.getId())
                .unfinished()
                .list();
        for (HistoricActivityInstanceEntity historicActivityInstance : historicActivityInstances) {
            historicActivityInstance.setExecutionId(replacedBy.getId());
        }
    }
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:25,代码来源:DefaultHistoryManager.java

示例2: notify

import org.activiti.engine.impl.persistence.entity.HistoricActivityInstanceEntity; //导入方法依赖的package包/类
public void notify(DelegateExecution execution) throws Exception {
  String executionId = execution.getId();
  String activityId = ((ExecutionEntity)execution).getActivityId();

  CommandContext commandContext = Context.getCommandContext();
  // search for the historic activity instance in the dbsqlsession cache
  DbSqlSession dbSqlSession = commandContext.getDbSqlSession();
  List<HistoricActivityInstanceEntity> cachedHistoricActivityInstances = dbSqlSession.findInCache(HistoricActivityInstanceEntity.class);
  for (HistoricActivityInstanceEntity cachedHistoricActivityInstance: cachedHistoricActivityInstances) {
    if ( executionId.equals(cachedHistoricActivityInstance.getExecutionId())
         && (activityId.equals(cachedHistoricActivityInstance.getActivityId()))
         && (cachedHistoricActivityInstance.getEndTime()==null)
       ) {
      cachedHistoricActivityInstance.markEnded(null);
      return;
    }
  }
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:19,代码来源:StartEventEndHandler.java

示例3: notify

import org.activiti.engine.impl.persistence.entity.HistoricActivityInstanceEntity; //导入方法依赖的package包/类
public void notify(DelegateExecution execution) throws Exception {
  String executionId = execution.getId();
  String activityId = ((ExecutionEntity)execution).getActivityId();
  
  // interrupted executions might not have an activityId set.
  if(activityId == null) {
    return;
  }

  CommandContext commandContext = Context.getCommandContext();
  // search for the historic activity instance in the dbsqlsession cache
  DbSqlSession dbSqlSession = commandContext.getDbSqlSession();
  List<HistoricActivityInstanceEntity> cachedHistoricActivityInstances = dbSqlSession.findInCache(HistoricActivityInstanceEntity.class);
  for (HistoricActivityInstanceEntity cachedHistoricActivityInstance: cachedHistoricActivityInstances) {
    if ( executionId.equals(cachedHistoricActivityInstance.getExecutionId())
         && (activityId.equals(cachedHistoricActivityInstance.getActivityId()))
         && (cachedHistoricActivityInstance.getEndTime()==null)
       ) {
      cachedHistoricActivityInstance.markEnded(null);
      return;
    }
  }
}
 
开发者ID:iotsap,项目名称:FiWare-Template-Handler,代码行数:24,代码来源:StartEventEndHandler.java

示例4: recordStartEventEnded

import org.activiti.engine.impl.persistence.entity.HistoricActivityInstanceEntity; //导入方法依赖的package包/类
/**
 * Record the end of a start-task, if activity history is enabled.
 */
public void recordStartEventEnded(String executionId, String activityId) {
  if(isHistoryLevelAtLeast(HistoryLevel.ACTIVITY)) {
    
    // Interrupted executions might not have an activityId set, skip recording history.
    if(activityId == null) {
      return;
    }
    
    // Search for the historic activity instance in the dbsqlsession cache, since process hasn't been persisted to db yet
    List<HistoricActivityInstanceEntity> cachedHistoricActivityInstances = getDbSqlSession().findInCache(HistoricActivityInstanceEntity.class);
    for (HistoricActivityInstanceEntity cachedHistoricActivityInstance: cachedHistoricActivityInstances) {
      if ( executionId.equals(cachedHistoricActivityInstance.getExecutionId())
              && (activityId.equals(cachedHistoricActivityInstance.getActivityId()))
              && (cachedHistoricActivityInstance.getEndTime()==null)
              ) {
        cachedHistoricActivityInstance.markEnded(null);
        return;
      }
    }
  }
}
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:25,代码来源:HistoryManager.java

示例5: recordExecutionReplacedBy

import org.activiti.engine.impl.persistence.entity.HistoricActivityInstanceEntity; //导入方法依赖的package包/类
/**
 * Replaces any open historic activityInstances' execution-id's to the id of the replaced
 * execution, if activity history is enabled. 
 */
@SuppressWarnings({ "unchecked", "rawtypes" })
public void recordExecutionReplacedBy(ExecutionEntity execution, InterpretableExecution replacedBy) {
  if (isHistoryLevelAtLeast(HistoryLevel.ACTIVITY)) {
    
    // Update the cached historic activity instances that are open
    List<HistoricActivityInstanceEntity> cachedHistoricActivityInstances = getDbSqlSession().findInCache(HistoricActivityInstanceEntity.class);
    for (HistoricActivityInstanceEntity cachedHistoricActivityInstance: cachedHistoricActivityInstances) {
      if ( (cachedHistoricActivityInstance.getEndTime()==null)
           && (execution.getId().equals(cachedHistoricActivityInstance.getExecutionId())) 
         ) {
        cachedHistoricActivityInstance.setExecutionId(replacedBy.getId());
      }
    }
  
    // Update the persisted historic activity instances that are open
    List<HistoricActivityInstanceEntity> historicActivityInstances = (List) new HistoricActivityInstanceQueryImpl(Context.getCommandContext())
      .executionId(execution.getId())
      .unfinished()
      .list();
    for (HistoricActivityInstanceEntity historicActivityInstance: historicActivityInstances) {
      historicActivityInstance.setExecutionId(replacedBy.getId());
    }
  }
}
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:29,代码来源:HistoryManager.java

示例6: findActivityInstance

import org.activiti.engine.impl.persistence.entity.HistoricActivityInstanceEntity; //导入方法依赖的package包/类
protected HistoricActivityInstanceEntity findActivityInstance(ExecutionEntity execution, String activityId, boolean checkPersistentStore) {

        String executionId = execution.getId();

        // search for the historic activity instance in the dbsqlsession cache
        List<HistoricActivityInstanceEntity> cachedHistoricActivityInstances = getDbSqlSession()
                .findInCache(HistoricActivityInstanceEntity.class);
        for (HistoricActivityInstanceEntity cachedHistoricActivityInstance : cachedHistoricActivityInstances) {
            if (executionId.equals(cachedHistoricActivityInstance.getExecutionId())
                    && activityId != null
                    && (activityId.equals(cachedHistoricActivityInstance.getActivityId()))
                    && (cachedHistoricActivityInstance.getEndTime() == null)) {
                return cachedHistoricActivityInstance;
            }
        }

        List<HistoricActivityInstance> historicActivityInstances = null;
        if (checkPersistentStore) {
            historicActivityInstances = new HistoricActivityInstanceQueryImpl(Context.getCommandContext())
                    .executionId(executionId)
                    .activityId(activityId)
                    .unfinished()
                    .listPage(0, 1);
        }

        if (historicActivityInstances != null && !historicActivityInstances.isEmpty()) {
            return (HistoricActivityInstanceEntity) historicActivityInstances.get(0);
        }

        if (execution.getParentId() != null) {
            return findActivityInstance(execution.getParent(), activityId, checkPersistentStore);
        }

        return null;
    }
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:36,代码来源:DefaultHistoryManager.java

示例7: findActivityInstance

import org.activiti.engine.impl.persistence.entity.HistoricActivityInstanceEntity; //导入方法依赖的package包/类
/**
 * Finds the {@link HistoricActivityInstanceEntity} that is active in the given
 * execution. Uses the {@link DbSqlSession} cache to make sure the right instance
 * is returned, regardless of whether or not entities have already been flushed to DB.
 */
public static HistoricActivityInstanceEntity findActivityInstance(ExecutionEntity execution) {
  CommandContext commandContext = Context.getCommandContext();

  String executionId = execution.getId();
  String activityId = execution.getActivityId();

  // search for the historic activity instance in the dbsqlsession cache
  DbSqlSession dbSqlSession = commandContext.getDbSqlSession();
  List<HistoricActivityInstanceEntity> cachedHistoricActivityInstances = dbSqlSession.findInCache(HistoricActivityInstanceEntity.class);
  for (HistoricActivityInstanceEntity cachedHistoricActivityInstance: cachedHistoricActivityInstances) {
    if (executionId.equals(cachedHistoricActivityInstance.getExecutionId())
         && activityId != null
         && (activityId.equals(cachedHistoricActivityInstance.getActivityId()))
         && (cachedHistoricActivityInstance.getEndTime()==null)
       ) {
      return cachedHistoricActivityInstance;
    }
  }
  
  List<HistoricActivityInstance> historicActivityInstances = new HistoricActivityInstanceQueryImpl(commandContext)
    .executionId(executionId)
    .activityId(activityId)
    .unfinished()
    .listPage(0, 1);
  
  if (!historicActivityInstances.isEmpty()) {
    return (HistoricActivityInstanceEntity) historicActivityInstances.get(0);
  }
  
  if (execution.getParentId()!=null) {
    return findActivityInstance((ExecutionEntity) execution.getParent());
  }
  
  return null;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:41,代码来源:ActivityInstanceEndHandler.java

示例8: findActivityInstance

import org.activiti.engine.impl.persistence.entity.HistoricActivityInstanceEntity; //导入方法依赖的package包/类
/**
 * Finds the {@link HistoricActivityInstanceEntity} that is active in the given
 * execution. Uses the {@link DbSqlSession} cache to make sure the right instance
 * is returned, regardless of whether or not entities have already been flushed to DB.
 */
public HistoricActivityInstanceEntity findActivityInstance(ExecutionEntity execution) {
  String executionId = execution.getId();
  String activityId = execution.getActivityId();

  // search for the historic activity instance in the dbsqlsession cache
  List<HistoricActivityInstanceEntity> cachedHistoricActivityInstances = getDbSqlSession().findInCache(HistoricActivityInstanceEntity.class);
  for (HistoricActivityInstanceEntity cachedHistoricActivityInstance: cachedHistoricActivityInstances) {
    if (executionId.equals(cachedHistoricActivityInstance.getExecutionId())
         && activityId != null
         && (activityId.equals(cachedHistoricActivityInstance.getActivityId()))
         && (cachedHistoricActivityInstance.getEndTime()==null)
       ) {
      return cachedHistoricActivityInstance;
    }
  }
  
  List<HistoricActivityInstance> historicActivityInstances = new HistoricActivityInstanceQueryImpl(Context.getCommandContext())
    .executionId(executionId)
    .activityId(activityId)
    .unfinished()
    .listPage(0, 1);
  
  if (!historicActivityInstances.isEmpty()) {
    return (HistoricActivityInstanceEntity) historicActivityInstances.get(0);
  }
  
  if (execution.getParentId()!=null) {
    return findActivityInstance((ExecutionEntity) execution.getParent());
  }
  
  return null;
}
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:38,代码来源:HistoryManager.java


注:本文中的org.activiti.engine.impl.persistence.entity.HistoricActivityInstanceEntity.getEndTime方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。