Example #1
0
 public virtual void CheckReadCaseInstance(ICaseExecution caseExecution)
 {
     if (caseExecution != null && !TenantManager.IsAuthenticatedTenant(caseExecution.TenantId))
     {
         throw Log.ExceptionCommandWithUnauthorizedTenant("get the case execution '" + caseExecution.Id + "'");
     }
 }
//JAVA TO C# CONVERTER TODO Resources.Task: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void manuallyStartCaseExecutionDisabledTenantCheck()
        public virtual void manuallyStartCaseExecutionDisabledTenantCheck()
        {
            identityService.SetAuthentication("user", null, null);
            processEngineConfiguration.SetTenantCheckEnabled(false);

            caseService.ManuallyStartCaseExecution(caseExecutionId);

            identityService.ClearAuthentication();

            ICaseExecution caseExecution = CaseExecution;

            Assert.That(caseExecution.Active, Is.EqualTo(true));
        }
//JAVA TO C# CONVERTER TODO Resources.Task: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void manuallyStartCaseExecutionWithAuthenticatedTenant()
        public virtual void manuallyStartCaseExecutionWithAuthenticatedTenant()
        {
            identityService.SetAuthentication("user", null, new List <string>()
            {
                TENANT_ONE
            });

            caseService.ManuallyStartCaseExecution(caseExecutionId);

            identityService.ClearAuthentication();

            ICaseExecution caseExecution = CaseExecution;

            Assert.That(caseExecution.Active, Is.EqualTo(true));
        }
//JAVA TO C# CONVERTER TODO Resources.Task: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void reenableCaseExecutionWithAuthenticatedTenant()
        public virtual void reenableCaseExecutionWithAuthenticatedTenant()
        {
            caseService.DisableCaseExecution(caseExecutionId);

            identityService.SetAuthentication("user", null, new List <string>()
            {
                TENANT_ONE
            });

            caseService.ReenableCaseExecution(caseExecutionId);

            identityService.ClearAuthentication();

            ICaseExecution caseExecution = CaseExecution;

            Assert.That(caseExecution.Enabled, Is.EqualTo(true));
        }
Example #5
0
        [Test]   public virtual void testPropagateTenantIdToVariableInstanceFromHumanTask()
        {
            DeploymentForTenant(TENANT_ID, CMMN_FILE);

            createCaseInstance();

            IVariableMap   variables     = ESS.FW.Bpm.Engine.Variable.Variables.CreateVariables().PutValue("var", "test");
            ICaseExecution caseExecution = caseService.CreateCaseExecutionQuery(c => c.ActivityId == "PI_HumanTask_1").First();

            caseService.SetVariables(caseExecution.Id, variables);

            IVariableInstance variableInstance = runtimeService.CreateVariableInstanceQuery().First();

            //Assert.That(variableInstance, Is.Not.EqualTo(null));
            // inherit the tenant id from human task
            Assert.That(variableInstance.TenantId, Is.EqualTo(TENANT_ID));
        }
Example #6
0
 public virtual void CheckReadCaseInstance(ICaseExecution caseExecution)
 {
 }
Example #7
0
 public virtual void CheckUpdateCaseInstance(ICaseExecution caseExecution)
 {
 }