Exemplo n.º 1
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);
            }
        }
Exemplo n.º 2
0
 public ProcessDefinitionBuildContext(ProcessDefinitionImpl processDefinition, IDictionary <string, byte[]> entries, DbSession dbSession)
 {
     InitBlock();
     this._processDefinition = processDefinition;
     this._processBlock      = processDefinition;
     this._dbSession         = dbSession;
     this._entries           = entries;
 }
Exemplo n.º 3
0
		public UnresolvedReference(Object referencingObject, String destinationName, ProcessBlockImpl destinationScope, String property, Type destinationType)
		{
			this._referencingObject = referencingObject;
			this._destinationName = destinationName;
			this._destinationScope = destinationScope;
			this._property = property;
			this._destinationType = destinationType;
		}
Exemplo n.º 4
0
 public UnresolvedReference(Object referencingObject, String destinationName, ProcessBlockImpl destinationScope, String property, Type destinationType)
 {
     this._referencingObject = referencingObject;
     this._destinationName   = destinationName;
     this._destinationScope  = destinationScope;
     this._property          = property;
     this._destinationType   = destinationType;
 }
Exemplo n.º 5
0
        public void AddReferencableObject(String name, ProcessBlockImpl scope, Type type, Object referencableObject)
        {
            ReferencableObject referenceType = new ReferencableObject(scope, type);
            IDictionary        referencables = (IDictionary)_referencableObjects[referenceType];

            if (referencables == null)
            {
                referencables = new Hashtable();
                _referencableObjects[referenceType] = referencables;
            }
            referencables[name] = referencableObject;
        }
Exemplo n.º 6
0
 public FlowImpl(String name, FlowImpl parent, ProcessBlockImpl processBlock)
 {
     this._name = name;
     this._start = DateTime.Now;
     this._processInstance = parent.ProcessInstance;
     this._subProcessInstances = null;
     this._parent = parent;
     this._children = null;
     this._logs = new ListSet();
     this._parentReactivation = true;
     CreateAttributeInstances(processBlock.Attributes);
 }
Exemplo n.º 7
0
        private Object FindInScope(UnresolvedReference unresolvedReference, ProcessBlockImpl scope)
        {
            Object referencedObject = null;

            if (scope != null)
            {
                ReferencableObject referenceType = new ReferencableObject(scope, unresolvedReference.DestinationType);

                IDictionary referencables = (IDictionary)_referencableObjects[referenceType];

                if ((referencables != null) && (referencables.Contains(unresolvedReference.DestinationName)))
                {
                    referencedObject = referencables[unresolvedReference.DestinationName];
                }
                else
                {
                    referencedObject = FindInScope(unresolvedReference, scope.ParentBlock);
                }
            }

            return(referencedObject);
        }
Exemplo n.º 8
0
        public void ResolveReferences()
        {
            IEnumerator iter = _unresolvedReferences.GetEnumerator();

            while (iter.MoveNext())
            {
                UnresolvedReference unresolvedReference = (UnresolvedReference)iter.Current;

                Object           referencingObject        = unresolvedReference.ReferencingObject;
                String           referenceDestinationName = unresolvedReference.DestinationName;
                ProcessBlockImpl scope    = unresolvedReference.DestinationScope;
                String           property = unresolvedReference.Property;

                Object referencedObject = FindInScope(unresolvedReference, unresolvedReference.DestinationScope);
                if (referencedObject == null)
                {
                    AddError("failed to deploy process archive : couldn't resolve " + property + "=\"" + referenceDestinationName + "\" from " + referencingObject + " in scope " + scope);
                }
                else
                {
                    if (referencingObject is TransitionImpl)
                    {
                        if (property.Equals("to"))
                        {
                            TransitionImpl transition = (TransitionImpl)referencingObject;
                            transition.To = (NodeImpl)referencedObject;
                        }
                    }
                    if (referencingObject is FieldImpl)
                    {
                        if (property.Equals("attribute"))
                        {
                            FieldImpl field = (FieldImpl)referencingObject;
                            field.Attribute = (AttributeImpl)referencedObject;
                        }
                    }
                }
            }
        }
Exemplo n.º 9
0
 public void AddUnresolvedReference(Object referencingObject, String destinationName, ProcessBlockImpl destinationScope, String property, Type destinationType)
 {
     _unresolvedReferences.Add(new UnresolvedReference(referencingObject, destinationName, destinationScope, property, destinationType));
 }
Exemplo n.º 10
0
		public ProcessDefinitionBuildContext(ProcessDefinitionImpl processDefinition, IDictionary<string,byte[]> entries, DbSession dbSession)
		{
			InitBlock();
			this._processDefinition = processDefinition;
			this._processBlock = processDefinition;
			this._dbSession = dbSession;
			this._entries = entries;
		}
Exemplo n.º 11
0
		private Object FindInScope(UnresolvedReference unresolvedReference, ProcessBlockImpl scope)
		{
			Object referencedObject = null;

			if (scope != null)
			{
				ReferencableObject referenceType = new ReferencableObject(scope, unresolvedReference.DestinationType);

				IDictionary referencables = (IDictionary) _referencableObjects[referenceType];

				if ((referencables != null) && (referencables.Contains(unresolvedReference.DestinationName)))
				{
					referencedObject = referencables[unresolvedReference.DestinationName];
				}
				else
				{
					referencedObject = FindInScope(unresolvedReference, scope.ParentBlock);
				}
			}

			return referencedObject;
		}
Exemplo n.º 12
0
		public void AddReferencableObject(String name, ProcessBlockImpl scope, Type type, Object referencableObject)
		{
			ReferencableObject referenceType = new ReferencableObject(scope, type);
			IDictionary referencables = (IDictionary) _referencableObjects[referenceType];
			if (referencables == null)
			{
				referencables = new Hashtable();
				_referencableObjects[referenceType] = referencables;
			}
			referencables[name] = referencableObject;
		}
Exemplo n.º 13
0
		public void AddUnresolvedReference(Object referencingObject, String destinationName, ProcessBlockImpl destinationScope, String property, Type destinationType)
		{
			_unresolvedReferences.Add(new UnresolvedReference(referencingObject, destinationName, destinationScope, property, destinationType));
		}
Exemplo n.º 14
0
 public ReferencableObject(ProcessBlockImpl scope, Type type)
 {
     _type  = type;
     _scope = scope;
 }
Exemplo n.º 15
0
 public ReferencableObject(ProcessBlockImpl scope, Type type)
 {
     _type = type;
     _scope = scope;
 }
Exemplo n.º 16
0
		public CreationContext(ProcessDefinitionImpl processDefinition, IDictionary entries, DbSession dbSession)
		{
			InitBlock();
			this._processDefinition = processDefinition;
			this._processBlock = processDefinition;
			this._dbSession = dbSession;
			this._entries = entries;
		}