protected internal virtual void CreateItemDefinitions(BpmnModel bpmnModel) { foreach (ItemDefinition itemDefinitionElement in bpmnModel.ItemDefinitions.Values) { if (!itemDefinitionMap.ContainsKey(itemDefinitionElement.Id)) { IStructureDefinition structure = null; try { // it is a class Type classStructure = ReflectUtil.LoadClass(itemDefinitionElement.StructureRef); structure = new ClassStructureDefinition(classStructure); } catch (ActivitiException) { // it is a reference to a different structure structure = structureDefinitionMap[itemDefinitionElement.StructureRef]; } Datas.ItemDefinition itemDefinition = new Datas.ItemDefinition(itemDefinitionElement.Id, structure); if (!string.IsNullOrWhiteSpace(itemDefinitionElement.ItemKind)) { itemDefinition.ItemKind = (ItemKind)Enum.Parse(typeof(ItemKind), itemDefinitionElement.ItemKind); } itemDefinitionMap[itemDefinition.Id] = itemDefinition; } } }
protected internal virtual void InitializeIoSpecification(IOSpecification activityIoSpecification, IExecutionEntity execution, BpmnModel bpmnModel) { foreach (DataSpec dataSpec in activityIoSpecification.DataInputs) { Datas.ItemDefinition itemDefinition = itemDefinitionMap[dataSpec.ItemSubjectRef]; execution.SetVariable(dataSpec.Id, itemDefinition.CreateInstance()); } foreach (DataSpec dataSpec in activityIoSpecification.DataOutputs) { Datas.ItemDefinition itemDefinition = itemDefinitionMap[dataSpec.ItemSubjectRef]; execution.SetVariable(dataSpec.Id, itemDefinition.CreateInstance()); } }
public virtual void CreateMessages(BpmnModel bpmnModel) { foreach (Message messageElement in bpmnModel.Messages) { if (!messageDefinitionMap.ContainsKey(messageElement.Id)) { MessageDefinition messageDefinition = new MessageDefinition(messageElement.Id); if (!string.IsNullOrWhiteSpace(messageElement.ItemRef)) { if (itemDefinitionMap.ContainsKey(messageElement.ItemRef)) { Datas.ItemDefinition itemDefinition = itemDefinitionMap[messageElement.ItemRef]; messageDefinition.ItemDefinition = itemDefinition; } } messageDefinitionMap[messageDefinition.Id] = messageDefinition; } } }