Beispiel #1
0
        public static string getApplicationPathForDeployment(ProcessEngine engine, string deploymentId)
        {
            // get the name of the process application that made the deployment
            string          processApplicationName = null;
            IdentityService identityService        = engine.IdentityService;
            Authentication  currentAuthentication  = identityService.CurrentAuthentication;

            try
            {
                identityService.clearAuthentication();
                processApplicationName = engine.ManagementService.getProcessApplicationForDeployment(deploymentId);
            }
            finally
            {
                identityService.Authentication = currentAuthentication;
            }

            if (string.ReferenceEquals(processApplicationName, null))
            {
                // no a process application deployment
                return(null);
            }
            else
            {
                ProcessApplicationService processApplicationService = BpmPlatform.ProcessApplicationService;
                ProcessApplicationInfo    processApplicationInfo    = processApplicationService.getProcessApplicationInfo(processApplicationName);
                return(processApplicationInfo.Properties[org.camunda.bpm.application.ProcessApplicationInfo_Fields.PROP_SERVLET_CONTEXT_PATH]);
            }
        }
Beispiel #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test @OperateOnDeployment(value=PA2) public void testDeployProcessArchive()
        public virtual void testDeployProcessArchive()
        {
            Assert.assertNotNull(processEngine);
            RepositoryService repositoryService = processEngine.RepositoryService;
            long count = repositoryService.createProcessDefinitionQuery().processDefinitionKey("testDeployProcessArchive").count();

            Assert.assertEquals(1, count);

            // validate registrations:
            ProcessApplicationService processApplicationService = BpmPlatform.ProcessApplicationService;
            ISet <string>             processApplicationNames   = processApplicationService.ProcessApplicationNames;
            bool resumedRegistrationFound = false;

            foreach (string paName in processApplicationNames)
            {
                ProcessApplicationInfo processApplicationInfo           = processApplicationService.getProcessApplicationInfo(paName);
                IList <ProcessApplicationDeploymentInfo> deploymentInfo = processApplicationInfo.DeploymentInfo;
                if (deploymentInfo.Count == 2)
                {
                    if (resumedRegistrationFound)
                    {
                        Assert.fail("Cannot have two registrations");
                    }
                    resumedRegistrationFound = true;
                }
            }
            Assert.assertTrue("Previous version of the deployment was not resumed", resumedRegistrationFound);
        }
Beispiel #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test @OperateOnDeployment(value=PA2) public void testDeployProcessArchive()
        public virtual void testDeployProcessArchive()
        {
            assertThat(processEngine, @is(notNullValue()));
            RepositoryService repositoryService = processEngine.RepositoryService;
            long count = repositoryService.createProcessDefinitionQuery().processDefinitionKey("testDeployProcessArchive").count();

            assertThat(count, @is(2L));

            // validate registrations:
            ProcessApplicationService processApplicationService = BpmPlatform.ProcessApplicationService;
            ISet <string>             processApplicationNames   = processApplicationService.ProcessApplicationNames;
            // we have two PAs, one from the first deployment and one from the second and only one (the second) is allowed to have two deployments
            bool resumedRegistrationFound = false;

            foreach (string paName in processApplicationNames)
            {
                ProcessApplicationInfo processApplicationInfo           = processApplicationService.getProcessApplicationInfo(paName);
                IList <ProcessApplicationDeploymentInfo> deploymentInfo = processApplicationInfo.DeploymentInfo;
                if (deploymentInfo.Count == 2)
                {
                    if (resumedRegistrationFound)
                    {
                        fail("Cannot have two registrations");
                    }
                    resumedRegistrationFound = true;
                }
            }
            assertThat("Previous version of the deployment was not resumed", resumedRegistrationFound, @is(true));
        }
Beispiel #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @PostConstruct protected void start()
        protected internal virtual void start()
        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.camunda.bpm.container.impl.RuntimeContainerDelegateImpl containerDelegate = getContainerDelegate();
            RuntimeContainerDelegateImpl containerDelegate = ContainerDelegate;

            containerDelegate.ServiceContainer.createDeploymentOperation("deploying camunda BPM platform").addStep(new EjbJarParsePlatformXmlStep()).addStep(new DiscoverBpmPlatformPluginsStep()).addStep(new StartJcaExecutorServiceStep(executorServiceBean)).addStep(new StartJobExecutorStep()).addStep(new PlatformXmlStartProcessEnginesStep()).execute();

            processEngineService      = containerDelegate.ProcessEngineService;
            processApplicationService = containerDelegate.ProcessApplicationService;

            LOGGER.log(Level.INFO, "camunda BPM platform started successfully.");
        }
Beispiel #5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test @OperateOnDeployment("test1") public void testProcessApplicationsDeployed()
        public virtual void testProcessApplicationsDeployed()
        {
            ProcessApplicationService processApplicationService = BpmPlatform.ProcessApplicationService;

            ISet <string> processApplicationNames = processApplicationService.ProcessApplicationNames;

            // check if the new applications are deployed with allowed names
//JAVA TO C# CONVERTER TODO TASK: There is no .NET equivalent to the java.util.Collection 'retainAll' method:
            processApplicationNames.retainAll(Arrays.asList(new string [] { "test1", "test2", "/test1", "/test2" }));

            Assert.assertEquals(2, processApplicationNames.Count);

            foreach (string appName in processApplicationNames)
            {
                ProcessApplicationInfo processApplicationInfo = processApplicationService.getProcessApplicationInfo(appName);

                Assert.assertNotNull(processApplicationInfo);
                Assert.assertNotNull(processApplicationInfo.Name);
                Assert.assertEquals(1, processApplicationInfo.DeploymentInfo.Count);
            }
        }
Beispiel #6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @PostConstruct protected void initProcessEngineServiceDelegate()
        protected internal virtual void initProcessEngineServiceDelegate()
        {
            processApplicationServiceDelegate = ejbBpmPlatform.ProcessApplicationService;
        }
Beispiel #7
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void test()
        public virtual void test()
        {
            ProcessApplicationService processApplicationService = BpmPlatform.ProcessApplicationService;

            Assert.assertNotNull(processApplicationService.getProcessApplicationInfo("pa"));
        }