User Tools

Site Tools


implementation:wms:app_config

10. Application configurations

10.1. General parameters

Logging level
The logging level defines the amount of logging done by the application. Each event that can be logged has a priority. The logging level defines which events will be added to the log file.

Logging levels listed in order of increasing amount of information logged:

  • OFF
  • FATAL
  • ERROR
  • WARN
  • INFO
  • DEBUG
  • ALL

Add-On Loader

Fat Client

ScaleCommService

Notification Listener

10.2. Add-On

The configuration file of the add-on loader will be used. The configuration file for the add-on loader application is located in the folder of the Add-On Loader, for examlpe: C:\Program Files(x86)\SAP\SAP Business One\AddOns\PMX\Produmex AddOnLoader 7
The file name is Produmex.Foundation.Sbo.AddOnLoader.exe.config

TransactionIsolation
Defines the isolation level. For more information please see: IsolationLevelEnumeration
Default value: ReadCommitted

TransactionTimeout
Sets the wait time before terminating the attempt to commit the transaction. The value is in hour:minute:second format.
Default value: 00:10:00

CommandTimeout
Sets the wait time before terminating the attempt to execute an SQL command and generating an error. The value is in seconds.
Default value: 30

NumberOfRetriesDeadlock
Specifies the amount of times the application will try to book the same transaction again, when it fails due to specific error types like deadlock, timeout, uncommittable transaction or -2038 SBO error code.
Default value: 3

LogDocumentAsXML
If set to true, data sent to the SAP DI API to generate documents will be exported to the log file in xml format.
Default value: false

In order to export documents to the log file, the ’INFO’ level logging is required. Change all ’WARN’ levels to ’INFO’ in the configuration file.

10.3. Fat Client

The configuration file for the fat client application is located in the installation folder of the fat client, for example: C:\Program Files (x86)\Produmex\Produmex Fat Client
The file name is Produmex.Sbo.Logex.Execute.FatClient.exe.config

TransactionIsolation
Defines the isolation level. For more information please see: IsolationLevelEnumeration
Default value: ReadCommitted

TransactionTimeout
Sets the wait time before terminating the attempt to commit the transaction. The value is in hour:minute:second format.
Default value: 00:10:00

CommandTimeout
Sets the wait time before terminating the attempt to execute an SQL command and generating an error. The value is in seconds.
Default value: 30

NumberOfRetriesDeadlock
Specifies the amount of times the application will try to book the same transaction again, when it fails due to specific error types like deadlock, timeout, uncommittable transaction or -2038 SBO error code.
Default value: 3

LogDocumentAsXML
If set to true, data sent to the SAP DI API to generate documents will be exported to the log file in xml format.
Default value: false

In order to export documents to the log file, the ’INFO’ level logging is required. Change all ’WARN’ levels to ’INFO’ in the configuration file.

Produmex.ScriptAssembliesPath
Specifies the path to the script assemblies.
Default path: C:\Produmex\ScriptAssemblies\

Produmex.TempSAPReportPath
Specifies the path to the folder where reports that are retrieved from SAP Business One directly, are stored temporary during the printing.
Default path: C:\Produmex\Reports\TempSAPReports\

Produmex.Error.BackColor
Determines the background color of the error messages. For the supported values please see: Color.FromName Method (String)
Default value: DarkOrange

Produmex.Message.BackColor
Determines the background color of the information messages. For the supported values please see: Color.FromName Method (String)
Default value: WhiteSmoke

Produmex.Screen.Menu.BackColor
Determines the menu background color. For the supported values please see: Color.FromName Method (String)
Default value: LightSteelBlue

Produmex.DI_API.Language
Defines the DI API language.
Supported values: language codes (You can find the language codes in the OLNG table).
Default value: EN

Produmex.Barcode.UseAltModeForBarcode
Defines whether Produmex reads scanned barcode digits as they were keyed in ALT mode or not. Set this option to true if the ALT mode is enabled on the scanning device.
Default value: false

Produmex.Barcode.ParseCode128AsGS1
If set to ‘True’, every Code 128 barcode will be parsed as a GS1-128 barcode.
Default value: false

Produmex.Grid.NavigationByPage
Defines the grid navigation type.
If set to True, the list/grid will navigate by page.
If set to False, the list/grid will navigate by element.

Produmex.Screen.IEnterItemQuantityCombinedScreen.MaxNumberOfButtons
Specifies the maximum number of the component buttons on the ‘Enter the quantity disassembled’ screen in the Disassembly-weight flow. If there are more components than the value set, component buttons will be displayed on multiple screens. Left and right buttons will be added for navigation.

