Search in sources :

Example 1 with ParsedDeployment

use of org.activiti.engine.impl.bpmn.deployer.ParsedDeployment in project Activiti by Activiti.

the class ParsedDeploymentTest method testCreateAndQuery.

public void testCreateAndQuery() throws UnsupportedEncodingException {
    DeploymentEntity entity = assembleUnpersistedDeploymentEntity();
    ParsedDeploymentBuilderFactory builderFactory = processEngineConfiguration.getParsedDeploymentBuilderFactory();
    ParsedDeploymentBuilder builder = builderFactory.getBuilderForDeployment(entity);
    ParsedDeployment parsedDeployment = builder.build();
    List<ProcessDefinitionEntity> processDefinitions = parsedDeployment.getAllProcessDefinitions();
    assertThat(parsedDeployment.getDeployment()).isSameAs(entity);
    assertThat(processDefinitions).hasSize(4);
    ProcessDefinitionEntity id1 = getProcessDefinitionEntityFromList(processDefinitions, ID1_ID);
    ProcessDefinitionEntity id2 = getProcessDefinitionEntityFromList(processDefinitions, ID2_ID);
    assertThat(parsedDeployment.getBpmnParseForProcessDefinition(id1)).isSameAs(parsedDeployment.getBpmnParseForProcessDefinition(id2));
    assertThat(parsedDeployment.getBpmnModelForProcessDefinition(id1)).isSameAs(parsedDeployment.getBpmnParseForProcessDefinition(id1).getBpmnModel());
    assertThat(parsedDeployment.getProcessModelForProcessDefinition(id1)).isSameAs(parsedDeployment.getBpmnParseForProcessDefinition(id1).getBpmnModel().getProcessById(id1.getKey()));
    assertThat(parsedDeployment.getResourceForProcessDefinition(id1).getName()).isEqualTo(IDR_XML_NAME);
    assertThat(parsedDeployment.getResourceForProcessDefinition(id2).getName()).isEqualTo(IDR_XML_NAME);
    ProcessDefinitionEntity en1 = getProcessDefinitionEntityFromList(processDefinitions, EN1_ID);
    ProcessDefinitionEntity en2 = getProcessDefinitionEntityFromList(processDefinitions, EN2_ID);
    assertThat(parsedDeployment.getBpmnParseForProcessDefinition(en1)).isSameAs(parsedDeployment.getBpmnParseForProcessDefinition(en2));
    assertThat(parsedDeployment.getBpmnParseForProcessDefinition(en1)).isNotEqualTo(parsedDeployment.getBpmnParseForProcessDefinition(id2));
    assertThat(parsedDeployment.getResourceForProcessDefinition(en1).getName()).isEqualTo(EN_XML_NAME);
    assertThat(parsedDeployment.getResourceForProcessDefinition(en2).getName()).isEqualTo(EN_XML_NAME);
}
Also used : DeploymentEntity(org.activiti.engine.impl.persistence.entity.DeploymentEntity) ParsedDeployment(org.activiti.engine.impl.bpmn.deployer.ParsedDeployment) ParsedDeploymentBuilderFactory(org.activiti.engine.impl.bpmn.deployer.ParsedDeploymentBuilderFactory) ProcessDefinitionEntity(org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity) ParsedDeploymentBuilder(org.activiti.engine.impl.bpmn.deployer.ParsedDeploymentBuilder)

Aggregations

ParsedDeployment (org.activiti.engine.impl.bpmn.deployer.ParsedDeployment)1 ParsedDeploymentBuilder (org.activiti.engine.impl.bpmn.deployer.ParsedDeploymentBuilder)1 ParsedDeploymentBuilderFactory (org.activiti.engine.impl.bpmn.deployer.ParsedDeploymentBuilderFactory)1 DeploymentEntity (org.activiti.engine.impl.persistence.entity.DeploymentEntity)1 ProcessDefinitionEntity (org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity)1