Subscribe to Citeck Event

- route:
    from:
      uri: 'ecos-event:record-created' # подписываемся на событие "Запись создана"
      parameters:
        attributes:
          recordId: 'record?id' # указываем какие атрибуты нам нужны из события
        filter: # устанавливаем фильтр
          t: not-eq
          a: conditionField
          v: true
      steps:
        - to: log:record-was-created

Example: Performing Actions on Status Change

To perform actions on status change, you can use a subscription to Citeck events:

from:
  uri: 'ecos-event:record-status-changed'
  parameters:
    attributes:
      recordId: 'record?id'
      documents: 'record.docs:documents[]{ref:?id,typeId:_type?localId,contentSize:_content.size?num}!'
    filter:
      t: and
      val:
        - t: 'eq'
          att: 'typeDef.id'
          # id типа основного документа, за статусом которого мы следим
          val: 'SED-agreement'
        - t: 'eq'
          att: 'after?str'
          val: 'integration-trigger' # id ожидаемого статуса

Next, you can take the list of documents, retrieve their attributes (including content) using GetRecordAttsProcessor, and send them to an external service via the HTTP component.

The full configuration with comments is provided in the attachment. For this example scenario, you need to change:

  1. beans[0] -> properties -> FILE_TYPES_TO_PROCESS: [‘scan-document’] -> [‘SED-main-document’]

  2. route -> from -> parameters -> filter -> val[0] -> val: contract -> SED-agreement

  3. route -> from -> parameters -> filter -> val[1] -> val: integration-trigger -> your_status

Also create a secret with username/password in the journal /v2/journals?journalId=ecos-secrets&viewMode=table&ws=admin$workspace

---
id: file-upload-endpoint-auth
name:
  ru: File Upload Endpoint Auth
type: BASIC
data:
  username: admin
  password: admin

And create an endpoint with the URL for uploading files in the journal /v2/journals?journalId=endpoints&viewMode=table&ws=admin$workspace

---
id: file-upload-endpoint
name:
  ru: File Upload Endpoint
url: http://localhost/gateway/emodel/api/ecos/webapp/content
credentials: emodel/secret@file-upload-endpoint-auth

If the endpoint or secret changes, Camel DSL must be restarted for the changes to take effect.

Full configuration with comments