Search in sources :

Example 16 with ProcessApplicationDeployment

use of org.camunda.bpm.engine.repository.ProcessApplicationDeployment in project camunda-bpm-platform by camunda.

the class ScriptEngineCachingTest method testDisableFetchScriptEngineFromProcessApplication.

public void testDisableFetchScriptEngineFromProcessApplication() {
    // when
    processEngineConfiguration.setEnableFetchScriptEngineFromProcessApplication(false);
    EmbeddedProcessApplication processApplication = new EmbeddedProcessApplication();
    ProcessApplicationDeployment deployment = repositoryService.createDeployment(processApplication.getReference()).addClasspathResource(PROCESS_PATH).deploy();
    // when
    ScriptEngine engine = getScriptEngineFromPa(SCRIPT_LANGUAGE, processApplication);
    // then
    assertNotNull(engine);
    assertEquals(engine, getScriptEngineFromPa(SCRIPT_LANGUAGE, processApplication));
    // not cached in pa
    assertFalse(engine.equals(processApplication.getScriptEngineForName(SCRIPT_LANGUAGE, true)));
    repositoryService.deleteDeployment(deployment.getId(), true);
    processEngineConfiguration.setEnableFetchScriptEngineFromProcessApplication(true);
}
Also used : ProcessApplicationDeployment(org.camunda.bpm.engine.repository.ProcessApplicationDeployment) EmbeddedProcessApplication(org.camunda.bpm.application.impl.EmbeddedProcessApplication) ScriptEngine(javax.script.ScriptEngine)

Example 17 with ProcessApplicationDeployment

use of org.camunda.bpm.engine.repository.ProcessApplicationDeployment in project camunda-bpm-platform by camunda.

the class EnvScriptCachingTest method testEnabledPaEnvScriptCaching.

public void testEnabledPaEnvScriptCaching() {
    // given
    EmbeddedProcessApplication processApplication = new EmbeddedProcessApplication();
    ProcessApplicationDeployment deployment = repositoryService.createDeployment(processApplication.getReference()).addClasspathResource(PROCESS_PATH).deploy();
    // when
    executeScript(processApplication);
    // then
    Map<String, List<ExecutableScript>> environmentScripts = processApplication.getEnvironmentScripts();
    assertNotNull(environmentScripts);
    List<ExecutableScript> groovyEnvScripts = environmentScripts.get(SCRIPT_LANGUAGE);
    assertNotNull(groovyEnvScripts);
    assertFalse(groovyEnvScripts.isEmpty());
    assertEquals(processEngineConfiguration.getEnvScriptResolvers().size(), groovyEnvScripts.size());
    repositoryService.deleteDeployment(deployment.getId(), true);
}
Also used : ProcessApplicationDeployment(org.camunda.bpm.engine.repository.ProcessApplicationDeployment) EmbeddedProcessApplication(org.camunda.bpm.application.impl.EmbeddedProcessApplication) SourceExecutableScript(org.camunda.bpm.engine.impl.scripting.SourceExecutableScript) ExecutableScript(org.camunda.bpm.engine.impl.scripting.ExecutableScript) List(java.util.List)

Example 18 with ProcessApplicationDeployment

use of org.camunda.bpm.engine.repository.ProcessApplicationDeployment in project camunda-bpm-platform by camunda.

the class ScriptEngineCachingTest method testFetchScriptEngineFromPaEnableCaching.

public void testFetchScriptEngineFromPaEnableCaching() {
    // then
    EmbeddedProcessApplication processApplication = new EmbeddedProcessApplication();
    ProcessApplicationDeployment deployment = repositoryService.createDeployment(processApplication.getReference()).addClasspathResource(PROCESS_PATH).deploy();
    // when
    ScriptEngine engine = getScriptEngineFromPa(SCRIPT_LANGUAGE, processApplication);
    // then
    assertNotNull(engine);
    assertEquals(engine, getScriptEngineFromPa(SCRIPT_LANGUAGE, processApplication));
    // cached in pa
    assertEquals(engine, processApplication.getScriptEngineForName(SCRIPT_LANGUAGE, true));
    repositoryService.deleteDeployment(deployment.getId(), true);
}
Also used : ProcessApplicationDeployment(org.camunda.bpm.engine.repository.ProcessApplicationDeployment) EmbeddedProcessApplication(org.camunda.bpm.application.impl.EmbeddedProcessApplication) ScriptEngine(javax.script.ScriptEngine)

Example 19 with ProcessApplicationDeployment

use of org.camunda.bpm.engine.repository.ProcessApplicationDeployment in project camunda-bpm-platform by camunda.

the class ScriptEngineCachingTest method testFetchScriptEngineFromPaDisableCaching.