Supported values: n*n, n*(n+1), n*(n+2) where n=positive integer
Default value: 49 (7*7)

10.4. ScaleComm Service

The configuration file for the ScaleComm service is located in the installation folder of the ScaleComm service, for example: C:\Program Files (x86)\Produmex\ProdumexScaneComm
The file name is Produmex.Sbo.Logex.ScaleComm.Service.exe.config

TransactionIsolation
Defines the isolation level. For more information please see: IsolationLevelEnumeration
Default value: ReadCommitted

TransactionTimeout
Sets the wait time before terminating the attempt to commit the transaction. The value is in hour:minute:second format.
Default value: 00:10:00

Mode
Specifies the communication mode of the ScaleComm Service. Possible values:

  • SBO: Obsolete communication mode. Scales will be identified based on the InstanceID.
  • WSBO: New communication mode. Scales will be identified based on the ScalesCodes. In order to use Produmex Weigh, the mode must be WSBO.

Default value = WSBO

Instance ID
The instance ID of the scale defined in the Scale definition (PMX_SCLD) table. Please note: The Instance ID will only be taken into account if the Mode is ‘SBO’.
Default value = Instance 1

ScalesCodes
The scale code defined in the Produmex Organizational Structure. To add multiple scales, separate the scale codes by comma.

Skip Polling
Specifies whether to automatically fill the Scale weight result UDT with the measured weight.

Default value = False

Please note: When using the SBO mode, the Scale weight result UDT will not be filled regardless of this setting.
The values saved in the Scale weight result UDT are not used in the standard Produmex WMS processes. However these values can be used to easily integrate the Produmex WMS scale integration to other systems. (You can find an integration example with PDC here.)

Polling Interval
Defines the polling frequency. The value is in milliseconds.
Default value = 1500

10.5. Notification Listener Tool

The configuration file for the Notification Listener tool is located in the installation folder of the Notification Listener, for example: C:\Program Files (x86)\Produmex\Produmex SB1 Notification Listener (SboConnectionString)
The file name is Produmex.Foundation.SboNotification.ServiceHost.exe.config

TransactionIsolation
Defines the isolation level. For more information please see: IsolationLevelEnumeration
Default value: ReadCommitted

TransactionTimeout
Sets the wait time before terminating the attempt to commit the transaction. The value is in hour:minute:second format.
Default value: 00:10:00

FrequencyMiliseconds
Defines the run frequency of the Notification Listener tool. The value is in milliseconds.
Default value: 5000

10.6. How to configure logging into database in the config file

This document describes how to set additional logging into a database/schema by modifying the configuration file.

It is possible to insert the logs into an UDT in the given database or into a manually created table in a separate database.

10.6.1. Logging into an UDT

10.6.1.1. Create UDT

First create the user defined table in SAP Business One.

In this example we added a PMX_LOG user table.

Then add the following fields to the user table:

field name field type field structure length
Date Date/Time Date -
Thread Alphanumeric Text -
Level Alphanumeric Regular 50
Logger Alphanumeric Text -
Message Alphanumeric Text -
Exception Alphanumeric Text -
DomainName Alphanumeric Regular 50
UserName Alphanumeric Regular 50
SessionName Alphanumeric Regular 50

10.6.1.2. Modify config file

10.6.1.2.1. Trigger Ado Net Appender

In order to trigger the Ado Net Appender, add the following to the root tag:

<appender-ref ref="AdoNetAppender" />

If there is no logging level defined in the root tag, then the logging level is the minimum logging level set for the AdoNetAppender.

If there is a logging level defined in the root tag, then that logging level is used regardless of the minimum logging level set for the AdoNetAppender.

10.6.1.2.2. Edit appender tag

Then insert the following before the <root> tag:

MSSQL

