示例#1
0
        /// <summary>
        /// Parses all input parameters of an input output element and adds them to
        /// the <seealso cref="IoMapping"/>.
        /// </summary>
        /// <param name="inputOutputElement"> the input output element to process </param>
        /// <param name="ioMapping"> the input output mapping to add input parameters to </param>
        /// <exception cref="BpmnParseException"> if a input parameter element is malformed </exception>
        public static void parseCamundaInputParameters(Element inputOutputElement, IoMapping ioMapping)
        {
            IList <Element> inputParameters = inputOutputElement.elementsNS(BpmnParse.CAMUNDA_BPMN_EXTENSIONS_NS, "inputParameter");

            foreach (Element inputParameterElement in inputParameters)
            {
                parseInputParameterElement(inputParameterElement, ioMapping);
            }
        }
示例#2
0
        /// <summary>
        ///     Parses all output parameters of an input output element and adds them to
        ///     the <seealso cref="IoMapping" />.
        /// </summary>
        /// <param name="inputOutputElement"> the input output element to process </param>
        /// <param name="ioMapping"> the input output mapping to add input parameters to </param>
        /// <exception cref="BpmnParseException"> if a output parameter element is malformed </exception>
        public static void ParseCamundaOutputParameters(Element inputOutputElement, IoMapping ioMapping)
        {
            var outputParameters = inputOutputElement.ElementsNS(BpmnParse.CamundaBpmnExtensionsNs,
                                                                 "outputParameter");

            foreach (var outputParameterElement in outputParameters)
            {
                ParseOutputParameterElement(outputParameterElement, ioMapping);
            }
        }
示例#3
0
        /// <summary>
        ///     Returns the <seealso cref="IoMapping" /> of an element.
        /// </summary>
        /// <param name="element"> the element to parse </param>
        /// <returns> the input output mapping or null if non defined </returns>
        /// <exception cref="BpmnParseException"> if a input/output parameter element is malformed </exception>
        public static IoMapping ParseInputOutput(Element element)
        {
            var inputOutputElement = element.ElementNs(BpmnParse.CamundaBpmnExtensionsNs, "inputOutput");

            if (inputOutputElement != null)
            {
                var ioMapping = new IoMapping();
                ParseCamundaInputParameters(inputOutputElement, ioMapping);
                ParseCamundaOutputParameters(inputOutputElement, ioMapping);
                return(ioMapping);
            }
            return(null);
        }
示例#4
0
        /// <summary>
        /// Returns the <seealso cref="IoMapping"/> of an element.
        /// </summary>
        /// <param name="element"> the element to parse </param>
        /// <returns> the input output mapping or null if non defined </returns>
        /// <exception cref="BpmnParseException"> if a input/output parameter element is malformed </exception>
        public static IoMapping parseInputOutput(Element element)
        {
            Element inputOutputElement = element.elementNS(BpmnParse.CAMUNDA_BPMN_EXTENSIONS_NS, "inputOutput");

            if (inputOutputElement != null)
            {
                IoMapping ioMapping = new IoMapping();
                parseCamundaInputParameters(inputOutputElement, ioMapping);
                parseCamundaOutputParameters(inputOutputElement, ioMapping);
                return(ioMapping);
            }
            return(null);
        }
示例#5
0
        /// <summary>
        ///     Parses a input parameter and adds it to the <seealso cref="IoMapping" />.
        /// </summary>
        /// <param name="inputParameterElement"> the input parameter element </param>
        /// <param name="ioMapping"> the mapping to add the element </param>
        /// <exception cref="BpmnParseException"> if the input parameter element is malformed </exception>
        public static void ParseInputParameterElement(Element inputParameterElement, IoMapping ioMapping)
        {
            var nameAttribute = inputParameterElement.GetAttributeValue("name");

            if (ReferenceEquals(nameAttribute, null) || (nameAttribute.Length == 0))
            {
                throw new BpmnParseException("Missing attribute 'name' for inputParameter", inputParameterElement);
            }

            var valueProvider = ParseNestedParamValueProvider(inputParameterElement);

            // add parameter
            ioMapping.AddInputParameter(new InputParameter(nameAttribute, valueProvider));
        }
示例#6
0
        /// <summary>
        /// Parses a output parameter and adds it to the <seealso cref="IoMapping"/>.
        /// </summary>
        /// <param name="outputParameterElement"> the output parameter element </param>
        /// <param name="ioMapping"> the mapping to add the element </param>
        /// <exception cref="BpmnParseException"> if the output parameter element is malformed </exception>
        public static void parseOutputParameterElement(Element outputParameterElement, IoMapping ioMapping)
        {
            string nameAttribute = outputParameterElement.attribute("name");

            if (string.ReferenceEquals(nameAttribute, null) || nameAttribute.Length == 0)
            {
                throw new BpmnParseException("Missing attribute 'name' for outputParameter", outputParameterElement);
            }

            ParameterValueProvider valueProvider = parseNestedParamValueProvider(outputParameterElement);

            // add parameter
            ioMapping.addOutputParameter(new OutputParameter(nameAttribute, valueProvider));
        }