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;
}
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"));
}
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);
}
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);
}
}
}
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><bpm-platform ../></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);
}
Aggregations