本文整理汇总了Java中org.activiti.engine.repository.DeploymentQuery类的典型用法代码示例。如果您正苦于以下问题:Java DeploymentQuery类的具体用法?Java DeploymentQuery怎么用?Java DeploymentQuery使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DeploymentQuery类属于org.activiti.engine.repository包,在下文中一共展示了DeploymentQuery类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getProcessById
import org.activiti.engine.repository.DeploymentQuery; //导入依赖的package包/类
public BPMNProcess getProcessById(String processId) {
Integer tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
ProcessEngine engine = BPMNServerHolder.getInstance().getEngine();
ProcessDefinitionQuery query = engine.getRepositoryService().createProcessDefinitionQuery();
ProcessDefinition process = query.processDefinitionTenantId(tenantId.toString())
.processDefinitionId(processId).singleResult();
DeploymentQuery deploymentQuery = engine.getRepositoryService().createDeploymentQuery();
Deployment deployment = deploymentQuery.deploymentId(process.getDeploymentId()).singleResult();
BPMNProcess bpmnProcess = new BPMNProcess();
bpmnProcess.setDeploymentId(process.getDeploymentId());
bpmnProcess.setName(process.getName());
bpmnProcess.setKey(process.getKey());
bpmnProcess.setProcessId(process.getId());
bpmnProcess.setVersion(process.getVersion());
bpmnProcess.setDeploymentTime(deployment.getDeploymentTime());
bpmnProcess.setDeploymentName(deployment.getName());
return bpmnProcess;
}
开发者ID:wso2,项目名称:carbon-business-process,代码行数:19,代码来源:BPMNDeploymentService.java
示例2: getProcessesByDeploymentId
import org.activiti.engine.repository.DeploymentQuery; //导入依赖的package包/类
public BPMNProcess[] getProcessesByDeploymentId(String deploymentId) {
List<BPMNProcess> bpmnProcesses = new ArrayList<>();
Integer tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
ProcessEngine engine = BPMNServerHolder.getInstance().getEngine();
ProcessDefinitionQuery query = engine.getRepositoryService().createProcessDefinitionQuery();
DeploymentQuery deploymentQuery = engine.getRepositoryService().createDeploymentQuery();
Deployment deployment = deploymentQuery.deploymentId(deploymentId).singleResult();
List<ProcessDefinition> processes = query.processDefinitionTenantId(tenantId.toString())
.deploymentId(deploymentId).list();
for(ProcessDefinition process: processes){
BPMNProcess bpmnProcess = new BPMNProcess();
bpmnProcess.setDeploymentId(process.getDeploymentId());
bpmnProcess.setName(process.getName());
bpmnProcess.setKey(process.getKey());
bpmnProcess.setProcessId(process.getId());
bpmnProcess.setVersion(process.getVersion());
bpmnProcess.setDeploymentTime(deployment.getDeploymentTime());
bpmnProcess.setDeploymentName(deployment.getName());
bpmnProcesses.add(bpmnProcess);
}
return bpmnProcesses.toArray(new BPMNProcess[bpmnProcesses.size()]);
}
开发者ID:wso2,项目名称:carbon-business-process,代码行数:23,代码来源:BPMNDeploymentService.java
示例3: getDeploymentsByName
import org.activiti.engine.repository.DeploymentQuery; //导入依赖的package包/类
/**
* Get the deployments for given package name , order by deploymentID
*
* @param deploymentName
* @return
*/
public BPMNDeployment[] getDeploymentsByName(String deploymentName) {
List<BPMNDeployment> bpmnDeploymentList = new ArrayList<>();
Integer tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
DeploymentQuery query = BPMNServerHolder.getInstance().getEngine().getRepositoryService()
.createDeploymentQuery();
// Set deployment name and order by ID
query = query.deploymentTenantId(tenantId.toString()).deploymentName(deploymentName).orderByDeploymentId()
.desc();
List<Deployment> deployments = query.list();
for (Deployment deployment : deployments) {
BPMNDeployment bpmnDeployment = new BPMNDeployment();
bpmnDeployment.setDeploymentId(deployment.getId());
bpmnDeployment.setDeploymentName(deployment.getName());
bpmnDeployment.setDeploymentTime(deployment.getDeploymentTime());
bpmnDeploymentList.add(bpmnDeployment);
}
return bpmnDeploymentList.toArray(new BPMNDeployment[bpmnDeploymentList.size()]);
}
开发者ID:wso2,项目名称:carbon-business-process,代码行数:25,代码来源:BPMNDeploymentService.java
示例4: getPaginatedDeploymentsByFilter
import org.activiti.engine.repository.DeploymentQuery; //导入依赖的package包/类
public BPMNDeployment[] getPaginatedDeploymentsByFilter(String method, String filter, int start, int size) {
List<BPMNDeployment> bpmnDeploymentList = new ArrayList<>();
Integer tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
DeploymentQuery query = BPMNServerHolder.getInstance().getEngine().getRepositoryService().createDeploymentQuery();
query = query.deploymentTenantId(tenantId.toString());
if(filter != null && !filter.equals("") && method != null && !method.equals("")){
if(method.equals("byDeploymentNameLike")){
query = query.deploymentNameLike("%" + filter + "%");
} else {
query = query.processDefinitionKeyLike("%" + filter + "%");
}
}
deploymentCount = (int) query.count();
List<Deployment> deployments = query.listPage(start, size);
for(Deployment deployment: deployments){
BPMNDeployment bpmnDeployment = new BPMNDeployment();
bpmnDeployment.setDeploymentId(deployment.getId());
bpmnDeployment.setDeploymentName(deployment.getName());
bpmnDeployment.setDeploymentTime(deployment.getDeploymentTime());
bpmnDeploymentList.add(bpmnDeployment);
}
return bpmnDeploymentList.toArray(new BPMNDeployment[bpmnDeploymentList.size()]);
}
开发者ID:wso2,项目名称:carbon-business-process,代码行数:24,代码来源:BPMNDeploymentService.java
示例5: getDeployments
import org.activiti.engine.repository.DeploymentQuery; //导入依赖的package包/类
@Override
public CollectionWithPagingInfo<Deployment> getDeployments(Paging paging)
{
// Only admin-user is allowed to get deployments
if(!authorityService.isAdminAuthority(AuthenticationUtil.getRunAsUser())) {
throw new PermissionDeniedException();
}
DeploymentQuery query = activitiProcessEngine
.getRepositoryService()
.createDeploymentQuery()
.deploymentCategoryNotEquals(WorkflowDeployer.CATEGORY_ALFRESCO_INTERNAL);
if (tenantService.isEnabled() && deployWorkflowsInTenant)
{
query.processDefinitionKeyLike("@" + TenantUtil.getCurrentDomain() + "@%");
}
query.orderByDeploymenTime().desc();
List<org.activiti.engine.repository.Deployment> deployments = query.listPage(paging.getSkipCount(), paging.getMaxItems());
int totalCount = (int) query.count();
List<Deployment> page = new ArrayList<Deployment>(deployments.size());
for (org.activiti.engine.repository.Deployment deployment: deployments)
{
page.add(new Deployment(deployment));
}
return CollectionWithPagingInfo.asPaged(paging, page, (page.size() + paging.getSkipCount()) < totalCount, totalCount);
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:31,代码来源:DeploymentsImpl.java
示例6: getDeployment
import org.activiti.engine.repository.DeploymentQuery; //导入依赖的package包/类
@Override
public Deployment getDeployment(String deploymentId)
{
// Only admin-user is allowed to get deployments
if(!authorityService.isAdminAuthority(AuthenticationUtil.getRunAsUser())) {
throw new PermissionDeniedException();
}
RepositoryService repositoryService = activitiProcessEngine.getRepositoryService();
DeploymentQuery query = repositoryService
.createDeploymentQuery()
.deploymentId(deploymentId);
if (tenantService.isEnabled() && deployWorkflowsInTenant)
{
query.processDefinitionKeyLike("@" + TenantUtil.getCurrentDomain() + "@%");
}
org.activiti.engine.repository.Deployment deployment = null;
try
{
deployment = query.singleResult();
}
catch(ActivitiException e)
{
// The next exception will cause a response status 400: Bad request
throw new InvalidArgumentException("Invalid deployment id: " + deploymentId);
}
if (deployment == null)
{
// The next exception will cause a response status 404: Not found
throw new EntityNotFoundException(deploymentId);
}
Deployment deploymentRest = new Deployment(deployment);
return deploymentRest;
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:40,代码来源:DeploymentsImpl.java
示例7: testNoRedeploymentForSpringContainerRestart
import org.activiti.engine.repository.DeploymentQuery; //导入依赖的package包/类
public void testNoRedeploymentForSpringContainerRestart() throws Exception {
createAppContext(CTX_PATH);
DeploymentQuery deploymentQuery = repositoryService.createDeploymentQuery();
assertEquals(1, deploymentQuery.count());
ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery();
assertEquals(3, processDefinitionQuery.count());
// Creating a new app context with same resources doesn't lead to more deployments
new ClassPathXmlApplicationContext(CTX_NO_DROP_PATH);
assertEquals(1, deploymentQuery.count());
assertEquals(3, processDefinitionQuery.count());
}
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:13,代码来源:SpringAutoDeployTest.java
示例8: testQueryNoCriteria
import org.activiti.engine.repository.DeploymentQuery; //导入依赖的package包/类
public void testQueryNoCriteria() {
DeploymentQuery query = repositoryService.createDeploymentQuery();
assertEquals(2, query.list().size());
assertEquals(2, query.count());
try {
query.singleResult();
fail();
} catch (ActivitiException e) {}
}
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:11,代码来源:DeploymentQueryTest.java
示例9: testQueryByInvalidDeploymentId
import org.activiti.engine.repository.DeploymentQuery; //导入依赖的package包/类
public void testQueryByInvalidDeploymentId() {
DeploymentQuery query = repositoryService.createDeploymentQuery().deploymentId("invalid");
assertNull(query.singleResult());
assertEquals(0, query.list().size());
assertEquals(0, query.count());
try {
repositoryService.createDeploymentQuery().deploymentId(null);
fail();
} catch (ActivitiException e) {}
}
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:12,代码来源:DeploymentQueryTest.java
示例10: testQueryByInvalidName
import org.activiti.engine.repository.DeploymentQuery; //导入依赖的package包/类
public void testQueryByInvalidName() {
DeploymentQuery query = repositoryService.createDeploymentQuery().deploymentName("invalid");
assertNull(query.singleResult());
assertEquals(0, query.list().size());
assertEquals(0, query.count());
try {
repositoryService.createDeploymentQuery().deploymentName(null);
fail();
} catch (ActivitiException e) {}
}
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:12,代码来源:DeploymentQueryTest.java
示例11: testQueryByNameLike
import org.activiti.engine.repository.DeploymentQuery; //导入依赖的package包/类
public void testQueryByNameLike() {
DeploymentQuery query = repositoryService.createDeploymentQuery().deploymentNameLike("%activiti%");
assertEquals(2, query.list().size());
assertEquals(2, query.count());
try {
query.singleResult();
fail();
} catch (ActivitiException e) {}
}
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:11,代码来源:DeploymentQueryTest.java
示例12: testQueryByInvalidNameLike
import org.activiti.engine.repository.DeploymentQuery; //导入依赖的package包/类
public void testQueryByInvalidNameLike() {
DeploymentQuery query = repositoryService.createDeploymentQuery().deploymentNameLike("invalid");
assertNull(query.singleResult());
assertEquals(0, query.list().size());
assertEquals(0, query.count());
try {
repositoryService.createDeploymentQuery().deploymentNameLike(null);
fail();
} catch (ActivitiException e) {}
}
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:12,代码来源:DeploymentQueryTest.java
示例13: getDeployments
import org.activiti.engine.repository.DeploymentQuery; //导入依赖的package包/类
public BPMNDeployment[] getDeployments() {
List<BPMNDeployment> bpmnDeploymentList = new ArrayList<>();
Integer tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
DeploymentQuery query = BPMNServerHolder.getInstance().getEngine().getRepositoryService().createDeploymentQuery();
query = query.deploymentTenantId(tenantId.toString());
List<Deployment> deployments = query.list();
for(Deployment deployment: deployments){
BPMNDeployment bpmnDeployment = new BPMNDeployment();
bpmnDeployment.setDeploymentId(deployment.getId());
bpmnDeployment.setDeploymentName(deployment.getName());
bpmnDeployment.setDeploymentTime(deployment.getDeploymentTime());
bpmnDeploymentList.add(bpmnDeployment);
}
return bpmnDeploymentList.toArray(new BPMNDeployment[bpmnDeploymentList.size()]);
}
开发者ID:wso2,项目名称:carbon-business-process,代码行数:16,代码来源:BPMNDeploymentService.java
示例14: getDeploymentCount
import org.activiti.engine.repository.DeploymentQuery; //导入依赖的package包/类
public int getDeploymentCount() throws BPSFault {
if (deploymentCount == -1) {
Integer tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
DeploymentQuery query = BPMNServerHolder.getInstance().getEngine().getRepositoryService().createDeploymentQuery();
deploymentCount = (int) query.deploymentTenantId(tenantId.toString()).count();
}
return deploymentCount;
}
开发者ID:wso2,项目名称:carbon-business-process,代码行数:9,代码来源:BPMNDeploymentService.java
示例15: undeploy
import org.activiti.engine.repository.DeploymentQuery; //导入依赖的package包/类
public void undeploy (String deploymentName ) throws BPSFault {
Integer tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
ProcessEngine processEngine = BPMNServerHolder.getInstance().getEngine();
DeploymentQuery query = processEngine.getRepositoryService().createDeploymentQuery();
query = query.deploymentTenantId(tenantId.toString());
query = query.deploymentNameLike("%" + deploymentName + "%");
int deploymentCount = (int) query.count();
log.info("Package " + deploymentName + " id going to be undeployed for the deployment count : " + deploymentCount);
BPMNDeletableInstances bpmnDeletableInstances = new BPMNDeletableInstances();
bpmnDeletableInstances.setTenantId(tenantId);
List<Deployment> deployments = query.listPage(0, deploymentCount+1);
for(Deployment deployment: deployments){
aggregateRemovableProcessInstances(bpmnDeletableInstances, deployment.getId(), tenantId, processEngine);
}
if( (bpmnDeletableInstances.getActiveInstanceCount() + bpmnDeletableInstances.getCompletedInstanceCount()) > maximumDeleteCount){
String errorMessage = " Failed to un deploy the package. Please delete the instances before un deploying " +
"the package";
throw new BPSFault(errorMessage, new Exception(errorMessage));
}
deleteInstances(bpmnDeletableInstances, processEngine);
TenantRepository tenantRepository = BPMNServerHolder.getInstance().getTenantManager().getTenantRepository(tenantId);
tenantRepository.undeploy(deploymentName, false);
}
开发者ID:wso2,项目名称:carbon-business-process,代码行数:30,代码来源:BPMNDeploymentService.java
示例16: testQueryByInvalidDeploymentId
import org.activiti.engine.repository.DeploymentQuery; //导入依赖的package包/类
public void testQueryByInvalidDeploymentId() {
DeploymentQuery query = repositoryService.createDeploymentQuery().deploymentId("invalid");
assertNull(query.singleResult());
assertEquals(0, query.list().size());
assertEquals(0, query.count());
try {
repositoryService.createDeploymentQuery().deploymentId(null);
fail();
} catch (ActivitiIllegalArgumentException e) {}
}
开发者ID:springvelocity,项目名称:xbpm5,代码行数:12,代码来源:DeploymentQueryTest.java
示例17: testQueryByInvalidName
import org.activiti.engine.repository.DeploymentQuery; //导入依赖的package包/类
public void testQueryByInvalidName() {
DeploymentQuery query = repositoryService.createDeploymentQuery().deploymentName("invalid");
assertNull(query.singleResult());
assertEquals(0, query.list().size());
assertEquals(0, query.count());
try {
repositoryService.createDeploymentQuery().deploymentName(null);
fail();
} catch (ActivitiIllegalArgumentException e) {}
}
开发者ID:springvelocity,项目名称:xbpm5,代码行数:12,代码来源:DeploymentQueryTest.java
示例18: testQueryByInvalidNameLike
import org.activiti.engine.repository.DeploymentQuery; //导入依赖的package包/类
public void testQueryByInvalidNameLike() {
DeploymentQuery query = repositoryService.createDeploymentQuery().deploymentNameLike("invalid");
assertNull(query.singleResult());
assertEquals(0, query.list().size());
assertEquals(0, query.count());
try {
repositoryService.createDeploymentQuery().deploymentNameLike(null);
fail();
} catch (ActivitiIllegalArgumentException e) {}
}
开发者ID:springvelocity,项目名称:xbpm5,代码行数:12,代码来源:DeploymentQueryTest.java
示例19: createDeploymentQuery
import org.activiti.engine.repository.DeploymentQuery; //导入依赖的package包/类
/** Query deployment. */
DeploymentQuery createDeploymentQuery();
开发者ID:flowable,项目名称:flowable-engine,代码行数:3,代码来源:RepositoryService.java
示例20: createDeploymentQuery
import org.activiti.engine.repository.DeploymentQuery; //导入依赖的package包/类
@Override
public DeploymentQuery createDeploymentQuery() {
return new DeploymentQueryImpl(commandExecutor);
}
开发者ID:flowable,项目名称:flowable-engine,代码行数:5,代码来源:RepositoryServiceImpl.java
注:本文中的org.activiti.engine.repository.DeploymentQuery类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论