Skip to content

Функция работает в плагине, но не работает на портале #620

@Alexey0611

Description

@Alexey0611

Описание функции:

  find_integrations:
      title: Поиск интеграций
      params:
        - alias: name
          type: string
          title: Имя интеграции
          required: true
        - alias: aspects
          type: object
          title: Аспекты
          required: true
      code: >
        (
            $all_aspects := aspects;
            $name := name;
            [ $distinct([ $all_aspects.$spread().(
                  $ASPECT_ID := $keys()[ 0 ];
                  $BASE_ID := $split($ASPECT_ID, ".", 2) ~> $join('.');
                  $aspects := $.*.(
                  $ASPECT := $;
                  {
                    "id": $ASPECT_ID,
                    "link_to_aspect": "/architect/aspects/" & $ASPECT_ID,
                    "title": title,
                    "number": number,
                    "description": description,
                    "protocol": protocol,
                    "component": "Ссылка",
                    "link_to_component": "/architect/components/" & component,
                    "entity": entity
                  }
                  );
            $aspects[ entity="integration" ][ $contains(id, $name) ];
            ) ])^(id) ]
        )

Вызов функции:

docs:
  aspects_table_list.external.pm.dit.is_etp:
    type: table
    headers:
      - value: number
        text: Номер
        sortable: true
        align: center
        width: 1%
        link: link_to_aspect
      - value: title
        text: Название интеграционного сценария
        sortable: true
        align: center
        width: 30%
      - value: description
        text: Описание интеграционного сценария
        sortable: true
        align: center
        width: 60%
      - value: protocol
        text: Протокол/порт
        sortable: true
        align: center
        width: 10%
      - value: component
        text: Смежная система
        sortable: true
        align: center
        width: 10%
        link: link_to_component

    source: >
      (
          $find_integrations("pm.dit.is_etp.integrations", $.aspects);
      )

В плагине для IDEA функция работает корректно.
На портале при открытии документа появляется такое сообщение:

Image Ошибку выдаёт вот такую: { "message": "Attempted to invoke a non-function", "error": { "code": "T1006", "stack": "Error\n at applyInner (/home/kadm/Downloads/DocHub/node_modules/jsonata/jsonata.js:4961:29)\n at apply (/home/kadm/Downloads/DocHub/node_modules/jsonata/jsonata.js:4896:24)\n at evaluateFunction (/home/kadm/Downloads/DocHub/node_modules/jsonata/jsonata.js:4871:28)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async evaluate (/home/kadm/Downloads/DocHub/node_modules/jsonata/jsonata.js:3525:26)\n at async evaluateBlock (/home/kadm/Downloads/DocHub/node_modules/jsonata/jsonata.js:4520:22)\n at async evaluate (/home/kadm/Downloads/DocHub/node_modules/jsonata/jsonata.js:3516:26)\n at async Object.evaluate (/home/kadm/Downloads/DocHub/node_modules/jsonata/jsonata.js:5558:26)", "position": 25, "token": "find_integrations", "message": "Attempted to invoke a non-function" } }

Ошибки в DevTools:

Image Логи бэкэнда:

DocHub_log.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions