Search in sources :

Example 1 with ProcessEngineXml

use of org.camunda.bpm.container.impl.metadata.spi.ProcessEngineXml 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 2 with ProcessEngineXml

use of org.camunda.bpm.container.impl.metadata.spi.ProcessEngineXml 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 3 with ProcessEngineXml

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

the class StartManagedThreadPoolStepTest method setUp.

@Before
public void setUp() {
    step = new StartManagedThreadPoolStep();
    deploymentOperation = new DeploymentOperation("name", container, Collections.<DeploymentOperationStep>emptyList());
    jobExecutorXml = new JobExecutorXmlImpl();
    bpmPlatformXml = new BpmPlatformXmlImpl(jobExecutorXml, Collections.<ProcessEngineXml>emptyList());
    deploymentOperation.addAttachment(Attachments.BPM_PLATFORM_XML, bpmPlatformXml);
}
Also used : ProcessEngineXml(org.camunda.bpm.container.impl.metadata.spi.ProcessEngineXml) JobExecutorXmlImpl(org.camunda.bpm.container.impl.metadata.JobExecutorXmlImpl) DeploymentOperationStep(org.camunda.bpm.container.impl.spi.DeploymentOperationStep) DeploymentOperation(org.camunda.bpm.container.impl.spi.DeploymentOperation) BpmPlatformXmlImpl(org.camunda.bpm.container.impl.metadata.BpmPlatformXmlImpl) Before(org.junit.Before)

Example 4 with ProcessEngineXml

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

the class ProcessEngineStartProcessor method deploy.

public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
    final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
    if (!ProcessApplicationAttachments.isProcessApplication(deploymentUnit)) {
        return;
    }
    List<ProcessesXmlWrapper> processesXmls = ProcessApplicationAttachments.getProcessesXmls(deploymentUnit);
    for (ProcessesXmlWrapper wrapper : processesXmls) {
        for (ProcessEngineXml processEngineXml : wrapper.getProcessesXml().getProcessEngines()) {
            startProcessEngine(processEngineXml, phaseContext);
        }
    }
}
Also used : ProcessesXmlWrapper(org.camunda.bpm.container.impl.jboss.util.ProcessesXmlWrapper) ProcessEngineXml(org.camunda.bpm.container.impl.metadata.spi.ProcessEngineXml) DeploymentUnit(org.jboss.as.server.deployment.DeploymentUnit)

Example 5 with ProcessEngineXml

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

the class BpmPlatformXmlParse method parseRootElement.

/**
 * We know this is a <code>&lt;bpm-platform ../&gt;</code> element
 */
protected void parseRootElement() {
    JobExecutorXmlImpl jobExecutor = new JobExecutorXmlImpl();
    List<ProcessEngineXml> processEngines = new ArrayList<ProcessEngineXml>();
    for (Element element : rootElement.elements()) {
        if (JOB_EXECUTOR.equals(element.getTagName())) {
            parseJobExecutor(element, jobExecutor);
        } else if (PROCESS_ENGINE.equals(element.getTagName())) {
            parseProcessEngine(element, processEngines);
        }
    }
    bpmPlatformXml = new BpmPlatformXmlImpl(jobExecutor, processEngines);
}
Also used : ProcessEngineXml(org.camunda.bpm.container.impl.metadata.spi.ProcessEngineXml) Element(org.camunda.bpm.engine.impl.util.xml.Element) ArrayList(java.util.ArrayList)

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