コード例 #1
0
        protected internal virtual bool isBlocking(CmmnActivityExecution execution)
        {
            CmmnActivity activity           = execution.Activity;
            object       isBlockingProperty = activity.getProperty(PROPERTY_IS_BLOCKING);

            if (isBlockingProperty != null && isBlockingProperty is bool?)
            {
                return((bool?)isBlockingProperty.Value);
            }
            return(false);
        }
コード例 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testIsBlockingEqualsTrueProperty()
        public virtual void testIsBlockingEqualsTrueProperty()
        {
            // given: a task with isBlocking = true (defaultValue)

            // when
            CmmnActivity activity = handler.handleElement(planItem, context);

            // then
            bool?isBlocking = (bool?)activity.getProperty(PROPERTY_IS_BLOCKING);

            assertTrue(isBlocking);
        }
コード例 #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testTaskActivityType()
        public virtual void testTaskActivityType()
        {
            // given

            // when
            CmmnActivity activity = handler.handleElement(planItem, context);

            // then
            string activityType = (string)activity.getProperty(PROPERTY_ACTIVITY_TYPE);

            assertEquals("task", activityType);
        }
コード例 #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testCasePlanModelActivityType()
        public virtual void testCasePlanModelActivityType()
        {
            // given

            // when
            CmmnActivity activity = handler.handleElement(casePlanModel, context);

            // then
            string activityType = (string)activity.getProperty(PROPERTY_ACTIVITY_TYPE);

            assertEquals("casePlanModel", activityType);
        }
コード例 #5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testMilestoneActivityType()
        public virtual void testMilestoneActivityType()
        {
            // given

            // when
            CmmnActivity activity = handler.handleElement(discretionaryItem, context);

            // then
            string activityType = (string)activity.getProperty(PROPERTY_ACTIVITY_TYPE);

            assertEquals("milestone", activityType);
        }
コード例 #6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testPlanItemDescription()
        public virtual void testPlanItemDescription()
        {
            // given
            string description = "This is a planItem";

            planItem.Description = description;

            // when
            CmmnActivity activity = handler.handleElement(planItem, context);

            // then
            assertEquals(description, activity.getProperty(PROPERTY_ACTIVITY_DESCRIPTION));
        }
コード例 #7
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testCasePlanModelDescription()
        public virtual void testCasePlanModelDescription()
        {
            // given
            string description = "This is a casePlanModal";

            casePlanModel.Description = description;

            // when
            CmmnActivity activity = handler.handleElement(casePlanModel, context);

            // then
            assertEquals(description, activity.getProperty(PROPERTY_ACTIVITY_DESCRIPTION));
        }
コード例 #8
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testIsDiscretionaryProperty()
        public virtual void testIsDiscretionaryProperty()
        {
            // given:
            // a discretionary item to handle

            // when
            CmmnActivity activity = handler.handleElement(discretionaryItem, context);

            // then
            bool?discretionary = (bool?)activity.getProperty(PROPERTY_DISCRETIONARY);

            assertTrue(discretionary);
        }
コード例 #9
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testMilestoneDescription()
        public virtual void testMilestoneDescription()
        {
            // given
            string description = "This is a milestone";

            milestone.Description = description;

            // when
            CmmnActivity activity = handler.handleElement(discretionaryItem, context);

            // then
            assertEquals(description, activity.getProperty(PROPERTY_ACTIVITY_DESCRIPTION));
        }
コード例 #10
0
        // manual activation rule //////////////////////////////////////////////

        protected internal virtual bool evaluateManualActivationRule(CmmnActivityExecution execution)
        {
            bool         manualActivation     = false;
            CmmnActivity activity             = execution.Activity;
            object       manualActivationRule = activity.getProperty(PROPERTY_MANUAL_ACTIVATION_RULE);

            if (manualActivationRule != null)
            {
                CaseControlRule rule = (CaseControlRule)manualActivationRule;
                manualActivation = rule.evaluate(execution);
            }
            return(manualActivation);
        }
コード例 #11
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testIsBlockingEqualsFalseProperty()
        public virtual void testIsBlockingEqualsFalseProperty()
        {
            // given:
            // a task with isBlocking = false
            task.IsBlocking = false;

            // when
            CmmnActivity activity = handler.handleElement(planItem, context);

            // then
            bool?isBlocking = (bool?)activity.getProperty(PROPERTY_IS_BLOCKING);

            assertFalse(isBlocking);
        }
コード例 #12
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testAutoComplete()
        public virtual void testAutoComplete()
        {
            // given
            casePlanModel.AutoComplete = true;

            // when
            CmmnActivity newActivity = handler.handleElement(casePlanModel, context);

            // then
            object autoComplete = newActivity.getProperty(PROPERTY_AUTO_COMPLETE);

            assertNotNull(autoComplete);
            assertTrue((bool?)autoComplete);
        }
コード例 #13
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testRequiredRuleByDefaultPlanItemControl()
        public virtual void testRequiredRuleByDefaultPlanItemControl()
        {
            // given
            PlanItemControl     defaultControl = createElement(task, "ItemControl_1", typeof(DefaultControl));
            RequiredRule        requiredRule   = createElement(defaultControl, "RequiredRule_1", typeof(RequiredRule));
            ConditionExpression expression     = createElement(requiredRule, "Expression_1", typeof(ConditionExpression));

            expression.Text = "${true}";

            Cmmn.validateModel(modelInstance);

            // when
            CmmnActivity newActivity = handler.handleElement(planItem, context);

            // then
            object rule = newActivity.getProperty(PROPERTY_REQUIRED_RULE);

            assertNotNull(rule);
            assertTrue(rule is CaseControlRule);
        }
コード例 #14
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testManualActivationRule()
        public virtual void testManualActivationRule()
        {
            // given
            ItemControl          itemControl          = createElement(planItem, "ItemControl_1", typeof(ItemControl));
            ManualActivationRule manualActivationRule = createElement(itemControl, "ManualActivationRule_1", typeof(ManualActivationRule));
            ConditionExpression  expression           = createElement(manualActivationRule, "Expression_1", typeof(ConditionExpression));

            expression.Text = "${true}";

            Cmmn.validateModel(modelInstance);

            // when
            CmmnActivity newActivity = handler.handleElement(planItem, context);

            // then
            object rule = newActivity.getProperty(PROPERTY_MANUAL_ACTIVATION_RULE);

            assertNotNull(rule);
            assertTrue(rule is CaseControlRule);
        }