Search in sources :

Example 6 with ProcessesXml

use of org.camunda.bpm.application.impl.metadata.spi.ProcessesXml in project camunda-bpm-platform by camunda.

the class ProcessesXmlStartProcessEnginesStep method getProcessEnginesXmls.

protected List<ProcessEngineXml> getProcessEnginesXmls(DeploymentOperation operationContext) {
    final Map<URL, ProcessesXml> processesXmls = operationContext.getAttachment(PROCESSES_XML_RESOURCES);
    List<ProcessEngineXml> processEngines = new ArrayList<ProcessEngineXml>();
    for (ProcessesXml processesXml : processesXmls.values()) {
        processEngines.addAll(processesXml.getProcessEngines());
    }
    return processEngines;
}
Also used : ProcessesXml(org.camunda.bpm.application.impl.metadata.spi.ProcessesXml) ProcessEngineXml(org.camunda.bpm.container.impl.metadata.spi.ProcessEngineXml) ArrayList(java.util.ArrayList) URL(java.net.URL)

Example 7 with ProcessesXml

use of org.camunda.bpm.application.impl.metadata.spi.ProcessesXml in project camunda-bpm-platform by camunda.

the class EmptyProcessesXmlTest method testDefaultValues.

public void testDefaultValues() {
    ProcessesXml emptyProcessesXml = ProcessesXml.EMPTY_PROCESSES_XML;
    assertNotNull(emptyProcessesXml);
    assertNotNull(emptyProcessesXml.getProcessEngines());
    assertEquals(0, emptyProcessesXml.getProcessEngines().size());
    assertNotNull(emptyProcessesXml.getProcessArchives());
    assertEquals(1, emptyProcessesXml.getProcessArchives().size());
    ProcessArchiveXml processArchiveXml = emptyProcessesXml.getProcessArchives().get(0);
    assertNull(processArchiveXml.getName());
    assertNull(processArchiveXml.getProcessEngineName());
    assertNotNull(processArchiveXml.getProcessResourceNames());
    assertEquals(0, processArchiveXml.getProcessResourceNames().size());
    Map<String, String> properties = processArchiveXml.getProperties();
    assertNotNull(properties);
    assertEquals(4, properties.size());
    String isDeleteUponUndeploy = properties.get(ProcessArchiveXml.PROP_IS_DELETE_UPON_UNDEPLOY);
    assertNotNull(isDeleteUponUndeploy);
    assertEquals(Boolean.FALSE.toString(), isDeleteUponUndeploy);
    String isScanForProcessDefinitions = properties.get(ProcessArchiveXml.PROP_IS_SCAN_FOR_PROCESS_DEFINITIONS);
    assertNotNull(isScanForProcessDefinitions);
    assertEquals(Boolean.TRUE.toString(), isScanForProcessDefinitions);
    String isDeployChangedOnly = properties.get(ProcessArchiveXml.PROP_IS_DEPLOY_CHANGED_ONLY);
    assertNotNull(isDeployChangedOnly);
    assertEquals(Boolean.FALSE.toString(), isDeployChangedOnly);
    String resumePreviousBy = properties.get(ProcessArchiveXml.PROP_RESUME_PREVIOUS_BY);
    assertThat(resumePreviousBy, is(notNullValue()));
    assertThat(resumePreviousBy, is(ResumePreviousBy.RESUME_BY_PROCESS_DEFINITION_KEY));
}
Also used : ProcessesXml(org.camunda.bpm.application.impl.metadata.spi.ProcessesXml) ProcessArchiveXml(org.camunda.bpm.application.impl.metadata.spi.ProcessArchiveXml)

Example 8 with ProcessesXml

use of org.camunda.bpm.application.impl.metadata.spi.ProcessesXml in project camunda-bpm-platform by camunda.

the class ProcessesXmlParserTest method testParseProcessesXmlOneArchive.

public void testParseProcessesXmlOneArchive() {
    ProcessesXml processesXml = parser.createParse().sourceUrl(getStreamUrl("process_xml_one_archive.xml")).execute().getProcessesXml();
    assertNotNull(processesXml);
    assertEquals(0, processesXml.getProcessEngines().size());
    assertEquals(1, processesXml.getProcessArchives().size());
    ProcessArchiveXml archiveXml1 = processesXml.getProcessArchives().get(0);
    assertEquals("pa1", archiveXml1.getName());
    assertEquals("default", archiveXml1.getProcessEngineName());
    List<String> resourceNames = archiveXml1.getProcessResourceNames();
    assertEquals(2, resourceNames.size());
    assertEquals("process1.bpmn", resourceNames.get(0));
    assertEquals("process2.bpmn", resourceNames.get(1));
    Map<String, String> properties1 = archiveXml1.getProperties();
    assertNotNull(properties1);
    assertEquals(2, properties1.size());
    assertEquals("value1", properties1.get("prop1"));
    assertEquals("value2", properties1.get("prop2"));
}
Also used : ProcessesXml(org.camunda.bpm.application.impl.metadata.spi.ProcessesXml) ProcessArchiveXml(org.camunda.bpm.application.impl.metadata.spi.ProcessArchiveXml)

