Search in sources :

Example 6 with ProcessEngineXml

use of org.camunda.bpm.container.impl.metadata.spi.ProcessEngineXml in project camunda-bpm-platform by camunda.

the class ProcessesXmlParse method parseRootElement.

/**
 * we know this is a <code>&lt;process-application ... /&gt;</code> structure.
 */
@Override
protected void parseRootElement() {
    List<ProcessEngineXml> processEngines = new ArrayList<ProcessEngineXml>();
    List<ProcessArchiveXml> processArchives = new ArrayList<ProcessArchiveXml>();
    for (Element element : rootElement.elements()) {
        if (PROCESS_ENGINE.equals(element.getTagName())) {
            parseProcessEngine(element, processEngines);
        } else if (PROCESS_ARCHIVE.equals(element.getTagName())) {
            parseProcessArchive(element, processArchives);
        }
    }
    processesXml = new ProcessesXmlImpl(processEngines, processArchives);
}
Also used : ProcessEngineXml(org.camunda.bpm.container.impl.metadata.spi.ProcessEngineXml) ProcessArchiveXml(org.camunda.bpm.application.impl.metadata.spi.ProcessArchiveXml) Element(org.camunda.bpm.engine.impl.util.xml.Element) ArrayList(java.util.ArrayList)

Example 7 with ProcessEngineXml

use of org.camunda.bpm.container.impl.metadata.spi.ProcessEngineXml in project camunda-bpm-platform by camunda.

the class ProcessesXmlParserTest method testParseProcessesXmlTwoArchivesAndTwoEngines.

public void testParseProcessesXmlTwoArchivesAndTwoEngines() {
    ProcessesXml processesXml = parser.createParse().sourceUrl(getStreamUrl("process_xml_two_archives_two_engines.xml")).execute().getProcessesXml();
    assertNotNull(processesXml);
    assertEquals(2, processesXml.getProcessEngines().size());
    assertEquals(2, processesXml.getProcessArchives().size());
    // validate archives
    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"));
    ProcessArchiveXml archiveXml2 = processesXml.getProcessArchives().get(1);
    assertEquals("pa2", archiveXml2.getName());
    assertEquals("default", archiveXml2.getProcessEngineName());
    List<String> resourceNames2 = archiveXml2.getProcessResourceNames();
    assertEquals(2, resourceNames.size());
    assertEquals("process1.bpmn", resourceNames2.get(0));
    assertEquals("process2.bpmn", resourceNames2.get(1));
    Map<String, String> properties2 = archiveXml2.getProperties();
    assertNotNull(properties2);
    assertEquals(0, properties2.size());
    // validate engines
    ProcessEngineXml engineXml1 = processesXml.getProcessEngines().get(0);
    assertEquals("engine1", engineXml1.getName());
    assertEquals("configuration", engineXml1.getConfigurationClass());
    assertEquals("datasource", engineXml1.getDatasource());
    properties1 = engineXml1.getProperties();
    assertNotNull(properties1);
    assertEquals(2, properties1.size());
    assertEquals("value1", properties1.get("prop1"));
    assertEquals("value2", properties1.get("prop2"));
    ProcessEngineXml engineXml2 = processesXml.getProcessEngines().get(1);
    assertEquals("engine2", engineXml2.getName());
    assertEquals("configuration", engineXml2.getConfigurationClass());
    assertEquals("datasource", engineXml2.getDatasource());
    // the second engine has no properties
    properties2 = engineXml2.getProperties();
    assertNotNull(properties2);
    assertEquals(0, properties2.size());
}
Also used : ProcessesXml(org.camunda.bpm.application.impl.metadata.spi.ProcessesXml) ProcessEngineXml(org.camunda.bpm.container.impl.metadata.spi.ProcessEngineXml) ProcessArchiveXml(org.camunda.bpm.application.impl.metadata.spi.ProcessArchiveXml)

Example 8 with ProcessEngineXml

use of org.camunda.bpm.container.impl.metadata.spi.ProcessEngineXml in project camunda-bpm-platform by camunda.

the class ProcessesXmlParserTest method testParseProcessesXmlTwoEngines.

public void testParseProcessesXmlTwoEngines() {
    ProcessesXml processesXml = parser.createParse().sourceUrl(getStreamUrl("process_xml_two_engines.xml")).execute().getProcessesXml();
    assertNotNull(processesXml);
    assertEquals(2, processesXml.getProcessEngines().size());
    assertEquals(0, processesXml.getProcessArchives().size());
    ProcessEngineXml engineXml1 = processesXml.getProcessEngines().get(0);
    assertEquals("engine1", engineXml1.getName());
    assertEquals("configuration", engineXml1.getConfigurationClass());
    assertEquals("datasource", engineXml1.getDatasource());
    Map<String, String> properties1 = engineXml1.getProperties();
    assertNotNull(properties1);
    assertEquals(2, properties1.size());
    assertEquals("value1", properties1.get("prop1"));
    assertEquals("value2", properties1.get("prop2"));
    ProcessEngineXml engineXml2 = processesXml.getProcessEngines().get(1);
    assertEquals("engine2", engineXml2.getName());
    assertEquals("configuration", engineXml2.getConfigurationClass());
    assertEquals("datasource", engineXml2.getDatasource());
    // the second engine has no properties
    Map<String, String> properties2 = engineXml2.getProperties();
    assertNotNull(properties2);
    assertEquals(0, properties2.size());
}
Also used : ProcessesXml(org.camunda.bpm.application.impl.metadata.spi.ProcessesXml) ProcessEngineXml(org.camunda.bpm.container.impl.metadata.spi.ProcessEngineXml)

