Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 16 Current »

The ELO post-processing step allows you to store attributes and files from Forms in ELO.

Result of the ELO post-processing

MODE: Create

  • A new folder in ELO is created

  • the folder mask is assigned to the folder

  • the mask attributes are assigned to the folder

  • the map field attributes are assigned to the folder

  • Attachments are uploaded as child Elements to the folder

  • the file mask is assigned to each uploaded attachment

  • if configured: a workflow is started

MODE: Update

  • Updates an existing folder in ELO - identified by ObjectID or GUID

  • If a folder mask is configured: an updated folder mask is set

  • If a path is configured: moved the folder to the new location (including all subfolders/files)

  • If a folder name is configured: updated the folder name

  • Update the mask attributes: new values are added. If a value already exists, it will be overwritten. Old values that are not overwritten will stay

  • Update the map field attributes. new values are added. If a value already exists, it will be overwritten. Old values that are not overwritten will stay

  • Attachments are uploaded as child Elements to the folder

  • the file mask is assigned to each uploaded attachment

  • if configured: a workflow is started

MODE: Delete

  • A single Sord Object in ELO is deleted - identified by ObjectID or GUID

Summary of naming conventions in ELO

Sord

A sord in ELO is any object. This can be a Folder, File, …

Folder

The Folder in ELO is a container that

  • has ONE assigned Folder mask

  • has N mask attributes (map-like key-value pairs) - also called objectkeys. These are directly connected to the assigned Folder mask. e.g. A Folder with the mask ‘invoice' has a mask attribute ‘invoice number’ but no attribute ‘birthday’.
    The mask attributes are String values only with a maximum length of 255 characters.

  • has N map field attributes (map-like key-value pairs) - in ELO they are shown in the tab ‘Additional Infos’. They are used in various Business Solutions and Forms. Each attribute has an assigned domain (objekte, formdata, ...) and a type (string or blob). The type string is limited to a maximum length of 255 characters.

  • has N child elements

    • other Folders

    • Files

File

These are actual BLOB files like JPG, PDF, …

They have:

  • ONE assigned File mask

as well as

  • N mask attributes

  • N map field attributes

However, Portrait only allows setting the file mask. Attributes are only supported to be stored in the folder.

Detailed process description

MODE: Create

The creation process is done in the following order

  • User submits Form

  • Handlebars are applied, see order below

  • Validations

    • Validation of Mask attributes - fieldProcessor + dialog "fields": [{...}]

    • Validation of Folder mask - mask

    • Validation of File mask - fileMask

  • Folder is created or copied - according to path,folderName and sourcePath

  • Folder mask is set

  • Mask attributes are set

  • Map fields are set

  • Attachments, with the correct File mask, are uploaded

  • Workflow is started

There is no transaction. If one step fails some data might already be written to ELO

Validation of Mask attributes

Checked:

  • Each mask attribute value can only contain max 255 characters.

Not Checked:

  • The mask attribute is available in the folder mask. In this case, the attribute is ignored and not written to ELO.

Validation of Folder/File mask

Checked:

  • If the configured mask is allowed to be set to a Sord of the type folder/file

MODE: Update

Same as in the CREATE mode. However, not all configurations are required.

  • Path: if empty the folder won’t get moved and stays on the same path

  • folderName: if empty the folder won’t get renamed.

MODE: Delete

  • User submits Form

  • A single Sord Object in ELO is deleted - identified by ObjectID or GUID

Configuration for MODE: CREATE

onSubmit.type

Must be ELO

onSubmit.connection

ID of the ELO connection - see ELO connections

onSubmit.mode

must be CREATE

onSubmit.path

Optional

Path of the folder. The path can already exist in ELO, if not it is created during the first form submission.

is used as a path seperator. Therefore, can NOT be contained inside the variables. An Error will be throws if the supplied parameters contain an

Handelbars are supported.

Example Handlebars for the path:
"¶Portrait¶SERVICE_PROTOCOL¶{{SERVICE_PROTOCOL_PRIORITY}}"

If no path is given, the submitted forms are stored in the Chaosablage.

onSubmit.folderName

Required

Name of the folder that gets created when a form is submitted.

