Search in sources :

Example 1 with JobAcquisitionXml

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

the class BpmPlatformXmlParse method parseJobExecutor.

/**
 * parse a <code>&lt;job-executor .../&gt;</code> element and add it to the list of parsed elements
 */
protected void parseJobExecutor(Element element, JobExecutorXmlImpl jobExecutorXml) {
    List<JobAcquisitionXml> jobAcquisitions = new ArrayList<JobAcquisitionXml>();
    Map<String, String> properties = new HashMap<String, String>();
    for (Element childElement : element.elements()) {
        if (JOB_ACQUISITION.equals(childElement.getTagName())) {
            parseJobAcquisition(childElement, jobAcquisitions);
        } else if (PROPERTIES.equals(childElement.getTagName())) {
            parseProperties(childElement, properties);
        }
    }
    jobExecutorXml.setJobAcquisitions(jobAcquisitions);
    jobExecutorXml.setProperties(properties);
}
Also used : HashMap(java.util.HashMap) Element(org.camunda.bpm.engine.impl.util.xml.Element) ArrayList(java.util.ArrayList) JobAcquisitionXml(org.camunda.bpm.container.impl.metadata.spi.JobAcquisitionXml)

Example 2 with JobAcquisitionXml

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

the class BpmPlatformXmlParserTest method testParseBpmPlatformXmlNoEngine.

public void testParseBpmPlatformXmlNoEngine() {
    BpmPlatformXml bpmPlatformXml = parser.createParse().sourceUrl(getStreamUrl("bpmplatform_xml_no_engine.xml")).execute().getBpmPlatformXml();
    assertNotNull(bpmPlatformXml);
    assertNotNull(bpmPlatformXml.getJobExecutor());
    assertEquals(0, bpmPlatformXml.getProcessEngines().size());
    JobExecutorXml jobExecutorXml = bpmPlatformXml.getJobExecutor();
    assertEquals(1, jobExecutorXml.getJobAcquisitions().size());
    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());
}
Also used : 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 3 with JobAcquisitionXml

use of org.camunda.bpm.container.impl.metadata.spi.JobAcquisitionXml 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)

Aggregations

JobAcquisitionXml (org.camunda.bpm.container.impl.metadata.spi.JobAcquisitionXml)3 BpmPlatformXml (org.camunda.bpm.container.impl.metadata.spi.BpmPlatformXml)2 JobExecutorXml (org.camunda.bpm.container.impl.metadata.spi.JobExecutorXml)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 ProcessEnginePluginXml (org.camunda.bpm.container.impl.metadata.spi.ProcessEnginePluginXml)1 ProcessEngineXml (org.camunda.bpm.container.impl.metadata.spi.ProcessEngineXml)1 Element (org.camunda.bpm.engine.impl.util.xml.Element)1