# Document counter

We now want to implement a counter (technical identification for a document) for the documents filed to the repository. The counter guarantees that the documents of a specific type (e.g. defined by the ELO Business Solution SOL_TYPE or the metadata form) are assigned a unique serial identifier. One example is a contract or invoice number.

# Requirements (general)

  • Select a counter (a counter can already exist)
  • Define/input a new counter (prefix, postfix, number of digits)
  • Create a new counter
  • Return the current count in other components
  • Provide a trigger (REST)

A possible arrangement of the graphical components on the Settings tab.

Tab Einstellungen

Selection list in the suggestions.

Vorschläge im Eingabefeld

# Implementing requirements

We will outline the development processes as well as solution implementation here. We will go through the steps using the Flows framework available to us in Visual Studio Code.

# Start framework

  1. First, we start VS Code.

  2. Open the prepared project folder (in the file system).

    Projektordner im Dateisystem

  3. We will also create the initial project structure as seen in the following images.

    Befehlspalette auswählen

  4. Select the VS Code Command Palette. Use the keyboard shortcut CTRL + SHIFT + P.

    Alternative1: Press F1.

    Alternative2: View > Command Palette….

    ELO Komponente erstellen

  5. Select ELO: Create Component.

    ELO Flows-Komponente selektieren

  6. Select ELO Flows Java.

    Paketname

  7. Enter the package name and confirm with ENTER.

    Komponentenname

  8. Enter the component name and confirm with ENTER.

    Version

  9. Enter the version number and confirm with ENTER.

    Komponente angelegt

    Once the framework has been started and the initial project is created, you will see a confirmation message the bottom right of VSC.

    Java-Klasse auswählen

  10. In the created project structure, select any Java class.

    Import bestätigen

  11. Confirm as shown below.

    Initialisierung beendet

  12. Wait a moment until the Java project has been initialized successfully.

Information

The first time you initialize a project may take a few seconds.

# Customizing the project structure

ELO has implemented an example component in a newly created ELO Flows component. You can tailor it to new requirements or delete it and create an entirely new one. In the following example, we take a middle course.

  1. Delete the contents of the files in the localization folder:

    Important

    Do not delete any files. Only delete the contents of the files.

    translations_de.properties and translations.properties.

  2. Delete the Java classes in the folder java\academy\training:

    HelloInput.java and HelloOutput.java

    Angepasste Java-Klasse

    Refactoring

  3. Modify the Java class HelloWorldComponent.java:

    To do so, use the refactoring options provided by VS Code

    Lokalisierungsdateien

  4. Enter the following in the localization files in the localization folder:

    translations\_de.properties and translations.properties

    Key: Counter.display.name

    Values: Dokumentenzähler and Document Counter.

    Erweiterte Projektstruktur

  5. Add additional levels to the project structure.

You will find an example implementation of this requirement in the Appendix.

Last updated: May 4, 2022 at 8:40 AM