<appender name="AdoNetAppender" type="log4net.Appender.AdoNetAppender">
	<filter type="log4net.Filter.LevelRangeFilter">
		<levelMin value="DEBUG" />
		<levelMax value="FATAL" />
	</filter>
	<bufferSize value="100" />
	<connectionType value="System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
	<connectionString value="data source=server;initial catalog=database;integrated security=false; persist security info=True;User ID=user;Password=password" />
	<commandText value="NSERT INTO &quot;@PMX_LOG&quot; (&quot;Code&quot;,&quot;Name&quot;,&quot;U_Date&quot;,&quot;U_Thread&quot;,&quot;U_Level&quot;,&quot;U_Logger&quot;,&quot;U_Message&quot;,&quot;U_Exception&quot;,&quot;U_DomainName&quot;,&quot;U_UserName&quot;,&quot;U_SessionName&quot;) SELECT  NEWID(), NEWID(), @log_date, @thread, @log_level, @logger, @message, @exception,@DomainName,@UserName,@SessionName" />
	<parameter>
		<parameterName value="@log_date" />
		<dbType value="DateTime" />
		<layout type="log4net.Layout.RawTimeStampLayout" />
	</parameter>
	<parameter>
		<parameterName value="@thread" />
		<dbType value="String" />
		<size value="4000" />
		<layout type="log4net.Layout.PatternLayout">
			<conversionPattern value="%thread" />
		</layout>
	</parameter>
	<parameter>
		<parameterName value="@log_level" />
		<dbType value="String" />
		<size value="50" />
		<layout type="log4net.Layout.PatternLayout">
			<conversionPattern value="%level" />
		</layout>
	</parameter>
	<parameter>
		<parameterName value="@logger" />
		<dbType value="String" />
		<size value="4000" />
		<layout type="log4net.Layout.PatternLayout">
			<conversionPattern value="%logger" />
		</layout>
	</parameter>
	<parameter>
		<parameterName value="@message" />
		<dbType value="String" />
		<size value="64000" />
		<layout type="log4net.Layout.PatternLayout">
			<conversionPattern value="%message" />
		</layout>
	</parameter>
	<parameter>
		<parameterName value="@exception" />
		<dbType value="String" />
		<size value="64000" />
		<layout type="log4net.Layout.ExceptionLayout" />
	</parameter>
	<parameter>
		<parameterName value="@DomainName" />
		<dbType value="String" />
		<size value="50" />
		<layout type="log4net.Layout.PatternLayout">
			<conversionPattern value="${USERDOMAIN}" />
		</layout>
	</parameter>
	<parameter>
		<parameterName value="@UserName" />
		<dbType value="String" />
		<size value="50" />
		<layout type="log4net.Layout.PatternLayout">
			<conversionPattern value="${USERNAME}" />
		</layout>
	</parameter>
	<parameter>
		<parameterName value="@SessionName" />
		<dbType value="String" />
		<size value="50" />
		<layout type="log4net.Layout.PatternLayout">
			<conversionPattern value="${SESSIONNAME}" />
		</layout>
	</parameter>
</appender>

HANA

<appender name="AdoNetAppender" type="log4net.Appender.AdoNetAppender">
<bufferSize value="100" />
<connectionType value="System.Data.Odbc.OdbcConnection, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<connectionString value="Driver=driver;SERVERNODE=server address:port number;CURRENTSCHEMA=schema;UID=user;PWD=password;" />
<commandText value="INSERT INTO &quot;@PMX_LOG&quot; SELECT SYSUUID, SYSUUID, ?, ?, ?, ?, ?, ?, ?, ?, ? FROM DUMMY" />
	<parameter>
		<parameterName value="@log_date" />
		<dbType value="DateTime" />
		<layout type="log4net.Layout.RawTimeStampLayout" />
	</parameter>
	<parameter>
		<parameterName value="@thread" />
		<dbType value="String" />
		<size value="4000" />
		<layout type="log4net.Layout.PatternLayout">
			<conversionPattern value="%thread" />
		</layout>
	</parameter>
	<parameter>
		<parameterName value="@log_level" />
		<dbType value="String" />
		<size value="50" />
		<layout type="log4net.Layout.PatternLayout">
			<conversionPattern value="%level" />
		</layout>
	</parameter>
	<parameter>
		<parameterName value="@logger" />
		<dbType value="String" />
		<size value="4000" />
		<layout type="log4net.Layout.PatternLayout">
			<conversionPattern value="%logger" />
		</layout>
	</parameter>
	<parameter>
		<parameterName value="@message" />
		<dbType value="String" />
		<size value="64000" />
		<layout type="log4net.Layout.PatternLayout">
			<conversionPattern value="%message" />
		</layout>
	</parameter>
	<parameter>
		<parameterName value="@exception" />
		<dbType value="String" />
		<size value="64000" />
		<layout type="log4net.Layout.ExceptionLayout" />
	</parameter>
	<parameter>
		<parameterName value="@DomainName" />
		<dbType value="String" />
		<size value="50" />
		<layout type="log4net.Layout.PatternLayout">
			<conversionPattern value="${USERDOMAIN}" />
		</layout>
	</parameter>
	<parameter>
		<parameterName value="@UserName" />
		<dbType value="String" />
		<size value="50" />
		<layout type="log4net.Layout.PatternLayout">
			<conversionPattern value="${USERNAME}" />
		</layout>
	</parameter>
	<parameter>
		<parameterName value="@SessionName" />
		<dbType value="String" />
		<size value="50" />
		<layout type="log4net.Layout.PatternLayout">
			<conversionPattern value="${SESSIONNAME}" />
		</layout>
	</parameter>
