public override void ReadProcessData(XmlElement xmlElement, CreationContext creationContext) { base.ReadProcessData(xmlElement, creationContext); // get the process definition for that name String subProcessDefinitionName = xmlElement.GetProperty("process"); creationContext.Check(((Object) subProcessDefinitionName != null), "process is missing in the process state : " + subProcessDefinitionName); DbSession dbSession = creationContext.DbSession; dbSession.SaveOrUpdate(this._processDefinition); try { this._subProcess = (ProcessDefinitionImpl) dbSession.FindOne(queryFindProcessDefinitionByName, subProcessDefinitionName, DbType.STRING); } catch (SystemException e) { creationContext.AddError("process '" + subProcessDefinitionName + "' was not deployed while it is referenced in a process-state. Exception: " + e.Message); } // parse the processInvokerDelegation creationContext.DelegatingObject = this; this._processInvokerDelegation = new DelegationImpl(); XmlElement invocationElement = xmlElement.GetChildElement("process-invocation"); creationContext.Check((invocationElement != null), "process-invocation is missing in the process-state : " + xmlElement); this._processInvokerDelegation.ReadProcessData(invocationElement, creationContext); creationContext.DelegatingObject = null; // parse the actorExpression this._actorExpression = xmlElement.GetProperty("actor-expression"); creationContext.Check(((Object) _actorExpression != null), "actor-expression is missing in the process-state : " + xmlElement); }
public void ReadProcessData(XmlElement xmlElement, CreationContext creationContext) { String attributeName = xmlElement.GetProperty("attribute"); creationContext.Check(((Object) attributeName != null), "attribute is a required property in element field : " + xmlElement); log.Debug("parsing field for attribute '" + attributeName); creationContext.AddUnresolvedReference(this, attributeName, creationContext.ProcessBlock, "attribute", typeof (IAttribute)); this._state = creationContext.State; String accessText = xmlElement.GetProperty("access"); creationContext.Check(((Object) accessText != null), "access is a required property in element field : " + xmlElement); this._access = FieldAccessHelper.fromText(accessText); }
public virtual void ReadProcessData(XmlElement xmlElement, CreationContext creationContext) { this._name = xmlElement.GetProperty("name"); log.Debug("parsing '" + xmlElement.Name + "' with name '" + _name + "'"); this._description = xmlElement.GetProperty("description"); this._processDefinition = creationContext.ProcessDefinition; IEnumerator iter = xmlElement.GetChildElements("action").GetEnumerator(); while (iter.MoveNext()) { creationContext.DefinitionObject = this; XmlElement actionElement = (XmlElement) iter.Current; ActionImpl action = new ActionImpl(); action.ReadProcessData(actionElement, creationContext); creationContext.DefinitionObject = null; } }
public override void ReadProcessData(XmlElement xmlElement, CreationContext creationContext) { DefinitionObjectImpl parent = creationContext.DefinitionObject; creationContext.DefinitionObject = this; base.ReadProcessData(xmlElement, creationContext); creationContext.DefinitionObject = parent; this._from = creationContext.Node; creationContext.AddUnresolvedReference(this, xmlElement.GetProperty("to"), creationContext.TransitionDestinationScope, "to", typeof (INode)); }
public virtual void ReadProcessData(XmlElement xmlElement, ProcessDefinitionBuildContext creationContext) { this._processDefinition = creationContext.ProcessDefinition; Type delegatingObjectClass = creationContext.DelegatingObject.GetType(); if (delegatingObjectClass == typeof (AttributeImpl)) { String type = xmlElement.GetProperty("type"); if ((Object) type != null) { this._className = ((String) attributeTypes[type]); string suportedTypes = "supported types: "; foreach (Object o in attributeTypes.Keys) { suportedTypes += o.ToString() + " ,"; } creationContext.Check(((Object) this._className != null), "attribute type '" + type + "' is not supported. " + suportedTypes +" !"); } else { this._className = xmlElement.GetProperty("serializer"); creationContext.Check(((Object) this._className != null), "for an attribute, you must specify either a type or a serializer"); } } else if (delegatingObjectClass == typeof (FieldImpl)) { this._className = xmlElement.GetProperty("class"); creationContext.Check(((Object) this._className != null), "no class specified for a delegation : " + xmlElement); } else { this._className = xmlElement.GetProperty("handler"); creationContext.Check(((Object) this._className != null), "no handler specified for a delegation : " + xmlElement); } log.Debug("parsing delegation for tag '" + xmlElement.Name + "' : " + this._className); // parse the exception handler String exceptionHandlerText = xmlElement.GetAttribute("on-exception"); if ((Object) exceptionHandlerText != null) { _exceptionHandlingType = ExceptionHandlingTypeHelper.FromText(exceptionHandlerText); creationContext.Check((_exceptionHandlingType != 0), "unknown exception handler '" + exceptionHandlerText + "' in delegation " + xmlElement); } // create the configuration string XmlElement configurationXml = new XmlElement("cfg"); IEnumerator iter = xmlElement.GetChildElements("parameter").GetEnumerator(); while (iter.MoveNext()) { configurationXml.AddChild((XmlElement) iter.Current); } _configuration = configurationXml.ToString(); }
public override void ReadProcessData(XmlElement xmlElement, ProcessDefinitionBuildContext creationContext) { base.ReadProcessData(xmlElement, creationContext); this._scope = creationContext.ProcessBlock; this._initialValue = xmlElement.GetProperty("initial-value"); creationContext.DelegatingObject = this; this._serializerDelegation = new DelegationImpl(); this._serializerDelegation.ReadProcessData(xmlElement, creationContext); creationContext.DelegatingObject = null; creationContext.AddReferencableObject(_name, (ProcessBlockImpl) this._scope, typeof (IAttribute), this); }
public override void ReadProcessData(XmlElement xmlElement, ProcessDefinitionBuildContext creationContext) { base.ReadProcessData(xmlElement, creationContext); XmlElement assignmentElement = xmlElement.GetChildElement("assignment"); if (assignmentElement != null) { creationContext.DelegatingObject = this; this._assignmentDelegation = new DelegationImpl(); this._assignmentDelegation.ReadProcessData(assignmentElement, creationContext); creationContext.DelegatingObject = null; } this._actorRoleName = xmlElement.GetProperty("role"); }
public void ReadWebData(XmlElement xmlElement, CreationContext creationContext) { this._name = xmlElement.GetProperty("name"); this._description = xmlElement.GetProperty("description"); this._index = creationContext.Index; log.Debug("paring web information for field " + _name); creationContext.DelegatingObject = this; XmlElement formatterElement = xmlElement.GetChildElement("htmlformatter"); if (formatterElement != null) { this._htmlFormatterDelegation = new DelegationImpl(); this._htmlFormatterDelegation.ReadProcessData(formatterElement, creationContext); } creationContext.DelegatingObject = null; }
public override void ReadProcessData(XmlElement xmlElement, ProcessDefinitionBuildContext creationContext) { this._endState = new EndStateImpl(); this._startState = new StartStateImpl(); // read the process-block contents, the start- and the end-state creationContext.ProcessBlock = this; base.ReadProcessData(xmlElement, creationContext); XmlElement startElement = xmlElement.GetChildElement("start-state"); creationContext.Check((startElement != null), "element start-state is missing"); XmlElement endElement = xmlElement.GetChildElement("end-state"); creationContext.Check((endElement != null), "element end-state is missing"); _startState.ReadProcessData(startElement, creationContext); _endState.ReadProcessData(endElement, creationContext); creationContext.ProcessBlock = null; // add the start & end state to the nodes of this process definition this._nodes.Add(_startState); this._nodes.Add(_endState); // add the end state as referencable object creationContext.AddReferencableObject(this._endState.Name, this, typeof (INode), this._endState); // read the optional authorization handler XmlElement authorizationElement = xmlElement.GetChildElement("authorization"); if (authorizationElement != null) { creationContext.DelegatingObject = this; this.authorizationDelegation = new DelegationImpl(); this.authorizationDelegation.ReadProcessData(authorizationElement, creationContext); creationContext.DelegatingObject = null; } // read the optional responsible for this process definition this._responsibleUserName = xmlElement.GetProperty("responsible"); // calculate the version of this process definition //todo 這行應該移到ProcessDefinitionService //this._version = GetVersionNr(creationContext); // attach the class files to this process definitions //todo 這行應該移到ProcessDefinitionService //this._classFiles = GetAssemblyFiles(creationContext); }
private Object GetObject(XmlElement xmlElement) { Object object_Renamed = null; String className = xmlElement.GetProperty("class"); if (((Object) className == null) || ("java.lang.String".Equals(className))) { object_Renamed = GetText(xmlElement); } else if ("java.util.List".Equals(className)) { object_Renamed = GetList(xmlElement); } else if ("java.util.Map".Equals(className)) { object_Renamed = GetMap(xmlElement); } else { log.Error("Error getting object->@portme"); //@portme /* try { Type clazz = Type.GetType(className); System.Reflection.ConstructorInfo constructor = clazz.GetConstructor(constructorArgumentTypes); object_Renamed = constructor.newInstance(new Object[]{xmlElement.getContentString()}); } catch (System.Exception t) { log.Error("Error getting object", t); }*/ } return object_Renamed; }