Adding fields to the method flow

The method flow Input and Output steps contain the metadata of the fields that the data consumer and data source send to each other. Therefore, when composing a contract's data flow, you must specify field metadata for each step.   

Add fields to an Input or Output step

To add files to an input or output step perform the following:

  1. Click an Input or an Output step on the method flow.

  2. Add fields to the input and output step in one of three ways:

  • Add fields manually
  • copy fields from an asset
  • add fields from a spec file

Add fields manually

You can add fields to the input and output elements by defining them from scratch one by one. 

  1. Click an Input or an Output step on the method flow.

  2. Select  Start adding fields.

  3. Type the Field Name, select its Type, and click Save.

  4. To add another field, click  , select Add Field and repeat the steps above.

  5. To add a property field to a structure-type field, click the  button adjacent to the field
    name and select Add Lead Field

Add fields from a JSON file.

You can add fields to the flow step by uploading a JSON file that describes the input or output fields.  

  1. Prepare a JSON file describing the input or output fields. 

    [
      {
        "fullName": "John Dao",
        "age": 30,
        "smoking": false,
        "policy": {
            "polNum": "89526",
            "startDate": "2022-10-31 00:00:00"
        }
      },
      {
        "fullName": "Joann Doe",
        "age": 20,
        "smoking": true,
        "policy": {
            "polNum": "99256",
            "startDate": "2022-12-31 00:00:00"
        }
      }
    ]
  1. Select  Upload JSON file and upload the file.
  1. Review the created field hierarchy.

Copy fields from an asset

You can copy fields to the Input and Output flow steps by copying them from one of the assets attached to your project. 

To copy fields from an asset, perform the following:

  1. Click an Input or an Output step on the method flow.

  2. Select  Copy from Asset. The modules assigned to your projects are displayed.

  3. Select the module that contains the asset from which to copy fields and click Next.

  4. Select the asset from which to copy fields and click Select Asset.

  5. Select whether to copy the asset input or output fields and click Copy Asset Model.
    Copy Asset Model