</appender>
10.6.1.2.3. Adjust the log4net connection string

Adjust the dummy connection string in the log4net part to point to your database/schema.

SQL

<connectionString value="data source=server;initial catalog=database;integrated security=false; persist security info=True;User ID=user;Password=password" /> 

The DATA SOURCE is the server name.
The INITIAL CATALOG is the database where the logging table has been created.
The USER ID is the database user and the PASSWORD is the password of the user.

HANA

<connectionString value="Driver=driver;SERVERNODE=server address:port number;CURRENTSCHEMA=schema;UID=user;PWD=password;" /> 

The DRIVER is {HDBODBC32} on 32 bit environments and {HDBODBC} on 64 bit environments.
The SERVERNODE is the server address and the port number, for example 10.45.74.42:30015.
The CURRENTSCHEMA is the schema where the logging table has been created.
The UID is the database user ID and the PWD is the password of the user.

10.6.2. Logging into a separate database

10.6.2.1. Create the log table

First create a new database/schema for the log table. Then run the following query on the database/schema:

MSSQL

CREATE TABLE [dbo].[PMX_log] (
[Id] [int] IDENTITY (1, 1) NOT NULL,
[Date] [datetime] NOT NULL,
[Thread] [varchar] (4000) NOT NULL,
[Level] [varchar] (50) NOT NULL,
[Logger] [varchar] (4000) NOT NULL,
[Message] [varchar] (64000) NOT NULL,
[Exception] [varchar] (64000) NULL,
[DomainName] [varchar] (50) NULL,
[UserName] [varchar] (50) NULL,
[SessionName] [varchar] (50) NULL)

Where the PMX_log is the name of the table where the log entries will be inserted.

HANA

CREATE TABLE "schema"."PMX_log " (
    "Date" datetime NOT NULL,
    "Thread" varchar (4000) NOT NULL,
    "Level" varchar (50) NOT NULL,
    "Logger" varchar (4000) NOT NULL,
    "Message" varchar (64000) NOT NULL,
    "Exception" varchar (64000) NULL,
    "DomainName" varchar (50) NULL,
    "UserName" varchar (50) NULL,
    "SessionName" varchar (50) NULL
)

Where the schema is the new schema and the PMX_log is the name of the table where the log entries will be inserted.

10.6.2.2. Modify config file

10.6.2.2.1. Edit appender tag

Insert the following before the <root> tag:

<appender name="AdoNetAppender" type="log4net.Appender.AdoNetAppender">
	<filter type="log4net.Filter.LevelRangeFilter">
		<levelMin value="DEBUG" />
		<levelMax value="FATAL" />
	</filter>
	<bufferSize value="100" />
	<connectionType value="System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
	<connectionString value="data source=server;initial catalog=extra_database;integrated security=false; persist security info=True;User ID=user;Password=password" />
	<commandText value="INSERT INTO &quot;PMX_Log&quot; (&quot;Date&quot;,&quot;Thread&quot;,&quot;Level&quot;,&quot;Logger&quot;,&quot;Message&quot;,&quot;Exception&quot;,&quot;DomainName&quot;,&quot;UserName&quot;,&quot;SessionName&quot;) VALUES (@log_date, @thread, @log_level, @logger, @message, @exception,@DomainName,@UserName,@SessionName)" />
	<parameter>
		<parameterName value="@log_date" />
		<dbType value="DateTime" />
		<layout type="log4net.Layout.RawTimeStampLayout" />
	</parameter>
	<parameter>
		<parameterName value="@thread" />
		<dbType value="String" />
		<size value="4000" />
		<layout type="log4net.Layout.PatternLayout">
			<conversionPattern value="%thread" />
		</layout>
	</parameter>
	<parameter>
		<parameterName value="@log_level" />
		<dbType value="String" />
		<size value="50" />
		<layout type="log4net.Layout.PatternLayout">
			<conversionPattern value="%level" />
		</layout>
	</parameter>
	<parameter>
		<parameterName value="@logger" />
		<dbType value="String" />
		<size value="4000" />
		<layout type="log4net.Layout.PatternLayout">
			<conversionPattern value="%logger" />
		</layout>
	</parameter>
	<parameter>
		<parameterName value="@message" />
		<dbType value="String" />
		<size value="64000" />
		<layout type="log4net.Layout.PatternLayout">
			<conversionPattern value="%message" />
		</layout>
	</parameter>
	<parameter>
		<parameterName value="@exception" />
		<dbType value="String" />
		<size value="64000" />
		<layout type="log4net.Layout.ExceptionLayout" />
	</parameter>
	<parameter>
		<parameterName value="@DomainName" />
		<dbType value="String" />
		<size value="50" />
		<layout type="log4net.Layout.PatternLayout">
			<conversionPattern value="${USERDOMAIN}" />
		</layout>
	</parameter>
	<parameter>
		<parameterName value="@UserName" />
		<dbType value="String" />
		<size value="50" />
		<layout type="log4net.Layout.PatternLayout">
			<conversionPattern value="${USERNAME}" />
		</layout>
	</parameter>
	<parameter>
		<parameterName value="@SessionName" />
		<dbType value="String" />
		<size value="50" />
		<layout type="log4net.Layout.PatternLayout">
			<conversionPattern value="${SESSIONNAME}" />
		</layout>
	</parameter>