Handelbars are supported.

Example Handlebars for the folder name:
"{{now format=\"yyyy-MM-dd\"}} - {{SERVICE_PROTOCOL_ISSUE}}"

onSubmit.sourcePath

Optional

If provided the sord object, includings all its content and set attributes, is copied and used as the base Folder.

The target will be onSubmit.path and the name of the copied sord onSubmit.folderName

Handelbars are supported.

This property can’t be used together when writing to Chaosablage.

So when using onSubmit.sourcePath also provide the property onSubmit.path.

Example:

"¶Administration¶Business Solutions¶common¶Configuration¶Common file types¶Service Call Template"

onSubmit.mask

Name of the folder mask in ELO.

The mask must already be created in ELO and allowed to be set to an folder Sord.

If empty the default folder mask from elo is determied and applied.

onSubmit.fileMask

Name of the file mask in ELO.

The mask must already be created in ELO and allowed to be set to an document Sord.

If empty the default file mask from elo is determied and applied.

onSubmit.fieldProcessor

See Mask Attributes below

onSubmit.maps

See Map Attributes below

onSubmit.workflow

Name of the ELO workflow Template, that will be started on the created folder.

Optional: If no value is given, then no workflow is started.

onSubmit.workflowname

The name of the workflow instance which is started.

Support for Field Processors

Available variables:

Default: {{FOLDER_NAME}}

So the default workflowname is the same as the created/updated folder.

onSubmit.index

The id of the ELO sources that will be reindexed with the changed items. Works for CREATE, UPDATE and DELETE

Mask Attributes

There are two methods to configure which Mask attributes are selected to be written:

  • 1:1 mapping of the dialog field names - this happens automatically