public void testFetchScriptEngineFromPaDisableCaching() {
    // then
    processEngineConfiguration.setEnableScriptEngineCaching(false);
    getScriptingEngines().setEnableScriptEngineCaching(false);
    EmbeddedProcessApplication processApplication = new EmbeddedProcessApplication();
    ProcessApplicationDeployment deployment = repositoryService.createDeployment(processApplication.getReference()).addClasspathResource(PROCESS_PATH).deploy();
    // when
    ScriptEngine engine = getScriptEngineFromPa(SCRIPT_LANGUAGE, processApplication);
    // then
    assertNotNull(engine);
    assertFalse(engine.equals(getScriptEngineFromPa(SCRIPT_LANGUAGE, processApplication)));
    // not cached in pa
    assertFalse(engine.equals(processApplication.getScriptEngineForName(SCRIPT_LANGUAGE, false)));
    repositoryService.deleteDeployment(deployment.getId(), true);
    processEngineConfiguration.setEnableScriptEngineCaching(true);
    getScriptingEngines().setEnableScriptEngineCaching(true);
}
Also used : ProcessApplicationDeployment(org.camunda.bpm.engine.repository.ProcessApplicationDeployment) EmbeddedProcessApplication(org.camunda.bpm.application.impl.EmbeddedProcessApplication) ScriptEngine(javax.script.ScriptEngine)

Example 20 with ProcessApplicationDeployment

use of org.camunda.bpm.engine.repository.ProcessApplicationDeployment in project camunda-bpm-platform by camunda.

the class ProcessApplicationDeploymentTest method testPartialChangesResumePreviousVersionByDeploymentName.

public void testPartialChangesResumePreviousVersionByDeploymentName() {
    BpmnModelInstance model1 = Bpmn.createExecutableProcess("process1").done();
    BpmnModelInstance model2 = Bpmn.createExecutableProcess("process2").done();
    // create initial deployment
    ProcessApplicationDeployment deployment1 = repositoryService.createDeployment(processApplication.getReference()).name("deployment").addModelInstance("process1.bpmn20.xml", model1).deploy();
    ProcessApplicationDeployment deployment2 = repositoryService.createDeployment(processApplication.getReference()).name("deployment").enableDuplicateFiltering(true).resumePreviousVersions().resumePreviousVersionsBy(ResumePreviousBy.RESUME_BY_DEPLOYMENT_NAME).addModelInstance("process1.bpmn20.xml", model1).addModelInstance("process2.bpmn20.xml", model2).deploy();
    ProcessApplicationRegistration registration = deployment2.getProcessApplicationRegistration();
    assertEquals(2, registration.getDeploymentIds().size());
    deleteDeployments(deployment1, deployment2);
}
Also used : ProcessApplicationRegistration(org.camunda.bpm.application.ProcessApplicationRegistration) ProcessApplicationDeployment(org.camunda.bpm.engine.repository.ProcessApplicationDeployment) BpmnModelInstance(org.camunda.bpm.model.bpmn.BpmnModelInstance)

Aggregations

ProcessApplicationDeployment (org.camunda.bpm.engine.repository.ProcessApplicationDeployment)31 BpmnModelInstance (org.camunda.bpm.model.bpmn.BpmnModelInstance)17 ProcessApplicationRegistration (org.camunda.bpm.application.ProcessApplicationRegistration)15 ProcessDefinition (org.camunda.bpm.engine.repository.ProcessDefinition)9 EmbeddedProcessApplication (org.camunda.bpm.application.impl.EmbeddedProcessApplication)8 DeploymentQuery (org.camunda.bpm.engine.repository.DeploymentQuery)8 ProcessDefinitionQuery (org.camunda.bpm.engine.repository.ProcessDefinitionQuery)8 ScriptEngine (javax.script.ScriptEngine)3 Resource (org.camunda.bpm.engine.repository.Resource)3 List (java.util.List)2 ArrayList (java.util.ArrayList)1 ProcessApplicationDeploymentInfo (org.camunda.bpm.application.ProcessApplicationDeploymentInfo)1 ProcessApplicationInterface (org.camunda.bpm.application.ProcessApplicationInterface)1 ProcessApplicationDeploymentInfoImpl (org.camunda.bpm.application.impl.ProcessApplicationDeploymentInfoImpl)1 ProcessApplicationInfoImpl (org.camunda.bpm.application.impl.ProcessApplicationInfoImpl)1 ProcessEngine (org.camunda.bpm.engine.ProcessEngine)1 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)1 ExecutableScript (org.camunda.bpm.engine.impl.scripting.ExecutableScript)1 SourceExecutableScript (org.camunda.bpm.engine.impl.scripting.SourceExecutableScript)1 ProcessInstance (org.camunda.bpm.engine.runtime.ProcessInstance)1