Skip to end of metadata
Go to start of metadata

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

Compare with Current View Page History

« Previous Version 32 Current »

Introduction

tia® DocumentRouter is our universal input manager which allows you to mass import and link large data volumes to SAP. All SAP storage scenarios, including early and late archiving with barcodes are being supported by DocumentRouter.

Documents can be archived in all archiving systems that are compatible with ArchiveLink.

System Requirements

For the system requirements please see: Prerequisites for KGS Software Components

Licensing

In order to use tia® Document Router please follow the guide for requesting licenses: KGS Software licensing.

Then enter the licese like described in section https://kgs-software.atlassian.net/wiki/spaces/DOCUEN/pages/2311028810#Entering-the-license-key

Functional Overview

Input

Due to it’s design, tia® Document Router does not require input in any particular format.

Input can be served by a file system location or via REST.

The tia® Document Router is capable to extract information required for linking to SAP or Salesforce out if an delivered index file or can derive it from document file name.

To-PDF-Functionality allows converting and archiving in one step.

Output (Archiving System)

tia® Document Router uses the standarized SAP ArchiveLink protocol for the transfer of the documents to the archiving system. Therfore all archive or document management solutions which are SAP ArchiveLink certified are fully supported. This applies to all SAP releases (ArchiveLink 3.1 and higher).

In addition to that KGS offers to all archive manufacturers which are not previously certified by SAP an SDK in order to enable their software solutions to use the SAP ArchiveLink therefore the KGS-OMS-Connector.

To protect network communications with the archiving system, tia® Document Router utilizes a security process in which URL’s within the HTTP communication are being encrypted for transfer.

Public and private key encryption of this type as applied to direct communication from SAP, prevents unauthorized access to the archived documents.

Linking

SAP-Linking

Each document will be transferred in to the archiving system by tia® Document Router.

After successfully archiving the document tia® Document Router will execute relevant entries in SAP’s internal tables required in order to search and display the archived document from within SAP.

tia® Document Router ensures that documents are being managed in accordance with the SAP ArchiveLink protocol by safeguarding the links to the relevant SAP business objects.

Access and display of archived documents in SAP is performed in the same way as for data which has been edited and dispatched using SAP’s own tools (SAPScript).

Salesforce-Linking

After archiving, tia® Document Router can link to Salesforce, too. This can happen in addition to SAP-Linking or instead of SAP-Linking. (deprecated)

Installation

Sample installation via webapps-folder

After downloading tia® Document Router, unzip the content of the downloaded zip-archive into <Webserver-installation-folder>/webapps folder.

The zip-archive contains tia® Document Router in form of a war-container, which will be automatically decompressed by Apache Tomcat Webserver.

After Tomcat has finished decompressing the war-container, you may restart Tomcat webserver once.

Depending on the hardware and system where Tomcat web server is being executed on, it might take some time to decompress the content of the war-archive.

Global Configuration

Enter global config view

In order to enter document router global configuration, please enter the UI and click: MainKGS Document RouterConfiguration Editor

Global configuration is explained in DR4 - Global Configuration

Entering the license key

The license key is provided by KGS.

After successfully installing tia® Document Router you may enter the license key in order to use tia®Document Router.

There are possibilities to configure the license key:

  1. via Apache Tomcat user interface

  2. via configuration file

1. Entering license key via user interface

To do so, please open the tia® Document Router web interface. Inside top menu, please click on OSGi → Configuration. Subsequently you will see a list of configurations.

By clicking on pencil-symbol in the row of Global DocumentRouter Configuration, a modal dialog with configuration items will be opened. Please enter the license key in the corresponding form field.

Opened “Global Documentrouter Configuration”-modal with highlighted “LicenseKey”-filed.

By clicking the Save button the dialog will be closed and the license key saved in the global DocumentRouter configuration.

2. Providing the license key inside global DocumentRouter configuration file

tia® Document Router also allows you to provide the license key via the global configuration file. Actually it is the same place where the UI will put the key.

Please follow these instructions:

  1. Stop DocumentRouter

  2. Go to <DocumentRouter installation directory>/conf/documentrouter

  3. Open the containing Global DocumentRouter Configuration.cfg by an editor

  4. Place your license key here: <entry key="License.License Key">Put your license key here</entry>

  5. Save the config file

  6. Restart DocumentRouter

