Liquid Studio 2020
Data Mapping / Data Mapper Functions / OutputParameter
In This Topic
    OutputParameter
    In This Topic

    Function Name
    Output Parameter
    Category
    Data Type
    Icon
    Constant
    Description
    Defines an output parameter for the transform.
    Inputs
    Value The value to write to the output parameter
    Properties
    Parameter Name The name of the parameter name used when setting the it in code or via a command line argument

    Usage

    The Output Parameter component allows a value to be returned from a transform. In the case when a command line executable is generated this data is written out to the console, if .Net source code has been generated then the value can be retrieved and then used by the calling application.

    A sequence of values can be written to the Output Parameter, which cause multiple Value elements to be created.

    If a transform contains multiple Output Parameters then they are executed in the order defined by the Execution Order property, and the values are combined, resulting in multiple Value elements.

    Example

    The following simple transform returns the value "My Result" via the output parameter.

    When this is executed within the Liquid Studio Environment the following is printed to the output window.

    Output
    Copy Code
    <TransformResults>
       <Value type="String">My Result</Value>
    </TransformResults>
    

    If it compiled to an executable then running it returns the following

     

    You can use the transform within your own .Net project as follows

    Sample Code
    Copy Code
        ParameterCollection parameters = new ParameterCollection();
        using (DataTransformation.GeneratedTransform transform = new DataTransformation.GeneratedTransform(parameters))
        {
            IEnumerable<DataNode> transformResults = transform.Execute();
            foreach (DataNode result in transformResults)
            {
                Debug.WriteLine($"Result({result.DataType}) = {result.AsString}");
            }
        }
    

    The DataNode contains a typed value, which depends on the value passed to the output parameter in the transform.

    If multiple values are passed to the output parameter then the transformResults with contain multiple DataNodes.

     

    See Also