本文整理汇总了Java中org.activiti.engine.impl.HistoricActivityInstanceQueryImpl类的典型用法代码示例。如果您正苦于以下问题:Java HistoricActivityInstanceQueryImpl类的具体用法?Java HistoricActivityInstanceQueryImpl怎么用?Java HistoricActivityInstanceQueryImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HistoricActivityInstanceQueryImpl类属于org.activiti.engine.impl包,在下文中一共展示了HistoricActivityInstanceQueryImpl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getHistoricActivityInstanceEntity
import org.activiti.engine.impl.HistoricActivityInstanceQueryImpl; //导入依赖的package包/类
/**
* 查询历史节点.
*/
public HistoricActivityInstanceEntity getHistoricActivityInstanceEntity(
String historyTaskId) {
logger.info("historyTaskId : {}", historyTaskId);
JdbcTemplate jdbcTemplate = ApplicationContextHelper
.getBean(JdbcTemplate.class);
String historicActivityInstanceId = jdbcTemplate.queryForObject(
"SELECT ID_ FROM ACT_HI_ACTINST WHERE TASK_ID_=?",
String.class, historyTaskId);
logger.info("historicActivityInstanceId : {}",
historicActivityInstanceId);
HistoricActivityInstanceQueryImpl historicActivityInstanceQueryImpl = new HistoricActivityInstanceQueryImpl();
historicActivityInstanceQueryImpl
.activityInstanceId(historicActivityInstanceId);
HistoricActivityInstanceEntity historicActivityInstanceEntity = (HistoricActivityInstanceEntity) Context
.getCommandContext()
.getHistoricActivityInstanceEntityManager()
.findHistoricActivityInstancesByQueryCriteria(
historicActivityInstanceQueryImpl, new Page(0, 1))
.get(0);
return historicActivityInstanceEntity;
}
示例2: getHistoricActivityInstanceEntity
import org.activiti.engine.impl.HistoricActivityInstanceQueryImpl; //导入依赖的package包/类
public HistoricActivityInstanceEntity getHistoricActivityInstanceEntity(
String historyTaskId) {
logger.info("historyTaskId : {}", historyTaskId);
JdbcTemplate jdbcTemplate = ApplicationContextHelper
.getBean(JdbcTemplate.class);
String historicActivityInstanceId = jdbcTemplate.queryForObject(
"select id_ from ACT_HI_ACTINST where task_id_=?",
String.class, historyTaskId);
logger.info("historicActivityInstanceId : {}",
historicActivityInstanceId);
HistoricActivityInstanceQueryImpl historicActivityInstanceQueryImpl = new HistoricActivityInstanceQueryImpl();
historicActivityInstanceQueryImpl
.activityInstanceId(historicActivityInstanceId);
HistoricActivityInstanceEntity historicActivityInstanceEntity = (HistoricActivityInstanceEntity) Context
.getCommandContext()
.getHistoricActivityInstanceEntityManager()
.findHistoricActivityInstancesByQueryCriteria(
historicActivityInstanceQueryImpl, new Page(0, 1))
.get(0);
return historicActivityInstanceEntity;
}
示例3: findTargetHistoricActivity
import org.activiti.engine.impl.HistoricActivityInstanceQueryImpl; //导入依赖的package包/类
/**
* 找到想要回退对应的节点历史.
*/
public HistoricActivityInstanceEntity findTargetHistoricActivity(
CommandContext commandContext, TaskEntity taskEntity,
ActivityImpl activityImpl) {
HistoricActivityInstanceQueryImpl historicActivityInstanceQueryImpl = new HistoricActivityInstanceQueryImpl();
historicActivityInstanceQueryImpl.activityId(activityImpl.getId());
historicActivityInstanceQueryImpl.processInstanceId(taskEntity
.getProcessInstanceId());
historicActivityInstanceQueryImpl
.orderByHistoricActivityInstanceEndTime().desc();
HistoricActivityInstanceEntity historicActivityInstanceEntity = (HistoricActivityInstanceEntity) commandContext
.getHistoricActivityInstanceEntityManager()
.findHistoricActivityInstancesByQueryCriteria(
historicActivityInstanceQueryImpl, new Page(0, 1))
.get(0);
return historicActivityInstanceEntity;
}
示例4: fetchHistoricActivityInstances
import org.activiti.engine.impl.HistoricActivityInstanceQueryImpl; //导入依赖的package包/类
public void fetchHistoricActivityInstances() {
HistoricActivityInstanceQueryImpl historicActivityInstanceQueryImpl = new HistoricActivityInstanceQueryImpl();
// historicActivityInstanceQueryImpl.processInstanceId(processInstanceId)
// .orderByHistoricActivityInstanceStartTime().asc();
// TODO: 如果用了uuid会造成这样排序出问题
// 但是如果用startTime,可能出现因为处理速度太快,时间一样,导致次序颠倒的问题
historicActivityInstanceQueryImpl.processInstanceId(processInstanceId)
.orderByHistoricActivityInstanceId().asc();
Page page = new Page(0, 100);
historicActivityInstances = Context
.getCommandContext()
.getHistoricActivityInstanceEntityManager()
.findHistoricActivityInstancesByQueryCriteria(
historicActivityInstanceQueryImpl, page);
}
示例5: recordExecutionReplacedBy
import org.activiti.engine.impl.HistoricActivityInstanceQueryImpl; //导入依赖的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());
}
}
}
示例6: recordExecutionReplacedBy
import org.activiti.engine.impl.HistoricActivityInstanceQueryImpl; //导入依赖的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());
}
}
}
示例7: findActivityInstance
import org.activiti.engine.impl.HistoricActivityInstanceQueryImpl; //导入依赖的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;
}
示例8: findActivityInstance
import org.activiti.engine.impl.HistoricActivityInstanceQueryImpl; //导入依赖的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;
}
示例9: findActivityInstance
import org.activiti.engine.impl.HistoricActivityInstanceQueryImpl; //导入依赖的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;
}
示例10: findHistoricActivityInstanceCountByQueryCriteria
import org.activiti.engine.impl.HistoricActivityInstanceQueryImpl; //导入依赖的package包/类
public long findHistoricActivityInstanceCountByQueryCriteria(HistoricActivityInstanceQueryImpl historicActivityInstanceQuery) {
return (Long) getDbSqlSession().selectOne("selectHistoricActivityInstanceCountByQueryCriteria", historicActivityInstanceQuery);
}
示例11: findHistoricActivityInstancesByQueryCriteria
import org.activiti.engine.impl.HistoricActivityInstanceQueryImpl; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public List<HistoricActivityInstance> findHistoricActivityInstancesByQueryCriteria(HistoricActivityInstanceQueryImpl historicActivityInstanceQuery, Page page) {
return getDbSqlSession().selectList("selectHistoricActivityInstancesByQueryCriteria", historicActivityInstanceQuery, page);
}
示例12: createHistoricActivityInstanceQuery
import org.activiti.engine.impl.HistoricActivityInstanceQueryImpl; //导入依赖的package包/类
public HistoricActivityInstanceQueryImpl createHistoricActivityInstanceQuery() {
return new HistoricActivityInstanceQueryImpl();
}
示例13: findHistoricActivityInstanceCountByQueryCriteria
import org.activiti.engine.impl.HistoricActivityInstanceQueryImpl; //导入依赖的package包/类
public long findHistoricActivityInstanceCountByQueryCriteria(HistoricActivityInstanceQueryImpl historicActivityInstanceQuery) {
return (Long) getDbSqlSession().selectOne("selectHistoricActivityInstanceCountByQueryCriteria", historicActivityInstanceQuery);
}
示例14: findHistoricActivityInstancesByQueryCriteria
import org.activiti.engine.impl.HistoricActivityInstanceQueryImpl; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public List<HistoricActivityInstance> findHistoricActivityInstancesByQueryCriteria(HistoricActivityInstanceQueryImpl historicActivityInstanceQuery, Page page) {
return getDbSqlSession().selectList("selectHistoricActivityInstancesByQueryCriteria", historicActivityInstanceQuery, page);
}
示例15: createHistoricActivityInstanceQuery
import org.activiti.engine.impl.HistoricActivityInstanceQueryImpl; //导入依赖的package包/类
public HistoricActivityInstanceQueryImpl createHistoricActivityInstanceQuery() {
return new HistoricActivityInstanceQueryImpl();
}