public virtual AttributeImpl CreateAttribute()
		{
			AttributeImpl attribute = new AttributeImpl(_processDefinition);
			attribute.Scope = this;
			_attributes.Add(attribute);
			return attribute;
		}
Beispiel #2
0
        public override void Validate(ValidationContext validationContext)
        {
            base.Validate(validationContext);

            // validate the attributes
            IEnumerator iter = _attributes.GetEnumerator();

            while (iter.MoveNext())
            {
                AttributeImpl attribute = (AttributeImpl)iter.Current;
                attribute.Validate(validationContext);
            }

            // validate the nodes
            iter = _nodes.GetEnumerator();
            while (iter.MoveNext())
            {
                NodeImpl node = (NodeImpl)iter.Current;
                node.Validate(validationContext);
            }

            // validate the childBlocks
            iter = _childBlocks.GetEnumerator();
            while (iter.MoveNext())
            {
                ProcessBlockImpl processBlock = (ProcessBlockImpl)iter.Current;
                processBlock.Validate(validationContext);
            }
        }
Beispiel #3
0
        public virtual void ReadWebData(XmlElement xmlElement, ProcessDefinitionBuildContext creationContext)
        {
            XmlElement coordinatesXmlElement = xmlElement.GetChildElement("image-coordinates");

            if (coordinatesXmlElement != null)
            {
                try
                {
                    _x1 = Int32.Parse(coordinatesXmlElement.GetProperty("x1"));
                    _y1 = Int32.Parse(coordinatesXmlElement.GetProperty("y1"));
                    _x2 = Int32.Parse(coordinatesXmlElement.GetProperty("x2"));
                    _y2 = Int32.Parse(coordinatesXmlElement.GetProperty("y2"));

                    creationContext.Check((((Object)_x1 != null) && ((Object)_y1 != null) && ((Object)_x2 != null) && ((Object)_y2 != null)), "at least one of the image-coordinates (x1,y1,x2,y2) is missing : " + xmlElement);
                }
                catch (FormatException e)
                {
                    creationContext.AddError("at least one of the image-coordinates is not parsable : " + xmlElement + " exception:" + e.Message);
                }
            }

            DbSession dbSession = creationContext.DbSession;

            creationContext.State = this;
            creationContext.Index = 0;
            IEnumerator iter = xmlElement.GetChildElements("field").GetEnumerator();

            while (iter.MoveNext())
            {
                XmlElement fieldElement  = (XmlElement)iter.Current;
                String     attributeName = fieldElement.GetProperty("attribute");

                FieldImpl field = null;

                Object[] values = new Object[] { _id, attributeName };
                IType[]  types  = new IType[] { DbType.LONG, DbType.STRING };

                IList fields = dbSession.Find(queryFindFieldByActivityStateAndAttributeName, values, types);
                if (fields.Count == 1)
                {
                    field = (FieldImpl)fields[0];
                }
                else
                {
                    values = new Object[] { _processBlock.Id, attributeName };
                    types  = new IType[] { DbType.LONG, DbType.STRING };
                    AttributeImpl attribute = (AttributeImpl)dbSession.FindOne(queryFindAttibuteByName, values, types);

                    field           = new FieldImpl();
                    field.Access    = FieldAccess.READ_WRITE;
                    field.State     = this;
                    field.Attribute = attribute;
                    this._fields.Add(field);
                }

                field.ReadWebData(fieldElement, creationContext);
                creationContext.IncrementIndex();
            }
        }
Beispiel #4
0
        public virtual AttributeImpl CreateAttribute()
        {
            AttributeImpl attribute = new AttributeImpl(_processDefinition);

            attribute.Scope = this;
            _attributes.Add(attribute);
            return(attribute);
        }
Beispiel #5
0
        public override void ReadProcessData(XmlElement xmlElement, ProcessDefinitionBuildContext creationContext)
        {
            this._nodes       = new ListSet();
            this._attributes  = new ListSet();
            this._childBlocks = new ListSet();

            base.ReadProcessData(xmlElement, creationContext);

            IEnumerator iter = xmlElement.GetChildElements("attribute").GetEnumerator();

            while (iter.MoveNext())
            {
                AttributeImpl attribute = new AttributeImpl();
                attribute.ReadProcessData((XmlElement)iter.Current, creationContext);
                _attributes.Add(attribute);
            }

            iter = xmlElement.GetChildElements("activity-state").GetEnumerator();
            while (iter.MoveNext())
            {
                ActivityStateImpl activityState = new ActivityStateImpl();
                activityState.ReadProcessData((XmlElement)iter.Current, creationContext);
                _nodes.Add(activityState);
            }

            iter = xmlElement.GetChildElements("process-state").GetEnumerator();
            while (iter.MoveNext())
            {
                ProcessStateImpl processState = new ProcessStateImpl();
                processState.ReadProcessData((XmlElement)iter.Current, creationContext);
                _nodes.Add(processState);
            }

            iter = xmlElement.GetChildElements("decision").GetEnumerator();
            while (iter.MoveNext())
            {
                DecisionImpl decision = new DecisionImpl();
                decision.ReadProcessData((XmlElement)iter.Current, creationContext);
                _nodes.Add(decision);
            }

            iter = xmlElement.GetChildElements("concurrent-block").GetEnumerator();
            while (iter.MoveNext())
            {
                ConcurrentBlockImpl concurrentBlock = new ConcurrentBlockImpl();
                concurrentBlock.ReadProcessData((XmlElement)iter.Current, creationContext);
                _childBlocks.Add(concurrentBlock);
            }
        }
		public AttributeInstanceImpl(AttributeImpl attribute, FlowImpl scope)
		{
			this._valueText = attribute.InitialValue;
			this._attribute = attribute;
			this._scope = scope;
		}
		public override void ReadProcessData(XmlElement xmlElement, ProcessDefinitionBuildContext creationContext)
		{
			this._nodes = new ListSet();
			this._attributes = new ListSet();
			this._childBlocks = new ListSet();

			base.ReadProcessData(xmlElement, creationContext);

			IEnumerator iter = xmlElement.GetChildElements("attribute").GetEnumerator();
			while (iter.MoveNext())
			{
				AttributeImpl attribute = new AttributeImpl();
				attribute.ReadProcessData((XmlElement) iter.Current, creationContext);
				_attributes.Add(attribute);
			}

			iter = xmlElement.GetChildElements("activity-state").GetEnumerator();
			while (iter.MoveNext())
			{
				ActivityStateImpl activityState = new ActivityStateImpl();
				activityState.ReadProcessData((XmlElement) iter.Current, creationContext);
				_nodes.Add(activityState);
			}

			iter = xmlElement.GetChildElements("process-state").GetEnumerator();
			while (iter.MoveNext())
			{
				ProcessStateImpl processState = new ProcessStateImpl();
				processState.ReadProcessData((XmlElement) iter.Current, creationContext);
				_nodes.Add(processState);
			}

			iter = xmlElement.GetChildElements("decision").GetEnumerator();
			while (iter.MoveNext())
			{
				DecisionImpl decision = new DecisionImpl();
				decision.ReadProcessData((XmlElement) iter.Current, creationContext);
				_nodes.Add(decision);
			}

			iter = xmlElement.GetChildElements("concurrent-block").GetEnumerator();
			while (iter.MoveNext())
			{
				ConcurrentBlockImpl concurrentBlock = new ConcurrentBlockImpl();
				concurrentBlock.ReadProcessData((XmlElement) iter.Current, creationContext);
				_childBlocks.Add(concurrentBlock);
			}
		}