示例#1
0
        public AttributeInstanceImpl FindAttributeInstanceInScope(String attributeName, FlowImpl scope, DbSession dbSession)
        {
            AttributeInstanceImpl attributeInstance = null;

            while (attributeInstance == null)
            {
                IList       attributes = this.FindAttributeInstanceByName(attributeName, scope.Id, dbSession);
                IEnumerator iter       = attributes.GetEnumerator();
                if (iter.MoveNext())
                {
                    attributeInstance = (AttributeInstanceImpl)iter.Current;
                    if (iter.MoveNext())
                    {
                        throw new NetBpm.Util.DB.DbException("duplicate value");
                    }
                }
                else
                {
                    if (!scope.IsRootFlow())
                    {
                        scope = (FlowImpl)scope.Parent;
                    }
                    else
                    {
                        log.Warn("couldn't find attribute-instance '" + attributeName + "' in scope of flow '" + scope + "'");
                        break;
                    }
                }
            }
            return(attributeInstance);
        }
示例#2
0
        private void Resolve(FlowImpl flow, Relations relations, DbSession dbSession)
        {
            // resolve the flow
            if (relations != null)
            {
                log.Debug("resolving relations : '" + relations + "' on flow '" + flow + "'");
                relations.Resolve(flow);
            }

            // resolve the flow-details
            IEnumerator iter = flow.Logs.GetEnumerator();

            while (iter.MoveNext())
            {
                LogImpl     logImpl     = (LogImpl)iter.Current;
                IEnumerator detailsIter = logImpl.Details.GetEnumerator();
                while (detailsIter.MoveNext())
                {
                    LogDetailImpl LogDetailImpl = (LogDetailImpl)detailsIter.Current;
                    LogDetailImpl.Resolve(dbSession);
                }
            }

            // resolve the attribute values
            iter = flow.AttributeInstances.GetEnumerator();
            while (iter.MoveNext())
            {
                AttributeInstanceImpl attributeInstance = (AttributeInstanceImpl)iter.Current;
                log.Debug("resolving attribute instance : " + attributeInstance.GetValue());
            }

            // resolve the child-flows
            iter = flow.Children.GetEnumerator();
            while (iter.MoveNext())
            {
                FlowImpl subFlow = (FlowImpl)iter.Current;
                Resolve(subFlow, relations, dbSession);
            }

            // resolve the sub-process-flows
            IProcessInstance subProcessInstance = flow.GetSubProcessInstance();

            if (subProcessInstance != null)
            {
                Resolve((FlowImpl)subProcessInstance.RootFlow, relations, dbSession);
            }
        }
示例#3
0
 public AttributeUpdateImpl(AttributeInstanceImpl attributeInstance)
 {
     this._attribute = attributeInstance.Attribute;
     this._valueText = attributeInstance.ValueText;
 }