本文整理匯總了Java中org.activiti.engine.repository.ModelQuery類的典型用法代碼示例。如果您正苦於以下問題:Java ModelQuery類的具體用法?Java ModelQuery怎麽用?Java ModelQuery使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ModelQuery類屬於org.activiti.engine.repository包,在下文中一共展示了ModelQuery類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getModelList
import org.activiti.engine.repository.ModelQuery; //導入依賴的package包/類
@Override
public List<Model> getModelList(QueryCondition condition, PageInfo pageInfo) {
String name = null;
if (condition != null)
name = condition.getConditionMap().get("name").toString();
List<Model> modelList;
long count;
ModelQuery query = repositoryService.createModelQuery();
if (!StrUtil.isEmpty(name)) {
query = query.modelNameLike(name);
}
count = query.count();
modelList = query.orderByCreateTime().desc().listPage((pageInfo.getPageNum() - 1) * pageInfo.getPageSize(), pageInfo.getPageSize());
pageInfo.setCount((int) count);
return modelList;
}
示例2: testByLatestVersion
import org.activiti.engine.repository.ModelQuery; //導入依賴的package包/類
public void testByLatestVersion() {
ModelQuery query = repositoryService.createModelQuery().latestVersion().modelKey("someKey");
Model model = query.singleResult();
assertNotNull(model);
// Add a new version of the model
Model newVersion = repositoryService.newModel();
newVersion.setName("my model");
newVersion.setKey("someKey");
newVersion.setCategory("test");
newVersion.setVersion(model.getVersion() + 1);
repositoryService.saveModel(newVersion);
// Verify query
model = query.singleResult();
assertNotNull(model);
assertTrue(model.getVersion() == 2);
// Cleanup
repositoryService.deleteModel(model.getId());
}
示例3: modelList
import org.activiti.engine.repository.ModelQuery; //導入依賴的package包/類
/**
* 流程模型列表
*/
public Page<org.activiti.engine.repository.Model> modelList(Page<org.activiti.engine.repository.Model> page, String category) {
ModelQuery modelQuery = repositoryService.createModelQuery().latestVersion().orderByLastUpdateTime().desc();
if (StringUtils.isNotEmpty(category)){
modelQuery.modelCategory(category);
}
page.setCount(modelQuery.count());
page.setList(modelQuery.listPage(page.getFirstResult(), page.getMaxResults()));
return page;
}
示例4: modelKey
import org.activiti.engine.repository.ModelQuery; //導入依賴的package包/類
@Override
public ModelQuery modelKey(String key) {
if (key == null) {
throw new ActivitiIllegalArgumentException("key is null");
}
this.key = key;
return this;
}
示例5: notDeployed
import org.activiti.engine.repository.ModelQuery; //導入依賴的package包/類
@Override
public ModelQuery notDeployed() {
if (deployed) {
throw new ActivitiIllegalArgumentException("Invalid usage: cannot use deployed() and notDeployed() in the same query");
}
this.notDeployed = true;
return this;
}
示例6: deployed
import org.activiti.engine.repository.ModelQuery; //導入依賴的package包/類
@Override
public ModelQuery deployed() {
if (notDeployed) {
throw new ActivitiIllegalArgumentException("Invalid usage: cannot use deployed() and notDeployed() in the same query");
}
this.deployed = true;
return this;
}
示例7: modelTenantId
import org.activiti.engine.repository.ModelQuery; //導入依賴的package包/類
@Override
public ModelQuery modelTenantId(String tenantId) {
if (tenantId == null) {
throw new ActivitiIllegalArgumentException("Model tenant id is null");
}
this.tenantId = tenantId;
return this;
}
示例8: modelTenantIdLike
import org.activiti.engine.repository.ModelQuery; //導入依賴的package包/類
@Override
public ModelQuery modelTenantIdLike(String tenantIdLike) {
if (tenantIdLike == null) {
throw new ActivitiIllegalArgumentException("Model tenant id is null");
}
this.tenantIdLike = tenantIdLike;
return this;
}
示例9: modelList
import org.activiti.engine.repository.ModelQuery; //導入依賴的package包/類
/**
* 模型列表
*/
@RequestMapping(value = {"", "list"})
public ModelAndView modelList(HttpServletRequest request) {
ModelAndView mav = new ModelAndView("chapter20/model-list");
Page<Model> page = new Page<Model>(PageUtil.PAGE_SIZE);
int[] pageParams = PageUtil.init(page, request);
ModelQuery modelQuery = repositoryService.createModelQuery();
List<Model> list = modelQuery.listPage(pageParams[0], pageParams[1]);
page.setResult(list);
page.setTotalCount(modelQuery.count());
mav.addObject("page", page);
return mav;
}
示例10: modelKey
import org.activiti.engine.repository.ModelQuery; //導入依賴的package包/類
public ModelQuery modelKey(String key) {
if (key == null) {
throw new ActivitiIllegalArgumentException("key is null");
}
this.key = key;
return this;
}
示例11: notDeployed
import org.activiti.engine.repository.ModelQuery; //導入依賴的package包/類
public ModelQuery notDeployed() {
if (deployed == true) {
throw new ActivitiIllegalArgumentException("Invalid usage: cannot use deployed() and notDeployed() in the same query");
}
this.notDeployed = true;
return this;
}
示例12: deployed
import org.activiti.engine.repository.ModelQuery; //導入依賴的package包/類
public ModelQuery deployed() {
if (notDeployed == true) {
throw new ActivitiIllegalArgumentException("Invalid usage: cannot use deployed() and notDeployed() in the same query");
}
this.deployed = true;
return this;
}
示例13: testModelProperties
import org.activiti.engine.repository.ModelQuery; //導入依賴的package包/類
public void testModelProperties() {
ModelQuery query = repositoryService.createModelQuery();
Model model = query.singleResult();
assertNotNull(model.getId());
assertNotNull(model.getCategory());
assertNotNull(model.getKey());
assertNotNull(model.getName());
assertNotNull(model.getVersion());
assertNotNull(model.getCreateTime());
assertNotNull(model.getLastUpdateTime());
}
示例14: testQueryByName
import org.activiti.engine.repository.ModelQuery; //導入依賴的package包/類
public void testQueryByName() throws Exception {
ModelQuery query = repositoryService.createModelQuery().modelName("my model");
Model model = query.singleResult();
assertNotNull(model);
assertEquals("bytes", new String(repositoryService.getModelEditorSource(model.getId()), "utf-8"));
assertEquals(1, query.list().size());
assertEquals(1, query.count());
}
示例15: testQueryByNameLike
import org.activiti.engine.repository.ModelQuery; //導入依賴的package包/類
public void testQueryByNameLike() throws Exception {
ModelQuery query = repositoryService.createModelQuery().modelNameLike("%model%");
Model model = query.singleResult();
assertNotNull(model);
assertEquals("bytes", new String(repositoryService.getModelEditorSource(model.getId()), "utf-8"));
assertEquals(1, query.list().size());
assertEquals(1, query.count());
}