Search in sources :

Example 11 with ProcessesXml

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

the class StartProcessApplicationServiceStep method performOperationStep.

public void performOperationStep(DeploymentOperation operationContext) {
    final AbstractProcessApplication processApplication = operationContext.getAttachment(PROCESS_APPLICATION);
    final Map<URL, ProcessesXml> processesXmls = operationContext.getAttachment(PROCESSES_XML_RESOURCES);
    final Map<String, DeployedProcessArchive> processArchiveDeploymentMap = operationContext.getAttachment(PROCESS_ARCHIVE_DEPLOYMENT_MAP);
    final PlatformServiceContainer serviceContainer = operationContext.getServiceContainer();
    ProcessApplicationInfoImpl processApplicationInfo = createProcessApplicationInfo(processApplication, processArchiveDeploymentMap);
    // create service
    JmxManagedProcessApplication mbean = new JmxManagedProcessApplication(processApplicationInfo, processApplication.getReference());
    mbean.setProcessesXmls(new ArrayList<ProcessesXml>(processesXmls.values()));
    mbean.setDeploymentMap(processArchiveDeploymentMap);
    // start service
    serviceContainer.startService(ServiceTypes.PROCESS_APPLICATION, processApplication.getName(), mbean);
    notifyBpmPlatformPlugins(serviceContainer, processApplication);
}
Also used : AbstractProcessApplication(org.camunda.bpm.application.AbstractProcessApplication) DeployedProcessArchive(org.camunda.bpm.container.impl.deployment.util.DeployedProcessArchive) ProcessesXml(org.camunda.bpm.application.impl.metadata.spi.ProcessesXml) PlatformServiceContainer(org.camunda.bpm.container.impl.spi.PlatformServiceContainer) ProcessApplicationInfoImpl(org.camunda.bpm.application.impl.ProcessApplicationInfoImpl) JmxManagedProcessApplication(org.camunda.bpm.container.impl.jmx.services.JmxManagedProcessApplication) URL(java.net.URL)

Example 12 with ProcessesXml

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

the class ProcessesXmlStopProcessEnginesStep method performOperationStep.

public void performOperationStep(DeploymentOperation operationContext) {
    final PlatformServiceContainer serviceContainer = operationContext.getServiceContainer();
    final AbstractProcessApplication processApplication = operationContext.getAttachment(Attachments.PROCESS_APPLICATION);
    final JmxManagedProcessApplication deployedProcessApplication = serviceContainer.getService(ServiceTypes.PROCESS_APPLICATION, processApplication.getName());
    ensureNotNull("Cannot find process application with name " + processApplication.getName(), "deployedProcessApplication", deployedProcessApplication);
    List<ProcessesXml> processesXmls = deployedProcessApplication.getProcessesXmls();
    for (ProcessesXml processesXml : processesXmls) {
        stopProcessEngines(processesXml.getProcessEngines(), operationContext);
    }
}
Also used : AbstractProcessApplication(org.camunda.bpm.application.AbstractProcessApplication) ProcessesXml(org.camunda.bpm.application.impl.metadata.spi.ProcessesXml) PlatformServiceContainer(org.camunda.bpm.container.impl.spi.PlatformServiceContainer) JmxManagedProcessApplication(org.camunda.bpm.container.impl.jmx.services.JmxManagedProcessApplication)

Example 13 with ProcessesXml

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

the class ParseProcessesXmlStep method performOperationStep.

public void performOperationStep(DeploymentOperation operationContext) {
    final AbstractProcessApplication processApplication = operationContext.getAttachment(PROCESS_APPLICATION);
    Map<URL, ProcessesXml> parsedFiles = parseProcessesXmlFiles(processApplication);
    // attach parsed metadata
    operationContext.addAttachment(PROCESSES_XML_RESOURCES, parsedFiles);
}
Also used : AbstractProcessApplication(org.camunda.bpm.application.AbstractProcessApplication) ProcessesXml(org.camunda.bpm.application.impl.metadata.spi.ProcessesXml) URL(java.net.URL)

Example 14 with ProcessesXml

use of org.camunda.bpm.application.impl.metadata.spi.ProcessesXml 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 15 with ProcessesXml

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

the class ProcessesXmlParserTest method testParseProcessesXmlTenantId.

public void testParseProcessesXmlTenantId() {
    ProcessesXml processesXml = parser.createParse().sourceUrl(getStreamUrl("process_xml_tenant_id.xml")).execute().getProcessesXml();
    assertNotNull(processesXml);
    assertEquals(2, processesXml.getProcessArchives().size());
    ProcessArchiveXml archiveXmlWithoutTenantId = processesXml.getProcessArchives().get(0);
    assertNull(archiveXmlWithoutTenantId.getTenantId());
    ProcessArchiveXml archiveXmlWithTenantId = processesXml.getProcessArchives().get(1);
    assertEquals("tenant1", archiveXmlWithTenantId.getTenantId());
}
Also used : ProcessesXml(org.camunda.bpm.application.impl.metadata.spi.ProcessesXml) ProcessArchiveXml(org.camunda.bpm.application.impl.metadata.spi.ProcessArchiveXml)

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