Package org.activiti.engine.repository

Examples of org.activiti.engine.repository.DeploymentQuery


  @SuppressWarnings("unchecked")
  public ListPage<Deployment> listDeployment( ListPage<Deployment> page ){
    if( page == null )
      page = new ListPage<Deployment>();
   
    DeploymentQuery query = repositoryService.createDeploymentQuery();
   
    OrderBy orderBy = page.getOrderBy();
    if( orderBy != null ){
      if( "id".equals(orderBy.getProperty()) )
        query.orderByDeploymentId();
      else if( "deploymentTime".equals(orderBy.getProperty()) )
        query.orderByDeploymenTime();
      else if( "name".equals(orderBy.getProperty()) )
        query.orderByDeploymentName();
    }
   
    return (ListPage<Deployment>)query(query,page);
  }
View Full Code Here


        assertEquals(expectedProcessDefinitionKeys, processDefinitionKeys);
    }

    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());
    }
View Full Code Here

  @Autowired
  protected RepositoryService repositoryService;
 
  @RequestMapping(value="/repository/deployments", method = RequestMethod.GET, produces = "application/json")
  public DataResponse getDeployments(@RequestParam Map<String,String> allRequestParams, HttpServletRequest request) {
    DeploymentQuery deploymentQuery = repositoryService.createDeploymentQuery();
   
    // Apply filters
    if (allRequestParams.containsKey("name")) {
      deploymentQuery.deploymentName(allRequestParams.get("name"));
    }
    if (allRequestParams.containsKey("nameLike")) {
      deploymentQuery.deploymentNameLike(allRequestParams.get("nameLike"));
    }
    if (allRequestParams.containsKey("category")) {
      deploymentQuery.deploymentCategory(allRequestParams.get("category"));
    }
    if (allRequestParams.containsKey("categoryNotEquals")) {
      deploymentQuery.deploymentCategoryNotEquals(allRequestParams.get("categoryNotEquals"));
    }
    if (allRequestParams.containsKey("tenantId")) {
      deploymentQuery.deploymentTenantId(allRequestParams.get("tenantId"));
    }
    if (allRequestParams.containsKey("tenantIdLike")) {
      deploymentQuery.deploymentTenantIdLike(allRequestParams.get("tenantIdLike"));
    }
    if (allRequestParams.containsKey("withoutTenantId")) {
      Boolean withoutTenantId = Boolean.valueOf(allRequestParams.get("withoutTenantId"));
      if (withoutTenantId) {
        deploymentQuery.deploymentWithoutTenantId();
      }
    }

    DataResponse response = new DeploymentsPaginateList(restResponseFactory, request.getRequestURL().toString().replace("/repository/deployments", ""))
        .paginateList(allRequestParams, deploymentQuery, "id", allowedSortProperties);
View Full Code Here

      fail();
    } catch (ActivitiIllegalArgumentException e) {}
  }
 
  public void testQueryByNameAndCategory() {
    DeploymentQuery query = repositoryService.createDeploymentQuery().deploymentCategory("testCategory").deploymentNameLike("%activiti%");
    assertEquals(1, query.list().size());
    assertEquals(1, query.count());
    assertNotNull(query.singleResult());
  }
View Full Code Here

    assertEquals(1, query.count());
    assertNotNull(query.singleResult());
  }
 
  public void testQueryByProcessDefinitionKey() {
    DeploymentQuery query = repositoryService.createDeploymentQuery().processDefinitionKey("one");
    assertEquals(1, query.list().size());
    assertEquals(1, query.count());
    assertNotNull(query.singleResult());
  }
View Full Code Here

    assertEquals(1, query.count());
    assertNotNull(query.singleResult());
  }

  public void testQueryByProcessDefinitionKeyLike() {
    DeploymentQuery query = repositoryService.createDeploymentQuery().processDefinitionKeyLike("%o%");
    assertEquals(2, query.list().size());
    assertEquals(2, query.count());
  }
View Full Code Here

    assertEquals(2, query.list().size());
    assertEquals(2, query.count());
  }
 
  public void testQueryByInvalidProcessDefinitionKeyLike() {
    DeploymentQuery query = repositoryService.createDeploymentQuery().processDefinitionKeyLike("invalid");
    assertEquals(0, query.list().size());
    assertEquals(0, query.count());
  }
View Full Code Here

        .category("two")
        .addClasspathResource("org/activiti/engine/test/repository/two.bpmn20.xml")
        .deploy()
        .getId();
           
      DeploymentQuery query = repositoryService.createDeploymentQuery();
      assertEquals(4, query.list().size());
     
      Set<String> deploymentNames = getDeploymentNames(repositoryService
        .createDeploymentQuery()
        .deploymentCategory("one")
        .list());
View Full Code Here

    repositoryService.deleteDeployment(deploymentOneId, true);
    repositoryService.deleteDeployment(deploymentTwoId, true);
  }
 
  public void testQueryNoCriteria() {
    DeploymentQuery query = repositoryService.createDeploymentQuery();
    assertEquals(2, query.list().size());
    assertEquals(2, query.count());
   
    try {
      query.singleResult();
      fail();
    } catch (ActivitiException e) {}
  }
View Full Code Here

      fail();
    } catch (ActivitiException e) {}
  }
 
  public void testQueryByDeploymentId() {
    DeploymentQuery query = repositoryService.createDeploymentQuery().deploymentId(deploymentOneId);
    assertNotNull(query.singleResult());
    assertEquals(1, query.list().size());
    assertEquals(1, query.count());
  }
View Full Code Here

TOP

Related Classes of org.activiti.engine.repository.DeploymentQuery

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.