Example 9 with ProcessEngineXml

use of org.camunda.bpm.container.impl.metadata.spi.ProcessEngineXml in project camunda-bpm-platform by camunda.

the class BpmPlatformXmlParserTest method testParseBpmPlatformXmlOneEngine.

public void testParseBpmPlatformXmlOneEngine() {
    BpmPlatformXml bpmPlatformXml = parser.createParse().sourceUrl(getStreamUrl("bpmplatform_xml_one_engine.xml")).execute().getBpmPlatformXml();
    assertNotNull(bpmPlatformXml);
    assertNotNull(bpmPlatformXml.getJobExecutor());
    assertEquals(1, bpmPlatformXml.getProcessEngines().size());
    JobExecutorXml jobExecutorXml = bpmPlatformXml.getJobExecutor();
    assertEquals(1, jobExecutorXml.getJobAcquisitions().size());
    assertThat(jobExecutorXml.getProperties().size(), is(2));
    JobAcquisitionXml jobAcquisitionXml = jobExecutorXml.getJobAcquisitions().get(0);
    assertEquals("default", jobAcquisitionXml.getName());
    assertEquals("org.camunda.bpm.engine.impl.jobexecutor.DefaultJobExecutor", jobAcquisitionXml.getJobExecutorClassName());
    assertEquals(2, jobAcquisitionXml.getProperties().size());
    ProcessEngineXml engineXml = bpmPlatformXml.getProcessEngines().get(0);
    assertEquals("engine1", engineXml.getName());
    assertEquals("default", engineXml.getJobAcquisitionName());
    Map<String, String> properties = engineXml.getProperties();
    assertNotNull(properties);
    assertEquals(0, properties.size());
    List<ProcessEnginePluginXml> plugins = engineXml.getPlugins();
    assertNotNull(plugins);
    assertEquals(0, plugins.size());
}
Also used : ProcessEnginePluginXml(org.camunda.bpm.container.impl.metadata.spi.ProcessEnginePluginXml) ProcessEngineXml(org.camunda.bpm.container.impl.metadata.spi.ProcessEngineXml) BpmPlatformXml(org.camunda.bpm.container.impl.metadata.spi.BpmPlatformXml) JobExecutorXml(org.camunda.bpm.container.impl.metadata.spi.JobExecutorXml) JobAcquisitionXml(org.camunda.bpm.container.impl.metadata.spi.JobAcquisitionXml)

Example 10 with ProcessEngineXml

use of org.camunda.bpm.container.impl.metadata.spi.ProcessEngineXml in project camunda-bpm-platform by camunda.

the class BpmPlatformXmlParserTest method testParseBpmPlatformXmlMultipleEnginePlugins.

public void testParseBpmPlatformXmlMultipleEnginePlugins() {
    BpmPlatformXml bpmPlatformXml = parser.createParse().sourceUrl(getStreamUrl("bpmplatform_xml_multiple_engine_plugins.xml")).execute().getBpmPlatformXml();
    assertNotNull(bpmPlatformXml);
    assertEquals(1, bpmPlatformXml.getProcessEngines().size());
    ProcessEngineXml engineXml = bpmPlatformXml.getProcessEngines().get(0);
    assertEquals("engine1", engineXml.getName());
    assertEquals("default", engineXml.getJobAcquisitionName());
    List<ProcessEnginePluginXml> plugins = engineXml.getPlugins();
    assertEquals(2, plugins.size());
}
Also used : ProcessEnginePluginXml(org.camunda.bpm.container.impl.metadata.spi.ProcessEnginePluginXml) ProcessEngineXml(org.camunda.bpm.container.impl.metadata.spi.ProcessEngineXml) BpmPlatformXml(org.camunda.bpm.container.impl.metadata.spi.BpmPlatformXml)

Aggregations

ProcessEngineXml (org.camunda.bpm.container.impl.metadata.spi.ProcessEngineXml)12 ProcessesXml (org.camunda.bpm.application.impl.metadata.spi.ProcessesXml)4 BpmPlatformXml (org.camunda.bpm.container.impl.metadata.spi.BpmPlatformXml)4 ProcessEnginePluginXml (org.camunda.bpm.container.impl.metadata.spi.ProcessEnginePluginXml)4 ArrayList (java.util.ArrayList)3 ProcessArchiveXml (org.camunda.bpm.application.impl.metadata.spi.ProcessArchiveXml)2 Element (org.camunda.bpm.engine.impl.util.xml.Element)2 URL (java.net.URL)1 ProcessesXmlWrapper (org.camunda.bpm.container.impl.jboss.util.ProcessesXmlWrapper)1 BpmPlatformXmlImpl (org.camunda.bpm.container.impl.metadata.BpmPlatformXmlImpl)1 JobExecutorXmlImpl (org.camunda.bpm.container.impl.metadata.JobExecutorXmlImpl)1 JobAcquisitionXml (org.camunda.bpm.container.impl.metadata.spi.JobAcquisitionXml)1 JobExecutorXml (org.camunda.bpm.container.impl.metadata.spi.JobExecutorXml)1 DeploymentOperation (org.camunda.bpm.container.impl.spi.DeploymentOperation)1 DeploymentOperationStep (org.camunda.bpm.container.impl.spi.DeploymentOperationStep)1 DeploymentUnit (org.jboss.as.server.deployment.DeploymentUnit)1 Before (org.junit.Before)1