# 设置变量节点

用于设置循环中间变量的值,使其下次循环使用设置后的值。

# 数据结构定义

export interface SetVariableNodeDef {
  id: INodeIDValue;
  type: WorkflowNodeTypeEnum.SetVariable;
  data: {
    title: string;
    inputsValues: {
      assign: [
        {
          left: IFlowRefValue;                          // 中间变量引用
          right: IFlowRefValue | IFlowConstantValue;    // 变量值
        }
      ]
    };
    inputs: IJsonSchema;                                // 节点输入参数类型
  },
}

# 范例

{
  id: {random(6)},
  type: 'set-variable',
  data: {
    title: `设置变量`,
    data: {
      inputsValues: {
        assign: [
          {
            left: {
              type: 'ref',
              content: ['121378', 'counter'],
            },
            right: {
              type: 'ref',
              content: ['226719_locals', 'loop_params', 'index'],
            },
          },
        ],
      },
      inputs: {
        type: 'object',
        required: [],
        properties: {
          assign: {
            type: 'array',
            items: {
              type: 'object',
              properties: {
                left: { 
                  type: 'number' 
                },
                right: { 
                  type: 'number' 
                },
              },
            },
          },
        },
      },
    }
  },
}