Example 9 with ProcessesXml

use of org.camunda.bpm.application.impl.metadata.spi.ProcessesXml in project camunda-bpm-platform by camunda.

the class ProcessesXmlParserTest method testParseProcessesXmlOneEngine.

public void testParseProcessesXmlOneEngine() {
    ProcessesXml processesXml = parser.createParse().sourceUrl(getStreamUrl("process_xml_one_engine.xml")).execute().getProcessesXml();
    assertNotNull(processesXml);
    assertEquals(1, processesXml.getProcessEngines().size());
    assertEquals(0, processesXml.getProcessArchives().size());
    ProcessEngineXml engineXml = processesXml.getProcessEngines().get(0);
    assertEquals("default", engineXml.getName());
    assertEquals("default", engineXml.getJobAcquisitionName());
    assertEquals("configuration", engineXml.getConfigurationClass());
    assertEquals("datasource", engineXml.getDatasource());
    Map<String, String> properties = engineXml.getProperties();
    assertNotNull(properties);
    assertEquals(2, properties.size());
    assertEquals("value1", properties.get("prop1"));
    assertEquals("value2", properties.get("prop2"));
}
Also used : ProcessesXml(org.camunda.bpm.application.impl.metadata.spi.ProcessesXml) ProcessEngineXml(org.camunda.bpm.container.impl.metadata.spi.ProcessEngineXml)

Example 10 with ProcessesXml

use of org.camunda.bpm.application.impl.metadata.spi.ProcessesXml in project camunda-bpm-platform by camunda.

the class ProcessesXmlProcessor method parseProcessesXml.

protected ProcessesXml parseProcessesXml(URL url) {
    final ProcessesXmlParser processesXmlParser = new ProcessesXmlParser();
    ProcessesXml processesXml = processesXmlParser.createParse().sourceUrl(url).execute().getProcessesXml();
    return processesXml;
}
Also used : ProcessesXml(org.camunda.bpm.application.impl.metadata.spi.ProcessesXml) ProcessesXmlParser(org.camunda.bpm.application.impl.metadata.ProcessesXmlParser)

Aggregations

ProcessesXml (org.camunda.bpm.application.impl.metadata.spi.ProcessesXml)19 ProcessArchiveXml (org.camunda.bpm.application.impl.metadata.spi.ProcessArchiveXml)8 URL (java.net.URL)5 AbstractProcessApplication (org.camunda.bpm.application.AbstractProcessApplication)4 ProcessEngineXml (org.camunda.bpm.container.impl.metadata.spi.ProcessEngineXml)4 JmxManagedProcessApplication (org.camunda.bpm.container.impl.jmx.services.JmxManagedProcessApplication)3 PlatformServiceContainer (org.camunda.bpm.container.impl.spi.PlatformServiceContainer)3 ArrayList (java.util.ArrayList)2 ProcessesXmlParser (org.camunda.bpm.application.impl.metadata.ProcessesXmlParser)2 DeployedProcessArchive (org.camunda.bpm.container.impl.deployment.util.DeployedProcessArchive)2 ProcessesXmlWrapper (org.camunda.bpm.container.impl.jboss.util.ProcessesXmlWrapper)2 DeploymentUnit (org.jboss.as.server.deployment.DeploymentUnit)2 Module (org.jboss.modules.Module)2 HashMap (java.util.HashMap)1 ProcessApplicationInfoImpl (org.camunda.bpm.application.impl.ProcessApplicationInfoImpl)1 ProcessApplicationDeploymentService (org.camunda.bpm.container.impl.jboss.service.ProcessApplicationDeploymentService)1 ProcessApplicationStartService (org.camunda.bpm.container.impl.jboss.service.ProcessApplicationStartService)1 ProcessApplicationStopService (org.camunda.bpm.container.impl.jboss.service.ProcessApplicationStopService)1 BpmPlatformPlugins (org.camunda.bpm.container.impl.plugin.BpmPlatformPlugins)1 ProcessEngine (org.camunda.bpm.engine.ProcessEngine)1