本文整理汇总了Java中org.activiti.engine.impl.Page类的典型用法代码示例。如果您正苦于以下问题:Java Page类的具体用法?Java Page怎么用?Java Page使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Page类属于org.activiti.engine.impl包,在下文中一共展示了Page类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getHistoricActivityInstanceEntity
import org.activiti.engine.impl.Page; //导入依赖的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.Page; //导入依赖的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.Page; //导入依赖的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.Page; //导入依赖的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: findProcessDefinitionsByQueryCriteria
import org.activiti.engine.impl.Page; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public List<ProcessDefinition> findProcessDefinitionsByQueryCriteria(ProcessDefinitionQueryImpl processDefinitionQuery, Page page) {
// List<ProcessDefinition> processDefinitions =
return getDbSqlSession().selectList("selectProcessDefinitionsByQueryCriteria", processDefinitionQuery, page);
// skipped this after discussion within the team
// // retrieve process definitions from cache (https://activiti.atlassian.net/browse/ACT-1020) to have all available information
// ArrayList<ProcessDefinition> result = new ArrayList<ProcessDefinition>();
// for (ProcessDefinition processDefinitionEntity : processDefinitions) {
// ProcessDefinitionEntity fullProcessDefinition = Context
// .getProcessEngineConfiguration()
// .getDeploymentCache().resolveProcessDefinition((ProcessDefinitionEntity)processDefinitionEntity);
// result.add(fullProcessDefinition);
// }
// return result;
}
示例6: findNewLatestProcessDefinitionAfterRemovalOf
import org.activiti.engine.impl.Page; //导入依赖的package包/类
protected ProcessDefinition findNewLatestProcessDefinitionAfterRemovalOf(ProcessDefinition processDefinitionToBeRemoved) {
// The latest process definition is not necessarily the one with 'version -1' (some versions could have been deleted)
// Hence, the following logic
ProcessDefinitionQueryImpl query = new ProcessDefinitionQueryImpl();
query.processDefinitionKey(processDefinitionToBeRemoved.getKey());
if (processDefinitionToBeRemoved.getTenantId() != null
&& !ProcessEngineConfiguration.NO_TENANT_ID.equals(processDefinitionToBeRemoved.getTenantId())) {
query.processDefinitionTenantId(processDefinitionToBeRemoved.getTenantId());
} else {
query.processDefinitionWithoutTenantId();
}
query.processDefinitionVersionLowerThan(processDefinitionToBeRemoved.getVersion());
query.orderByProcessDefinitionVersion().desc();
List<ProcessDefinition> processDefinitions = getProcessDefinitionManager().findProcessDefinitionsByQueryCriteria(query, new Page(0, 1));
if (processDefinitions != null && processDefinitions.size() > 0) {
return processDefinitions.get(0);
}
return null;
}
示例7: findProcessDefinitionsByQueryCriteria
import org.activiti.engine.impl.Page; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public List<ProcessDefinition> findProcessDefinitionsByQueryCriteria(ProcessDefinitionQueryImpl processDefinitionQuery, Page page) {
// List<ProcessDefinition> processDefinitions =
return getDbSqlSession().selectList("selectProcessDefinitionsByQueryCriteria", processDefinitionQuery, page);
//skipped this after discussion within the team
// // retrieve process definitions from cache (http://jira.codehaus.org/browse/ACT-1020) to have all available information
// ArrayList<ProcessDefinition> result = new ArrayList<ProcessDefinition>();
// for (ProcessDefinition processDefinitionEntity : processDefinitions) {
// ProcessDefinitionEntity fullProcessDefinition = Context
// .getProcessEngineConfiguration()
// .getDeploymentCache().resolveProcessDefinition((ProcessDefinitionEntity)processDefinitionEntity);
// result.add(fullProcessDefinition);
// }
// return result;
}
示例8: selectList
import org.activiti.engine.impl.Page; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
public List selectList(String statement, Object parameter, Page page) {
if (page != null) {
return selectList(statement, parameter, page.getFirstResult(), page.getMaxResults());
} else {
return selectList(statement, parameter, 0, Integer.MAX_VALUE);
}
}
示例9: findHistoricProcessInstancesByQueryCriteria
import org.activiti.engine.impl.Page; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public List<HistoricProcessInstance> findHistoricProcessInstancesByQueryCriteria(HistoricProcessInstanceQueryImpl historicProcessInstanceQuery, Page page) {
if (historyLevel>ProcessEngineConfigurationImpl.HISTORYLEVEL_NONE) {
return getDbSqlSession().selectList("selectHistoricProcessInstancesByQueryCriteria", historicProcessInstanceQuery, page);
}
return Collections.EMPTY_LIST;
}
示例10: findLatestDeploymentByName
import org.activiti.engine.impl.Page; //导入依赖的package包/类
public DeploymentEntity findLatestDeploymentByName(String deploymentName) {
List<?> list = getDbSqlSession().selectList("selectDeploymentsByName", deploymentName, new Page(0, 1));
if (list!=null && !list.isEmpty()) {
return (DeploymentEntity) list.get(0);
}
return null;
}
示例11: findHistoricTaskInstancesByQueryCriteria
import org.activiti.engine.impl.Page; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public List<HistoricTaskInstance> findHistoricTaskInstancesByQueryCriteria(HistoricTaskInstanceQueryImpl historicTaskInstanceQuery, Page page) {
if (historyLevel>ProcessEngineConfigurationImpl.HISTORYLEVEL_NONE) {
return getDbSqlSession().selectList("selectHistoricTaskInstancesByQueryCriteria", historicTaskInstanceQuery, page);
}
return Collections.EMPTY_LIST;
}
示例12: selectList
import org.activiti.engine.impl.Page; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public List selectList(String statement, Object parameter, Page page) {
statement = dbSqlSessionFactory.mapStatement(statement);
List loadedObjects;
if (page!=null) {
loadedObjects = sqlSession.selectList(statement, parameter, new RowBounds(page.getFirstResult(), page.getMaxResults()));
} else {
loadedObjects = sqlSession.selectList(statement, parameter);
}
return filterLoadedObjects(loadedObjects);
}
示例13: execute
import org.activiti.engine.impl.Page; //导入依赖的package包/类
public AcquiredJobs execute(CommandContext commandContext) {
String lockOwner = jobExecutor.getLockOwner();
int lockTimeInMillis = jobExecutor.getLockTimeInMillis();
int maxJobsPerAcquisition = jobExecutor.getMaxJobsPerAcquisition();
AcquiredJobs acquiredJobs = new AcquiredJobs();
List<JobEntity> jobs = commandContext
.getJobManager()
.findNextJobsToExecute(new Page(0, maxJobsPerAcquisition));
for (JobEntity job: jobs) {
List<String> jobIds = new ArrayList<String>();
if (job != null) {
job.setLockOwner(lockOwner);
GregorianCalendar gregorianCalendar = new GregorianCalendar();
gregorianCalendar.setTime(ClockUtil.getCurrentTime());
gregorianCalendar.add(Calendar.MILLISECOND, lockTimeInMillis);
job.setLockExpirationTime(gregorianCalendar.getTime());
jobIds.add(job.getId());
if (job.isExclusive()) {
// TODO acquire other exclusive jobs for the same process instance.
}
}
acquiredJobs.addJobIds(jobIds);
}
return acquiredJobs;
}
示例14: pageUserList
import org.activiti.engine.impl.Page; //导入依赖的package包/类
private List<User> pageUserList(Page page, String[] users, int tenantId)
throws RegistryException, org.wso2.carbon.user.core.UserStoreException {
List<User> userList = new ArrayList<>();
int resultLength = users.length;
int max;
if (page != null) {
if (page.getFirstResult() > resultLength) {
//no more result left, sending empty list
return new ArrayList<>();
}
if (page.getMaxResults() > resultLength) {
max = resultLength;
} else {
max = page.getMaxResults();
}
for (int i = page.getFirstResult(); i < max; i++) {
userList.add(new UserEntity(users[i]));
}
} else {
for (int i = 0; i < resultLength; i++) {
userList.add(new UserEntity(users[i]));
}
}
return userList;
}
示例15: findHistoricProcessInstancesByQueryCriteria
import org.activiti.engine.impl.Page; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public List<HistoricProcessInstance> findHistoricProcessInstancesByQueryCriteria(HistoricProcessInstanceQueryImpl historicProcessInstanceQuery, Page page) {
if (getHistoryManager().isHistoryEnabled()) {
return getDbSqlSession().selectList("selectHistoricProcessInstancesByQueryCriteria", historicProcessInstanceQuery, page);
}
return Collections.EMPTY_LIST;
}