</appender>

HANA

<appender name="AdoNetAppender" type="log4net.Appender.AdoNetAppender">
<bufferSize value="100" />
<connectionType value="System.Data.Odbc.OdbcConnection, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<connectionString value="Driver=driver;SERVERNODE=server address:port number;CURRENTSCHEMA=extra_schema;UID=user;PWD=password;" />
<commandText value="INSERT INTO &quot;PMX_Log&quot;  VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)" />
	<parameter>
		<parameterName value="@log_date" />
		<dbType value="DateTime" />
		<layout type="log4net.Layout.RawTimeStampLayout" />
	</parameter>
	<parameter>
		<parameterName value="@thread" />
		<dbType value="String" />
		<size value="4000" />
		<layout type="log4net.Layout.PatternLayout">
			<conversionPattern value="%thread" />
		</layout>
	</parameter>
	<parameter>
		<parameterName value="@log_level" />
		<dbType value="String" />
		<size value="50" />
		<layout type="log4net.Layout.PatternLayout">
			<conversionPattern value="%level" />
		</layout>
	</parameter>
	<parameter>
		<parameterName value="@logger" />
		<dbType value="String" />
		<size value="4000" />
		<layout type="log4net.Layout.PatternLayout">
			<conversionPattern value="%logger" />
		</layout>
	</parameter>
	<parameter>
		<parameterName value="@message" />
		<dbType value="String" />
		<size value="64000" />
		<layout type="log4net.Layout.PatternLayout">
			<conversionPattern value="%message" />
		</layout>
	</parameter>
	<parameter>
		<parameterName value="@exception" />
		<dbType value="String" />
		<size value="64000" />
		<layout type="log4net.Layout.ExceptionLayout" />
	</parameter>
	<parameter>
		<parameterName value="@DomainName" />
		<dbType value="String" />
		<size value="50" />
		<layout type="log4net.Layout.PatternLayout">
			<conversionPattern value="${USERDOMAIN}" />
		</layout>
	</parameter>
	<parameter>
		<parameterName value="@UserName" />
		<dbType value="String" />
		<size value="50" />
		<layout type="log4net.Layout.PatternLayout">
			<conversionPattern value="${USERNAME}" />
		</layout>
	</parameter>
	<parameter>
		<parameterName value="@SessionName" />
		<dbType value="String" />
		<size value="50" />
		<layout type="log4net.Layout.PatternLayout">
			<conversionPattern value="${SESSIONNAME}" />
		</layout>
	</parameter>
</appender>
10.6.2.2.2. Trigger Ado Net Appender

Please see: 10.6.1.2.1. Trigger Ado Net Appender

10.6.2.2.3. Adjust the log4net connection string

Adjust the dummy connection string in the log4net part to point to the extra database/schema where the created log table is located.

SQL

 <connectionString value="data source=server;initial catalog=extra_database;integrated security=false; persist security info=True;User ID=user;Password=password" />

The DATA SOURCE is the server name.
The INITIAL CATALOG is the new database where the log table is located.
The USER ID is the database user and the PASSWORD is the password of the user.

HANA

 <connectionString value="Driver=driver;SERVERNODE=server address:port number;CURRENTSCHEMA=extra_schema;UID=user;PWD=password;" /> 

The DRIVER is {HDBODBC32} on 32 bit environments and {HDBODBC} on 64 bit environments.
The SERVERNODE is the server address and the port number, for example 10.45.74.42:30015.
The CURRENTSCHEMA is the new schema where the log table is located.
The UID is the databse user ID and the PWD is the password of the user.

implementation/wms/app_config.txt · Last modified: 2018/03/26 09:17 by csuhaa