Now, DocumentRouter will load the global configuration again and find the key.

SAP RemoteFunction for DMS communication

tia® Document Router uses the standard SAP ArchiveLink protocol in order to communicate with any ArchiveLink certified DMS. To enable the SAP ArchiveLink functionality, KGS provides an SAP transport, which has to be imported into the connected SAP systems.

Interfaces

An interface describes the type of input data tia® Document Router receives. The following types of interfaces are supported by tia® Document Router.

Streamserve

The Streamserver interfaces is used by output management systems (OMS) of the type streamserve. The input format of the index files is being defined like this.

<SAP Business Object>,<SAP AL Doc-Type>, <SAP Repository>, <SAP Object Key>, <SAP SysID>, <doc file file>

Example:

VBRK,SDOINVOICE,T1,095092046,U8P,strs234BA33A41676152310144089686720.pdf

RDI

The SAP Raw Data Interface (RDI) is the standard protocol by SAP to deliver the data of outgoing documents to an external OMS. The RDI file contains all information required by tia® Document Router in order to store the image file in an external DMS (defined within SAP using standard ArchiveLink customizing as well as linking the archived documend to an SAP Business Object in order to allow an user to access the archived image using SAP ArchiveLink functionality. Information like the ContentRepository, Object Type as well as the ObjectID will be contained within the RDI file.

B4Activator

The B4Activator interface is specifically designed for transfering multiline index data with attachments and table data to SAP (e.g. to be processed further by KGS Activator). The first line within the index file contains information regarding the main document with ContentRepository, SAP (Workflow) document type as well as the image filename. All attributes are being separated by semicolon ( ; ).

Generic DataInterface definition

In addition to the already mentioned interface definitions Streamserve, RDI and B4Activator theres also a more generic index format specification, which allows you setup an INI file which holds various sections each describing a specific index format fitting your requirements. The generic DataInterface approach is being described further in the following section DR4 - Defining DataInterfaces, SIDMappings and Archive Link Mappings .

Defining DataInterfaces and SIDMappings

In order to use tia® Document Router you may provide a configuration file that contains the DataInterface definition, as well as the ArchivingSystem definition and a configuration file that contains the SIDMapping definition.

These three definitions follow a certain structure that will be described in the following sections.

DataInterface definition

The data interface describes the data and positions of data which will be used in the linking process. Index files contain these values and needs to fit the definition. Regularly, the DataInterface is derived from the structure defined from the index file content.

An DataInterface can be defined in 2 types:

  • Separator based (variable length)

  • fixed length

DataInterface for sets with variable length

[<DataInterface name>]
<Keyname> = <Key type> | <Separator> | <Field Index> | <Default Value>
<Keyname> = <Key type> | <Separator> | <Field Index> | <Default Value>

DataInterface for sets with fixed length

[<DataInterface name>]
<Keyname> = <Key type> | <Position> | <Length> | <Default Value>
<Keyname> = <Key type> | <Position> | <Length> | <Default Value>

When using a DataInterface for sets with variable length, it’s necessary to define the separator, which will be used in order split the value data stream and retrieve the values.

Keyname is the name of the variable defined within a DataInterface. The Key type has to be defined as one of the following types. Separator defines a symbol, that will be used when splitting the index file content. Number in Set defines the position of the value within the index file. Default Value can be defined as a fallback or as a static value when no value was found within the index file.

In case of a set with fixed length Length defines the length in characters of the value expected within the index file.

The following Key types are being supported by tia® Document Router.

Type symbol / Type value

Symbol / Value description

B

SAP Business Object (e.g. BKPF, VBRK, etc.)

C

SAP Content Repository ID (e.g.: FI, BU, FP, etc.)

D

SAP Archive Document ID

F

Image file name

f

The image filename will be taken the same as the index file.

H

SAP Host

I

Ignores the value

L

SAP Language

M

SAP Client

N

Defines, that the value will not be handed over to the SAP User Link Remote Function

From Version 3.1.39 onward :

Defines the Content of the ‘note’ component

O

SAP Object ID

P

SAP Password

S

SAP SystemID

T

SAP ArchiveLink Document Type (Archiving Object)

U

SAP User

X

Defines that this value will be handed over to the SAP User Link Remote Function

Y

SAP System number

b

Barcode

d

Date

g

SAP Group, which is being used in order to load balance the RFC connection

m

SAP MessageServer Host, which is being used in order to load balace RFC connection

n

SAP Client extracted out of the <SAP SID>M<SAP Client>-notation (e.g.: K47M800 will be translated to SAP Client: 800 in SAP SID K47)

p

ISRA-specific parameter which will be handed over to an ISRA interface

s

SAP System, which is being used for load balancing purposes

o

Offset within the image file (F)

l

Length from the offset within the image file

The following separators are being supported.

  • A semikolon → ;

  • A comma → ,

  • A vertical bar → |

  • A hashtag → #

Sample of “DataInterface”-definition

[BASE_INTERFACE]
Filename = F | , | 1 |
ObjectID = O | , | 0 |@Filename
ContRep = C | , | 0 |FI
Objecttype = B | , | 0 |BKPF
DocType = T | , | 0 |FIIPAYMENT

Every row within a DataInterface defines a parameter to be used during archiving or linking. The parameter names can be used in the default value column of other parameters by prefixing them with an @-sign, like in the example above.

Special fields

Fields can reuse values of other fields.

For example in a scenario where no index file exist, all for archive and link relevant information are fetched from file name. So you need to split up the file name an maybe join if you want create additional information for e.g. linking.

Sub-Value by Position

[positionBasedSchema]
FileName          = f          ||     |0   |
ArchiveType       = C          ||     |0   |N1
DOC_TYPE          = c          ||     |0   |
SAP_OBJECT        = B          ||     |0   |BKBF
AR_OBJECT         = T          ||     |0   |ZFILENAME
ObjectID          = O          ||     |0   |@Filename[1,18]
SYS_ID            = S          ||     |0   |@Filename[20,22]
MANDANT           = M          ||     |0   |@Filename[24,26]
  • ObjectID is an sub string of Filename. It uses position 1 until 18 of it.

Sub-Value by Separator

[separatorBaseSchema]
ImageFileName     =  f  |,  |0  |
CONTREP           =  C  |,  |0  |@ImageFileName[_,1]
ARCHDOCID         =  D  |,  |0  |@ImageFileName[_,2]
  • field ImageFileName is split by _ and then position 1 is used for CONTREP and position 2 for ARCHDOCID

Join

[joinSchema]
FileName          = f          ||     |0   |
ArchiveType       = C          ||     |0   |N1
DOC_TYPE          = c          ||     |0   |
SAP_OBJECT        = B          ||     |0   |BKBF
AR_OBJECT         = T          ||     |0   |ZFILENAME
ObjectID          = O          ||     |0   |@Filename[1,18]
SYS_ID            = S          ||     |0   |@Filename[20,22]
MANDANT           = M          ||     |0   |@Filename[24,26]
another           = X          ||     |0   |@ObjectID@MANDANT
  • here the field another which is used while linking is a concatenation of the contents of ObjectId and Mandant.

ArchiveLink Connection mapping

It’s often necessary to define one or many connections to the archiving system, so tia® Document Router knows how to communicate with the archive and where to exactly archive the processed documents.

For that reason you may want to define the connection parameters for the archiving system.

The definition file has to be placed in config folder. (defined in instance common tab)

The definition file name can be configure in Archiving tab via config item AL Connection Mapping File.

The file follows this format:

Structure of an archive connection definition

[_ARC_<Name of the repository>]
HttpProtocol = <http> or <https>
HttpHost = <Host IP address> or <Host DNS name>
HttpPort = <Port used for the communication with the archiving system>
HttpPath = <Path to the servlet which will be used during the archiving process>
HttpParameters = <Additional parameters in case they are required for the connection>
Security = <0 : Security is not enabled on the repository>
or
<1 : Security is enabled and sent certificates are instantly accepted>
or
<2 : Security is enabled and sent certificates have to be enabled within the SAP system>
LateLocking = <0 : Late locking is disabled> or <1 : Late locking is enabled>

You may define multiple archiving systems in one definition file.

Sample of multiple archiving connection definitions

[_ARC_FI]
HttpProtocol = http
HttpHost = test.contentservers.kgs-software.com
HttpPort = 1234
HttpPath = /KGSAdmin-CS/contentserver
HttpParameters =
Security = 0
LateLocking = 1

[_ARC_TE]
HttpProtocol = http
HttpHost = 17.59.128.128
HttpPort = 2345
HttpPath = /KGSAdmin-CSV/contentserver
HttpParameters =
Security = 0
LateLocking = 1

This definition was in DR3 hold in SIDMappingDefFile.

SIDMapping definition

In document router 4 the SID mapping for linking does not exist anymore via SID mapping file (SIDMappingDefFile).

Instead you can use in schema definition the S like in this example

[foobarInstance]
SYSID                                                   =       X       |;        |1          |
MANDANT                                                 =       X       |;        |2          |
CONTREP                                                 =       C       |;        |3          |
LoginCL                                                 =       S       |;        |0          |@SYSID@MANDANT
Example Schemata
  • here the index files gives mandant and contrep and the LoginCL variable then contains the SAP connector instance id

or this:

[foobarInstance]
CONTREP                                                 =       C       |;        |1         |
LoginCL                                                 =       S       |;        |2         |
  • in this example the index file directly contains the SAP Connector instance id.

As you see, LoginCLis connected to the Variable S. We see it is concatenated from 2 others. So in index file, the concatenation from place 1 and 2 gives the variable value of LoginCL. This value is pointing to an existing SAP-Connector instance with this name.

Real Example

The Document Router is configured with index-Files. Those .idx-Files contain following lines:

Q80;105;XY;
Q80;103;ND;
Q80;134;NF;

Following the previous given Schemata-Example this would mean:

  • Q80 = SYSID

  • 105,103,134 = MANDANT

  • XY,ND,NF = CONTREP

In the Schema above is in Line 5 following configured as “S” (SIDLinking) : @SYSID@MANDANT whereas @SYSID is on place 1 and @MANDANT is on place 2

That means, the DocumentRouter 4.x will concatinate Field 1 and Field 2 and try to find a SAP-Connector-Instance with that Name. In this Example with those three different Index-Files the Document Router tries to call SAP-Connector-Instance:

  • Q80105

  • Q80103

  • Q80134

Means: If those Connections are available (and configured in the SAP-Connector), the DR will Link to those individual SAP-Configurations.

Creating or editing a Document Router instance

Starting and stopping DocumentRouter instances

After instance configuration instances can be started respective stopped. Please enter the DocumentRouter instance manager using the UI:

Main → KGS Document Router

In order to start click the Play button (⏵) in the Actions column.

For stopping, please use the Stop button ( ■ ) in the Actions column. The State will first go into stopping state. After successfully stopped the state changes to Resolved.

DocumentRouter may not instantly stop the instance, but instead wait for the next processing cycle defined by the parameter ProcessTimer. In case you defined a very long period, you may have to wait for the next processing cycle to take place before this DocumentRouter instance has been stopped.

By using the Stop All button, all instances will be stopped gracefully.

In case something in the instance configuration is wrong DocumentRouter will display an error message when you try to start it, which will help you fixing the configuration error.

Protocol regarding processed documents

tia® Document Router is being shipped with the option to create a protocol that includes the information of processed documents.

In order to open the protocol click on
Main → Protocol Writer

This will lead you to the KGS Protocol Writer, which is shipped together with DocumentRouter.

In case you have enabled protocolling, you may see a list of entries representing documents that have been processed so far, similar to the example below.

Protol Writer will provide you with the following information.

Column name

Description

Repository

The column Repository contains information regarding the repository the document has been archived to.

Document

Within the column Document you’ll find the document Id, which has been used or was created in order to store and find again the archived document.

Module

The defined alias for the protocol information may be found in the column Module, which helps you to identify, which DocumentRouter instance was archiving the document.

Client

The column Client contains the DR ip causing the protocol entry.

Node

You may find the name of the server on which the DocumentRouter instance is running on in the column Node

Operation

The operation that had been tried by the DocumentRouter instance against the archive may be found in the column Operation

Start Time

The column Start Time contains the date and time, when the operation was started.

End Time

You’ll find the date and time when the operation finished in the column End Time.

Status

The column status contains the HTTP code which had been returned by the archiving or linking system during the process.

For further information to the KGS Protocol Writer plugin please consult KGS Protocol Writer Plugin .

Logging

The tia® Document Router logs into several files:

  • global logging using KGS Logger Plugin (Logger.txt)

  • instance logging

DR global logging using KGS Logger Plugin

The DR is logging like any other KGS OSGi bundle using the KGS Logger Plugin.

The general configuration of it can be found using the UI by clicking
OSGi → Configuration → KGS File Logger.

Beside log file location and name, other settings can be set. For further description of this plugin please consult: KGS Logger Plugin

The configuration of the plugin contains details about where an how to log. The log level has to be set inside the global DocumentRouter configuration:
OSGi → Configuration → Global DocumentRouter Configuration

(info) Please Consider that other KGS plugins do log into that file file as well.

DR instance logging

Every KGS DocumentRouter instance has its own log file. This can be configured inside DocumentRouter instance inside common tab.

Relevant for logging are the follwing fields:

  • LogDirectory (where the log files will be stored)

  • LogFilename (how the log file base name is)

  • Debug (log level 0..4 while 4 means debug and 0 none)

  • KeepLogfileDays (for log file rotation)

Further information about the fields can be found in DR4 - Tab - Common

Mail support

About

The DR is capable to inform email recipients on several events. This section explains how this feature is working and which configuration items exists.

Content

Introduction

Since DR 3.1.32 the DR has not anymore its own SMTP implementation. It uses an KGS common approach, now. This approach is realized by the usage of the KGS SMTP Connector .

Configuration

In order to use it, we need to choose the instances configured in SMTP Connector plugin by configuring a comma separated list of KGS SMTP Connector instances.

see:

How it works

In KGS SMPT connector plugin you can configure instances. Every instance contains beside the SMTP credentials topics and email recipients. I will call it a tupel.

The DR configures to which of this tupels it will propagate all of its events.

So we need to configure these:

  • configure an recipient list and the topics to be covered in KGS SMTP Plugin as an instance

  • configure the DR so, that it sends its events to this SMTP instance

You may configure several such KGS SMPT plugin instances with different recipient groups and topic. In this case you need to propagate the DR plugin events to all of these KGS SMPT plugin instances.

Events

The DR is producing some events. E.g. if the has happen an SAP error. These events are mapped to topics. The event is a topic. It is a one by one relation. Ergo every event is send to its own topic.

Topics

The DR is producing these topics:

Topic name

Description

ArcDocIDRegExError

If document id doesn’t match given regualar expression
(see DR instance common tab)

ArchiveError

In case an error occured during the archiving stage, this topic will be triggered.

BarcodeNotFound

In case your scenario expects barcodes and none was found, this topic will be triggered and DocumentRouter will create an email which will be sent to everyone defined in instances dealing with that issue.

CompExists

This topic will be called in case a component already exists during the document processing. See DR instance tab common: CheckHash

CompExistsHashError

In case there has been a mismatch between the expected hash value and the actual received hash, this topic will be triggered.

See DR instance tab common: CheckHash

CompExistsNoHash

This topic will be triggered in case no hash value could be found for an existing component.

See DR instance tab common: CheckHash

DocumentDirectoryAccess

In case DocumentRouter can not access the defined Document Directory this topic will be triggered and (if instances exist, which deal with that topic) mails will be sent informing the users or mail boxes about this issue.

DirNotification

In case the number of documents within the Failure direcotry surpasses the defined amount this topic it will be triggered and the users or mail boxes defined in the instances dealing with that issue will be informed by an email.

FilesizeRestricted

In case you restricted your scenario to certain file sizes (e.g.: Not processing and archiving zero-Byte files) and a file which matches with that restriction appears, an email will be sent to every SMTP instance dealing with that restriction.

GeneralError

For error codes not covered by others.

InvalidIndex

If an invalid index file has been provided, this topic will be triggered and emails will be send.

InvalidLicense

If an DR instance is started and the license is invalid / expired.

NoImageFile

When DocumentRouter couldn’t find an image file (document references in index file), this topic will be triggered.

SAPError

In case an error appeared during the communication with the SAP system, this topic will be triggered.

SAPErrObjNotFound

Belongs to SAP remote function (ZKGS_NOE_ARCHIV_CONNECTION_INS). If SAP-Object does not exist, SAP will throw an exception while SAP linkining

VolumeMark

In case the number of processed documents surpasses the defined percentage value, DocumentRouter will generate a warning email and send it to every user or mailbox defined by instances dealing with that issue.

Related Articles and Links

Multi-Part Request

Content

Overview

The multipart interface can accept multipart messages (https://www.w3.org/Protocols/rfc1341/7_2_Multipart.html ) with files for a configured and started DocumentRouterInstance.

Each part is saved as a file using the filename from the Content-Disposition header. An index file is created according its schema definition. Each Part is handled individually.

It is possible that some parts can be saved and other parts are rejected for multiple reasons.

The files are archived directly (synchrone). They are temporarily stored in a temp folder, which is deleted after request is handled.

Interface

URL

<Protocol>://<domain>:<Port>/<DocumentRouterPath>/documentrouter?CREATE&instanceName=<Name of the running instance>

Example

https://localhost:8080/KGSAdmin-DR/documentrouter?CREATE&instanceName=FI_I1

Required-Header

Content-Type: multipart/form-data; boundary=<Boundary>

Content-Length: <size of the request>

Host: <HostValue>

Body

--<Boundary>
Content-Disposition: form-data; name="file1"; filename="<filename>"
Content-Type: <contentType>
Content-Length: <Length>
X-index-<Key>: <Value>
Content-Transfer-Encoding: binary

<Content>
--<Boundary>--

X-index-<key> Header

The X-index-<Key> headers are used to build the idx file. Any number of headers per part is allowed. Make sure that X-Index header fields do have all keys required by schema file (field position > 0)

A special order of the fields is not required.

Example:

X-index-repository: FI

X-index-filename: firstDocument.pdf

X-index-document: acg678he

lowercase

content of idx file:

acg678he;firstDocument.pdf;FI

The idx files contains only the values.

(warning) field names in Content-Disposition header can’t be changed.

Example for Postman

You can use this sample with postman:

Example 2 for Postman

URI

HTTP POST http://localhost:8090/KGSAdmin-DR-4.0.7/documentrouter?CREATE&instanceName=IndexFileBased

Headers

Content-Type: multipart/form-data; boundary=0kao5EFK-fUENGjSjSlfk3DnForlirbP4

Body

--0kao5EFK-fUENGjSjSlfk3DnForlirbP4
Content-Disposition: form-data;  name="file1"; fileName="fileone.pdf"
Content-Type: application/pdf
Content-Length: 3
X-index-ImageFileName: fileone.pdf
X-index-repository: FI
x-index-SAP_OBJECT_ID: 100019000000002021
Content-Transfer-Encoding: binary

abc
--0kao5EFK-fUENGjSjSlfk3DnForlirbP4
Content-Disposition: form-data;  name="file2"; fileName="filetwo.pdf"
Content-Type: application/pdf
Content-Length: 3
X-index-repository: FI
X-index-ImageFileName: filetwo.pdf
x-index-SAP_OBJECT_ID: 100019000000002021
Content-Transfer-Encoding: binary

abc
--0kao5EFK-fUENGjSjSlfk3DnForlirbP4--

Cache Directory and config

Multipart request can contain files of any size. All files bigger than a certain value will be saved in the cache directory and deleted after processing in: <Instance WorkDirectory>/multipartcache. Make sure that the DocumentRouter has read and write permissions. In certain scenarios it could make sense to change the cache size to prevent to many files in memory and a possible out of memory exception. Configure the default value in bytes in the Instance Config in “Common”-Tab:

When the file exceeds this value it is not stored in memory but saved in the cache directory.

Possible Return Codes

Status Code

Message

Description

500

e.g.:

"can't handle multipart message"

"request is not a multipart message"

Show a general exception. No file is saved. Possible reasons are a not parsable message or the request is not a multipart message.

409 Conflict

 [{
        "statuscode": <errorCode>,
        "message": <error Message>,
        "filename": <Filename that could not be processed>
 }]

This error indicates that no or only a part of the received files are successfully saved. In the body a JSON Array is returned with detailed error code, description, and the filename. Each error has one entry is in the array.

Possible status codes are:

409 - object id already exists

500 - can’t create or write document or idx-file

201 (Created)

-

The files that are send are successfully processed.

Response Bodies

201

[
    {
        "statuscode": 201,
        "message": ""
    },
    {
        "statuscode": 201,
        "message": ""
    }
]

400

 

503

{
    "statuscode": 503,
    "message": "DR instance IndexFileBased not running."
}

  • No labels