/// <summary> /// Create a new <seealso cref="AttributeReferenceBuilderImpl"/> from the reference source attribute /// to the reference target model element instance /// </summary> /// <param name="referenceSourceAttribute"> the reference source attribute </param> /// <param name="referenceTargetElement"> the reference target model element instance </param> public AttributeReferenceBuilderImpl(AttributeImpl <string> referenceSourceAttribute, Type referenceTargetElement) { referenceTargetElement = typeof(T); this.referenceSourceAttribute = referenceSourceAttribute; this.referenceTargetElement = referenceTargetElement; this.attributeReferenceImpl = new AttributeReferenceImpl <T>(referenceSourceAttribute); }
public static IAttribute GetTargetFramework(string ver) { var attr = new AttributeImpl("TargetFramework"); attr.Values.Add($".NETFramework,Version=v{ver}"); attr.Properties.Add("FrameworkDisplayName", $".NET Framework {ver}"); return(attr); }
public SingleTokenTokenStream(Token token) : base(Token.TOKEN_ATTRIBUTE_FACTORY) { Debug.Assert(token != null); this.singleToken = token.clone(); tokenAtt = (AttributeImpl)addAttribute(typeof(CharTermAttribute)); assert(tokenAtt is Token); }
public SingleTokenTokenStream(Token token) : base(Token.TOKEN_ATTRIBUTE_FACTORY) { Debug.Assert(token != null); this.singleToken = token.Clone(); tokenAtt = AddAttribute <ICharTermAttribute>(); Debug.Assert(tokenAtt is Token); }
private void InitSerializer() { if (_serializer == null) { AttributeImpl attributeImpl = (AttributeImpl)this._attribute; _serializer = (ISerializer)attributeImpl.SerializerDelegation.GetDelegate(); } }
public SingleTokenTokenStream(Token token) : base(Token.TOKEN_ATTRIBUTE_FACTORY) { Debug.Assert(token != null); this.singleToken = token.clone(); tokenAtt = (AttributeImpl) addAttribute(typeof(CharTermAttribute)); assert(tokenAtt is Token); }
private void attribute(XmlElement attributeElement, AttributeImpl attribute, ProcessBlockImpl processBlock) { attribute.InitialValue = attributeElement.GetProperty("initial-value"); attribute.ProcessDefinition = processBlock as IProcessDefinition; DelegationImpl delegation = new DelegationImpl(); attribute.SerializerDelegation = delegation; delegation.ProcessDefinition = processBlock as IProcessDefinition; this.definitionObject(attributeElement, attribute, processBlock); this.delegation <AttributeImpl>(attributeElement, (DelegationImpl)attribute.SerializerDelegation); }
public AttributeReferenceCollectionBuilderImpl(AttributeImpl attribute, AttributeReferenceCollection <V> attributeReferenceCollection) { _referenceSourceAttribute = attribute; try { _attributeReferenceCollection = (AttributeReferenceCollection <T>)attributeReferenceCollection.GetType() .GetConstructor(new[] { typeof(AttributeImpl) }) .Invoke(new[] { _referenceSourceAttribute }); } catch (Exception e) { throw new Exception(e.Message); } }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @SuppressWarnings({ "unchecked", "rawtypes" }) public AttributeReferenceCollectionBuilderImpl(org.camunda.bpm.model.xml.impl.type.attribute.AttributeImpl<String> attribute, Class<T> referenceTargetElement, Class attributeReferenceCollection) public AttributeReferenceCollectionBuilderImpl(AttributeImpl <string> attribute, Type referenceTargetElement, Type attributeReferenceCollection) { referenceTargetElement = typeof(T); this.referenceSourceAttribute = attribute; this.referenceTargetElement = referenceTargetElement; try { this.attributeReferenceCollection = (AttributeReferenceCollection <T>)attributeReferenceCollection.GetConstructor(typeof(AttributeImpl)).newInstance(referenceSourceAttribute); } catch (Exception e) { throw new Exception(e); } }
public virtual void CreateAttributeInstances(ISet attributes) { this._attributeInstances = new ListSet(); IEnumerator iter = attributes.GetEnumerator(); while (iter.MoveNext()) { AttributeImpl attribute = (AttributeImpl)iter.Current; String attributeName = attribute.Name; log.Debug("creating the attribute " + attribute + " for flow " + this); AttributeInstanceImpl attributeInstance = new AttributeInstanceImpl(attribute, this); attributeInstance.ValueText = attribute.InitialValue; this._attributeInstances.Add(attributeInstance); } }
private void processBlock(XmlElement processBlockElement, ProcessBlockImpl currentProcessBlock) { currentProcessBlock.Nodes = new ListSet(); currentProcessBlock.Attributes = new ListSet(); currentProcessBlock.ChildBlocks = new ListSet(); IEnumerator iterAttr = processBlockElement.GetChildElements("attribute").GetEnumerator(); while (iterAttr.MoveNext()) { AttributeImpl attribute = new AttributeImpl(); this.attribute((XmlElement)iterAttr.Current, attribute, currentProcessBlock); currentProcessBlock.Attributes.Add(attribute); } IEnumerator iterActivityState = processBlockElement.GetChildElements("activity-state").GetEnumerator(); while (iterActivityState.MoveNext()) { ActivityStateImpl activityState = currentProcessBlock.CreateActivityState(); this.activityState((XmlElement)iterActivityState.Current, activityState, currentProcessBlock); currentProcessBlock.Nodes.Add(activityState); } IEnumerator iterConcurrent = processBlockElement.GetChildElements("concurrent-block").GetEnumerator(); while (iterConcurrent.MoveNext()) { ConcurrentBlockImpl concurrentBlock = currentProcessBlock.CreateConcurrentBlock(); this.concurrentBlock((XmlElement)iterConcurrent.Current, concurrentBlock, currentProcessBlock); } IEnumerator iterDecision = processBlockElement.GetChildElements("decision").GetEnumerator(); while (iterDecision.MoveNext()) { DecisionImpl decision = currentProcessBlock.CreateDecision(); this.decision((XmlElement)iterDecision.Current, decision, currentProcessBlock); } this.definitionObject(processBlockElement, currentProcessBlock, currentProcessBlock); }
public virtual void PerformModelBuild(IModel model) { // register declaring type as a referencing type of referenced type var referenceTargetType = (ModelElementTypeImpl)model.GetType(typeof(T)); // the actual referenced type _attributeReferenceCollection.ReferenceTargetElementType = referenceTargetType; // the referenced attribute may be declared on a base type of the referenced type. AttributeImpl idAttribute = (AttributeImpl)referenceTargetType.GetAttribute("id"); if (idAttribute != null) { idAttribute.RegisterIncoming(_attributeReferenceCollection); _attributeReferenceCollection.ReferenceTargetAttribute = idAttribute; } else { throw new ModelException("XmlElement type " + referenceTargetType.TypeNamespace + ":" + referenceTargetType.TypeName + " has no id attribute"); } }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @SuppressWarnings("unchecked") public void performModelBuild(org.camunda.bpm.model.xml.Model model) public virtual void performModelBuild(Model model) { ModelElementTypeImpl referenceTargetType = (ModelElementTypeImpl)model.getType(referenceTargetClass); ModelElementTypeImpl referenceSourceType = (ModelElementTypeImpl)model.getType(childElementType); elementReferenceCollectionImpl.ReferenceTargetElementType = referenceTargetType; elementReferenceCollectionImpl.setReferenceSourceElementType(referenceSourceType); // the referenced attribute may be declared on a base type of the referenced type. AttributeImpl <string> idAttribute = (AttributeImpl <string>)referenceTargetType.getAttribute("id"); if (idAttribute != null) { idAttribute.registerIncoming(elementReferenceCollectionImpl); elementReferenceCollectionImpl.ReferenceTargetAttribute = idAttribute; } else { throw new ModelException("Unable to find id attribute of " + referenceTargetClass); } }
public virtual void PerformModelBuild(IModel model) { ModelElementTypeImpl referenceTargetType = (ModelElementTypeImpl)model.GetType(typeof(TTarget)); ModelElementTypeImpl referenceSourceType = (ModelElementTypeImpl)model.GetType(typeof(TSource)); ElementReferenceCollectionImpl.ReferenceTargetElementType = referenceTargetType; ElementReferenceCollectionImpl.SetReferenceSourceElementType(referenceSourceType); // the referenced attribute may be declared on a base type of the referenced type. AttributeImpl idAttribute = (AttributeImpl)referenceTargetType.GetAttribute("id"); if (idAttribute != null) { idAttribute.RegisterIncoming(ElementReferenceCollectionImpl); ElementReferenceCollectionImpl.ReferenceTargetAttribute = idAttribute; } else { throw new ModelException("Unable to find id attribute of " + typeof(TTarget)); } }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @SuppressWarnings("unchecked") public void performModelBuild(org.camunda.bpm.model.xml.Model model) public virtual void performModelBuild(Model model) { // register declaring type as a referencing type of referenced type ModelElementTypeImpl referenceTargetType = (ModelElementTypeImpl)model.getType(referenceTargetElement); // the actual referenced type attributeReferenceImpl.ReferenceTargetElementType = referenceTargetType; // the referenced attribute may be declared on a base type of the referenced type. AttributeImpl <string> idAttribute = (AttributeImpl <string>)referenceTargetType.getAttribute("id"); if (idAttribute != null) { idAttribute.registerIncoming(attributeReferenceImpl); attributeReferenceImpl.ReferenceTargetAttribute = idAttribute; } else { throw new ModelException("Element type " + referenceTargetType.TypeNamespace + ":" + referenceTargetType.TypeName + " has no id attribute"); } }
//private const String queryFieldsByState = "select f from f in class NetBpm.Workflow.Definition.Impl.FieldImpl " + // "where f.State.Id = ? " + // "order by f.Index"; public IActivityForm GetStartForm(String authenticatedActorId, Int64 processDefinitionId, DbSession dbSession, IOrganisationService organisationComponent) { IActivityForm activityForm = null; // First check if the actor is allowed to get this form authorizationHelper.CheckGetStartForm(authenticatedActorId, processDefinitionId, dbSession); ProcessDefinitionImpl processDefinition = (ProcessDefinitionImpl)dbSession.Load(typeof(ProcessDefinitionImpl), processDefinitionId); StartStateImpl startState = (StartStateImpl)processDefinition.StartState; // create a convenient map from the attribute-names to the fields IList fields = fieldRepository.FindFieldsByState(startState.Id, dbSession); IDictionary attributeValues = new Hashtable(); IEnumerator iter = fields.GetEnumerator(); while (iter.MoveNext()) { FieldImpl field = (FieldImpl)iter.Current; // if the attribute has an initial value AttributeImpl attribute = (AttributeImpl)field.Attribute; String attributeName = attribute.Name; String initialValue = attribute.InitialValue; if ((Object)initialValue != null && (FieldAccessHelper.IsReadable(field.Access) || FieldAccessHelper.IsWritable(field.Access))) { // start form contains only fields that are readable or writable // get it and store it in the attributeValues AttributeInstanceImpl attributeInstance = new AttributeInstanceImpl(); attributeInstance.Attribute = attribute; attributeInstance.ValueText = initialValue; attributeValues[attributeName] = attributeInstance.GetValue(); } } activityForm = new ActivityFormImpl(processDefinition, fields, attributeValues); return(activityForm); }
public override void CopyTo(AttributeImpl target) { target.Clear(); }
public AttributeInstanceImpl(AttributeImpl attribute, FlowImpl scope) { this._valueText = attribute.InitialValue; this._attribute = attribute; this._scope = scope; }
public override void CopyTo(AttributeImpl target) { // this makes no sense for us, because our state is per-docsenum. // we don't want to copy any stuff over to another docsenum ever! }
public QNameAttributeReferenceImpl(AttributeImpl referenceSourceAttribute) : base(referenceSourceAttribute) { }
public QNameAttributeReferenceBuilderImpl(AttributeImpl referenceSourceAttribute) : base(referenceSourceAttribute) { this.AttributeReferenceImpl = new QNameAttributeReferenceImpl <T>(referenceSourceAttribute); }
public AttributeReferenceBuilderImpl(AttributeImpl referenceSourceAttribute) { this._referenceSourceAttribute = referenceSourceAttribute; this.AttributeReferenceImpl = new AttributeReferenceImpl <T>(referenceSourceAttribute); }
/// <summary> /// Create a new <seealso cref="AttributeReferenceBuilderImpl"/> from the reference source attribute /// to the reference target model element instance /// </summary> /// <param name="referenceSourceAttribute"> the reference source attribute </param> /// <param name="referenceTargetElement"> the reference target model element instance </param> public QNameAttributeReferenceBuilderImpl(AttributeImpl <string> referenceSourceAttribute, Type referenceTargetElement) { referenceTargetElement = typeof(T); base(referenceSourceAttribute, referenceTargetElement); this.attributeReferenceImpl = new QNameAttributeReferenceImpl <T>(referenceSourceAttribute); }
public AttributeReferenceImpl(AttributeImpl referenceSourceAttribute) { this.referenceSourceAttribute = referenceSourceAttribute; }
public AttributeReferenceCollection(AttributeImpl <string> referenceSourceAttribute) : base(referenceSourceAttribute) { }
/// <summary> /// Set the reference target attribute /// </summary> /// <param name="referenceTargetAttribute"> the reference target string attribute </param> public virtual void setReferenceTargetAttribute(AttributeImpl <string> referenceTargetAttribute) { this.referenceTargetAttribute = referenceTargetAttribute; }