本文整理汇总了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());
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}
}
示例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());
}
}
}
示例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;
}
示例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;
}
示例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;
}