"pages": [
            {
                "label": "Person",
                "fields": [
                    {
                        "name": "damaged_person_first_name",
                        "displayText": "Vorname *",
                        "description": "First name",
                        "type": "TextBox",
                        "options": {
                            "required": true,
                            "confirmation": true
                        }
                    }
          ] 

A mask attribute with the key ‘damaged_person_first_name’ is selected.

  • fieldProcessors

        fieldProcessor:
          - field: CM_WA_COMPANY
            value: "{{damaged_company_name}}"

A mask attribute with the key ‘CM_WA_COMPANY’ is selected.

The combination of both methods is written to ELO.


The attributes are only marked to be written. At runtime, it is determined if the keys are available to be written for the configured folder mask. If some attributes are not available to be set for this mask they are simply ignored and not written.

The methods can also be combined:

"pages": [
            {
                "fields": [
                    {
                        "name": "damaged_person_first_name",
                        ...
                    },
                    {
                        "name": "damaged_person_last_name",
                        ...
                    }
          ] 
        fieldProcessor:
          - field: CM_WA_FULLNAME
            value: "{{damaged_person_first_name}} {{damaged_person_last_name}}"

Now 3 values will be marked to be written:

  • damaged_person_first_name

  • damaged_person_last_name

  • CM_WA_FULLNAME

Recommendation

If you need to configure a large amount of attribute values, we recommend to first define all attributes in the dialog in a naming schema you can detect easily.

Then do the mapping to you elo attributes using the fieldProcessors.

Map Attributes

Map attributes can be configured via the maps YML parameter

maps:
  - domain: objekte
    type: string
    fieldProcessor:
      - field: CM_WA_STATUS
        value: "aktiv"
      - ...
  - domain: objekte
    type: string
    fieldProcessor:
      - field: CM_WA_STATUS2
        value: "You can also use the same domain and type twice"
      - ...
  - domain: objekte
    type: blob
    fieldProcessor:
      - field: CM_WA_DESC
        value: "long value that is more than 255 chars ..."
      - ...
  - domain: formdata
    type: blob
    fieldProcessor:
      - field: CM_WA_HEILUNGSVERLAUF
        value: "{{accident_health_plan}}"

At runtime, the list domains and types are grouped together. For each domain and type the data is written separately.

The domain depends on the business solution in ELO. Each domain has its own SQL table. The values are usually not visible from the ELO Client directly. Only these with the domain objekte and type string. Others have to be checked in the DB directly.

Due to the implementation in ELO there is no validation of fields. They are written 1:1 to the SQL database. Be careful to use the right formatting for dates, …

Handlebars

The handlebars support the usage of the form parameter. In addition, we provide the following use of parameters from the user that submitted the form:

Constants

PORTRAIT_USER_ID

unique user id

cNkXPLhKjXMFiFYvYvcGOdmHRrTOxesEfcWmoteLGUMyyqslLyEV

PORTRAIT_USER_NAME

name of the user

Linda Jackson

PORTRAIT_USER_EMAIL

email

linda.jackson@larsens.portraitapp.co

PORTRAIT_USER_ROLE

assigned role

ADMIN

User Custom Fields Custom Fields

<key_of_custom_field>

<value_of_custom_field>

The value set in the Managing users View.
Different for each user. The Value from the logged in user is used.

During the form submission, the handlebars are applied in this order:

  1. Fieldprocessors

  2. onSubmit.path, onSubmit.folderName

Therefore the result of the field processes can influence the onSubmit config.

Example ELO post-processing in Portrait

Example configuration:

 - id: createServiceCallELO
      onSubmit:
        type: ELO
        connection: sm_elo20_nav
        mask: PORTRAIT_SERVICE_PROTOCOL
        mode: CREATE
        workflow: newInsuranceClaim
        fileMask: ATTACHMENT
        path: "¶PortraitForms¶SERVICE_PROTOCOL¶{{SERVICE_PROTOCOL_PRIORITY}}"
        folderName: "{{SERVICE_PROTOCOL_MODEL}}-{{SERVICE_PROTOCOL_ISSUE}}-{{now format=\"yyyy-MM-dd HH:mm:ss\"}}"
        maps:
          - domain: objekte
            type: string
            fieldProcessor:
              - field: CM_WA_STATUS
                value: "aktiv"
          - domain: objekte
            type: blob
            fieldProcessor:
              - field: CM_WA_DESC
                value: "long text that can span more than 255 chars"
      dialog: |-
        { ...

Configuration for MODE: UPDATE

onSubmit.type

Must be ELO

onSubmit.connection

ID of the ELO connection - see ELO connections

onSubmit.mode

must be UPDATE

onSubmit.path

Optional

Path where the updated folder is moved to. The path can already exist in ELO, if not it is created during the first form submission.

is used as a path seperator. Therefore, can NOT be contained inside the variables. An Error will be throws if the supplied parameters contain an

Handelbars are supported.

Example Handlebars for the path:
"¶Portrait¶SERVICE_PROTOCOL¶{{SERVICE_PROTOCOL_PRIORITY}}"

If no path is given, then the folder won’t get moved.

onSubmit.folderName

Optional

Name of the folder that gets created when a form is submitted.

Handelbars are supported.

Example Handlebars for the folder name:
"{{now format=\"yyyy-MM-dd\"}} - {{SERVICE_PROTOCOL_ISSUE}}"

If no folderName is given, then the folder won’t get renamed.

onSubmit.sourcePath

Not supported for update, use path instead to move folders.

onSubmit.mask

Name of the folder mask in ELO.

The mask must already be created in ELO and allowed to be set to an folder Sord.

If empty the folder mask won’t be changed

onSubmit.fileMask

Name of the file mask in ELO.

The mask must already be created in ELO and allowed to be set to an document Sord.

If empty the default file mask from elo is determied and applied.

onSubmit.fieldProcessor

See Mask Attributes below

onSubmit.maps

See Map Attributes below

onSubmit.workflow

Name of the ELO workflow, that will be started on the created folder.

Optional: If no value is given, then no workflow is started.

onSubmit.index

Optional

The id of the ELO sources that will be reindexed with the changed items. Works for CREATE, UPDATE and DELETE

Example ELO post-processing in Portrait

Example configuration:

    - id: createExpense_elo_update
      onSubmit:
        type: ELO
        connection: sm_elo20_nav
        mask: SPESEN
        mode: UPDATE
        fileMask: Spesen_Beleg
        index: expenses
        path: "¶Alpha AG¶Spesenverwaltung¶{{BELEGDATUM_JAHR}}¶{{BELEGDATUM_MONAT}}¶{{BELEGDATUM_TAG}}"
        folderName: "{{SUBJECT}} ({{VENNAME}}) am {{BELEGDATUM_TAG}}.{{BELEGDATUM_MONAT}}.{{BELEGDATUM_JAHR}} - {{PUROWNER}}"
        fieldProcessor:
          - field: BELEGDATUM_JAHR
            value: "{{substring PURDOCDATE 0 4 }}"
          - field: BELEGDATUM_MONAT
            value: "{{substring PURDOCDATE 5 7 }}"
          - field: BELEGDATUM_TAG
            value: "{{substring PURDOCDATE 8 }}"

Config for Dialog

It is important that you configure one field that is excatly named 'key'. This needs to be the GUID or ObjectID of the ELO Folder Sord to update.

You can use a hidden field and forward property to pass the ID from a detail view to a form

              "fields": [
                {
                  "name": "key",
                  "type": "Hidden"
                },
        - label: 'Bearbeiten'
          type: 'form'
          key: 'createExpense_elo_update'
          icon: 'edit'
          options:
            forwardFields:
              - key

Configuration for MODE: DELETE

onSubmit.type

Must be ELO

onSubmit.connection

ID of the ELO connection - see ELO connections

onSubmit.mode

must be DELETE

onSubmit.dialog

JSON with the correct formatted Forms

must contain one field with the name 'key'. This is theObjectID or GUID of the object to be deleted. You can use EntryFields to present existing entries to the user and select the ObjectID or GUID

onSubmit.index

The id of the ELO sources that will be reindexed with the changed items. Works for CREATE, UPDATE and DELETE

Basic Example:

    - id: testEloDelete
      onSubmit:
        type: ELO
        connection: sm_elo20_nav
        mode: DELETE
      dialog: |-
        {
          "title": "ELO DELETE TEST",
          "successMessage": "Eintrag geloescht.",
          "languageCodeSuccessMessage": "ON_SUBMIT_SUCCESS_MESSAGE",
          "errorMessage": "Fehler beim Loeschen.",
          "languageCodeErrorMessage": "ON_SUBMIT_ERROR_MESSAGE",
          "submitText": "Loeschen",
          "languageCodeSubmitText": "SUBMIT_NOW",
          "description": "Delete ELO Entry",
          "pages": [
            {
              "label":"Allgemein",
              "fields": [
               {
                  "name": "key",
                  "type": "Hidden"
                }
              ]
            }
          ]
        }

Config for Dialog

It is important that you configure one field that is excatly named 'key'. This needs to be the GUID or ObjectID of the ELO Folder Sord to delete.

You can use a hidden field and forward property to pass the ID from a detail view to a form

              "fields": [
                {
                  "name": "key",
                  "type": "Hidden"
                },
        - label: 'Entfernen'
          type: 'form'
          key: 'createExpense_elo_delete'
          icon: 'trash-2'
          showInTableHeader: false
          showInDetailList: true
          options:
            forwardFields:
              - key

Troubleshooting

If you encounter some issues, look in the portrait backend log file. Watch out for error messages directly from ELO, which is logged during the process.
Example:

[TICKET:0ACDA9...][Die Maske Verkauf kann nicht für Ordner verwendet werden.]

The entire process is non-atomic, which means that in the case of an error, some data might have already been written to ELO. Some actions are required to classify the post-process step as a success, while others are not. Here is an overview:

Cause

Error Level

Results in

ELO folder can’t be created.

(error)

The form data or files will not be stored in ELO.
The frontend will show an error and log the response from ELO.

Folder mask can’t be set.

(error)

The form data or files will not be stored in ELO.
The frontend will show an error and log the response from ELO.

The portrait field name does not match a field name in the ELO mask.

(warning)

This metadata field will be ignored and not stored in ELO.
Post-processing continues normally.

Attachment can’t be uploaded to ELO.

(warning)

This attachment will be ignored and not stored in ELO.
Post-processing continues normally.

Workflow can’t be started.

(warning)

Application will log an error.
Post-processing continues normally.

  • No labels