EI User Guide
EI User Guide
User Guide
Version 6.2
September, 2021
aveva.com
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved.
No part of this documentation shall be reproduced, stored in a retrieval system, or transmitted by any means,
electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of AVEVA.
No liability is assumed with respect to the use of the information contained herein.
Although precaution has been taken in the preparation of this documentation, AVEVA assumes no responsibility
for errors or omissions. The information in this documentation is subject to change without notice and does not
represent a commitment on the part of AVEVA. The software described in this documentation is furnished under
a license agreement. This software may be used or copied only in accordance with the terms of such license
agreement.
ArchestrA, Avantis, Citect, DYNSIM, eDNA, EYESIM, InBatch, InduSoft, InStep, IntelaTrac, InTouch, OASyS,
PIPEPHASE, PRiSM, PRO/II, PROVISION, ROMeo, SIM4ME, SimCentral, SimSci, Skelta, SmartGlance, Spiral
Software, WindowMaker, WindowViewer, and Wonderware are trademarks of AVEVA and/or its subsidiaries. An
extensive listing of AVEVA trademarks can be found at: https://sw.aveva.com/legal. All other brands may be
trademarks of their respective owners.
Publication date: Saturday, September 25, 2021
Contact Information
AVEVA Group plc
High Cross
Madingley Road
Cambridge
CB3 0HB. UK
https://sw.aveva.com/
For information on how to contact sales and customer training, see https://sw.aveva.com/contact.
For information on how to contact technical support, see https://sw.aveva.com/support.
To access the AVEVA Knowledge and Support center, visit https://softwaresupport.aveva.com.
Contents
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 3
Chapter 5 Managing Message Types ................................................................ 22
Viewing Message Types ...................................................................................................................... 23
Message Type Actions and Privileges Required .................................................................................... 23
Filtering Message Types ...................................................................................................................... 24
Adding a Message Type ....................................................................................................................... 24
Editing a Message Type ....................................................................................................................... 25
Deleting a Message Type ..................................................................................................................... 25
Summary Expressions ......................................................................................................................... 25
Summary Expressions for XML Message Types ......................................................................................... 25
Summary Expressions for Flat File Message Types .................................................................................... 26
Summary Expressions for CSV, Pipe-Delimited, and Tab-Delimited Message Types................................. 26
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 4
Type MESJobEnd ........................................................................................................................................ 39
Type MESShiftEnd ...................................................................................................................................... 40
Type MESTable ........................................................................................................................................... 41
Type MSMQ ................................................................................................................................................ 42
Type SQLQuery ........................................................................................................................................... 43
Working with Outbound Location Types .............................................................................................. 44
Type CODE .................................................................................................................................................. 44
Type FOLDER .............................................................................................................................................. 45
Type MESTable ........................................................................................................................................... 46
Type MSMQ ................................................................................................................................................ 48
Type SQLQuery ........................................................................................................................................... 48
Transfer Destinations .......................................................................................................................... 49
Adding Transfer Destination Locations ...................................................................................................... 49
Editing a Transfer Destination Location's Transforms ............................................................................... 50
Editing Transfer Destination Locations ...................................................................................................... 52
Deleting Transfer Destination Locations .................................................................................................... 53
Mappings ........................................................................................................................................... 53
Location Type Mappings ............................................................................................................................ 53
Delimited Text Source ............................................................................................................................ 53
XML Attribute-Based Source .................................................................................................................. 54
XML Element-Based Source .................................................................................................................... 54
Database Table Source ........................................................................................................................... 54
Flat Source .............................................................................................................................................. 54
MES Table Source ................................................................................................................................... 55
Delimited Text Destination ..................................................................................................................... 55
XML Attribute-Based Destination ........................................................................................................... 55
XML Element-Based Destination ............................................................................................................ 56
Text Template Destination ..................................................................................................................... 56
Adding Mappings........................................................................................................................................ 57
Editing Mappings ........................................................................................................................................ 57
Deleting Mappings ..................................................................................................................................... 59
Helper Functions ........................................................................................................................................ 59
Post Actions ........................................................................................................................................ 62
Adding Post Actions.................................................................................................................................... 63
Post Action Type Properties ................................................................................................................... 64
Editing Post Actions .................................................................................................................................... 66
Deleting Post Actions ................................................................................................................................. 66
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 5
Chapter 12 Application Configuration .............................................................. 76
Application Configuration Actions and Privileges Required................................................................... 76
Viewing Plant Configuration Data ........................................................................................................ 77
Editing Plant Configuration Parameter Values...................................................................................... 77
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 6
IMessageTransform ............................................................................................................................ 93
IMessageAbortTransfer ....................................................................................................................... 93
IMessageProcessor ............................................................................................................................. 94
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 7
Chapter 1
Getting Started
The Enterprise Integration (EI) application is a scalable, configurable product that provides a loosely-coupled
linkage between the manufacturing system and business systems such as ERP, PLM, SCM, or LIMS. EI facilitates
the exchange of information between disparate systems and software via messages that are buffered and
tracked to provide a seamless and reliable interface. This interface comprises adapters that provide any
endpoint specific transformations, database processing, and internal processing causing secondary message
generation.
This guide describes the EI user interface for defining message groups, types, categories source and destination
locations, and the transfer requirements that enable the transport of messages from the source location to the
specified destination location. Details are provided for mapping source and destination locations as well as
configuring post-actions to execute based on the processing status of outbound locations.
This guide also describes how to attach custom plug-ins to message locations or to transfer requirements
between message locations. The plug-in provides extended message processing functionality to an EI adapter.
Finally, this guide describes the application program interface (API) needed to implement a custom EI plug-in.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 8
AVEVA™ Enterprise Integration User Guide
Chapter 1 – Getting Started
From this page, you can navigate to all other pages using the navigation menu at the top left, as shown below.
To return to the Overview page, click the icon at the upper left corner of any page.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 9
AVEVA™ Enterprise Integration User Guide
Chapter 1 – Getting Started
On most details pages, you can return to the listing page by clicking the Listing button on the page's toolbar.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 10
AVEVA™ Enterprise Integration User Guide
Chapter 1 – Getting Started
Filtering Lists
Many of the pages with lists have filter boxes above the list grid that allow you to filter the list to see only
entries of interest.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 11
Chapter 2
Managing Security
The EI website uses Windows authentication to allow access to the system. Security groups can be created, to
which Windows Active Directory (AD) users and groups can be associated, as well as specific application
privileges.
All users who require access to the application must be defined in the Windows AD and assigned to an EI
security group.
Initial Security Groups
By default, when EI is first installed, the following security groups are defined.
View
Users in this group can view all pages.
Admin
Users in this group can perform all possible actions (all privileges) in the EI website.
Privileges
The EI system has the following privileges that can be assigned to security groups. These privileges allow for
different access within the EI system.
PortalBase_View
Can view pages.
PortalBase_Security_Config
Can create, modify, and manage security groups and users.
PortalBase_AppSettings_Config
Can create and modify plant configuration settings.
WEI_MessageService_Config
Can create and modify Message Services.
WEI_Message_Send
Can send paused messages to external systems.
WEI_Message_Modify
Can archive, modify, and re-process messages.
WEI_Location_Modify
Can create, modify, and disable message locations.
WEI_Location_ChangeStatus
Can turn locations On and Off.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 12
AVEVA™ Enterprise Integration User Guide
Chapter 2 – Managing Security
WEI_General_Config
Can add or modify location groups (systems), message types, and message categories.
Action Privileges
Add PortalBase_Security_Config
Delete PortalBase_Security_Config
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 13
AVEVA™ Enterprise Integration User Guide
Chapter 2 – Managing Security
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 14
AVEVA™ Enterprise Integration User Guide
Chapter 2 – Managing Security
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 15
Chapter 3
Any number of location types can be added. Each location type includes details about the Send-Receive Class
that will be used to process the message that is associated with a particular location.
Actions Privileges
Add WEI_General_Config
Edit WEI_General_Config
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 16
AVEVA™ Enterprise Integration User Guide
Chapter 3 – Managing Location Types
Actions Privileges
Delete WEI_General_Config
Update WEI_General_Config
Refresh PortalBase_View
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 17
AVEVA™ Enterprise Integration User Guide
Chapter 3 – Managing Location Types
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 18
Chapter 4
Location groups are used to associate message locations with each other. Any number of location groups can be
added.
Actions Privileges
Add WEI_General_Config
Edit WEI_General_Config
Delete WEI_General_Config
Update WEI_General_Config
Refresh PortalBase_View
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 19
AVEVA™ Enterprise Integration User Guide
Chapter 4 – Managing Location Groups
Location Group Id
Filter for groups with an ID matching any part of the entry in this box.
Description
Filter for groups with a description matching any part of the entry in this box
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 20
AVEVA™ Enterprise Integration User Guide
Chapter 4 – Managing Location Groups
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 21
Chapter 5
Message types are used to categorize different formats of messages being processed. Also, in some cases, a
message type is used to determine how EI should react with the messages. For example, message type
properties can be used to specify that message content be appended to XML or CSV type messages.
The Manage Message Types page, shown below, lists each message type that you have defined. Each message
type created is first defined by two parameters: Data Type and Has Header Row. The following basic Data Types
are available: CSV, FLAT, PIPE, TABBED, and XML. Has Header Row is set to True or False and is used only for
CSV, PIPE, and TABBED data types.
The details and summary expression of each message type can also be viewed and edited. The summary
expression associated with each message type is used to extract information from within the message structure.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 22
AVEVA™ Enterprise Integration User Guide
Chapter 5 – Managing Message Types
Cheese|3|lb
Pepperoni|100|each
Tab-Delimited Data Type
Tab-delimited data files contain data in table-structured format that is tab-delimited:
Material Quantity Unit
Dough 10 lb
Cheese 3 lb
Pepperoni 100 each
Actions Privileges
Edit WEI_General_Config
Delete WEI_General_Config
Save WEI_General_Config
Refresh PortalBase_View
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 23
AVEVA™ Enterprise Integration User Guide
Chapter 5 – Managing Message Types
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 24
AVEVA™ Enterprise Integration User Guide
Chapter 5 – Managing Message Types
Summary Expression
Used to extract important data from a Message Structure. This property is dependent on the Data Type and
Has Header Row properties.
o If Data Type is XML, an XLT expression is entered here.
o If Data Type is FLAT, CSV, Tab Delimited, or Pipe Delimited, a simple text file format is entered.
For more information, see Summary Expressions on page 25.
3. Click Save.
4. To create another message type while you are still on the message type details page, click Create New.
Summary Expressions
Summary expressions are optional but can be used to extract key information from the file or message being
processed to display it in a message listing and on the details of particular messages. For example, an expression
could be written to extract the work order number, item to produce, and entity to run on from an XML file of
work orders. This allows the key information to be clearly visible when troubleshooting which work order files
were processed successfully versus those that might have failed due to an error.
The following topics describe how summary expressions are written for each of the message types.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 25
AVEVA™ Enterprise Integration User Guide
Chapter 5 – Managing Message Types
WO:0012848831, Mat:12029940
Any valid XSLT expression can be used to extract and combine textual summaries that EI will display. The details
and range of functionality for the XSLT language are outside of the scope of this document.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 26
Chapter 6
Location categories provide another level of filtering when viewing messages and when managing locations. In
addition, they add a setting that controls whether users can turn any of the locations in a given category on or
off.
Action Privileges
Add WEI_General_Config
Edit WEI_General_Config
Delete WEI_General_Config
Update WEI_General_Config
Refresh PortalBase_View
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 27
AVEVA™ Enterprise Integration User Guide
Chapter 6 – Managing Location Categories
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 28
AVEVA™ Enterprise Integration User Guide
Chapter 6 – Managing Location Categories
The Description, Display Position, and Allow Status User Toggle columns become available for editing.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 29
Chapter 7
Message services allow users to control the status of each service and the amount of time between executions
of the service.
Action Privileges
Edit WEI_Processor_Config
Save WEI_Processor_Config
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 30
AVEVA™ Enterprise Integration User Guide
Chapter 7 – Managing Message Services
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 31
Chapter 8
Message locations provide a means of triggering an EI Service instance to act on something and pass that data
along to another type of location for further processing. In EI, message locations behave differently based on
their direction (Inbound or Outbound) and the location type they use (Folder, MSMQ, MESJobEnd, etc.).
Locations can be used to monitor file folders to pick up files and send their content to custom plug-in code
(CODE), where custom logic can process it further. Examples include importing complex production orders into
MES, executing a SQL query to obtain production summaries and create files from the SQL results, and importing
data into a Manufacturing Execution System (MES) table. Possible operations are described in Working with
Inbound Location Types on page 37 and Working with Outbound Location Types on page 44.
Action Privileges
Edit WEI_Location_Modify
Delete WEI_Location_Modify
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 32
AVEVA™ Enterprise Integration User Guide
Chapter 8 – Managing Message Locations
Action Privileges
Save WEI_Location_Modify
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 33
AVEVA™ Enterprise Integration User Guide
Chapter 8 – Managing Message Locations
Note: Message locations can also be hidden so they do not show in the user interface. This setting is currently
only available through the database by updating the Hidden column of the MessageLocation table.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 34
AVEVA™ Enterprise Integration User Guide
Chapter 8 – Managing Message Locations
Location Id
Required. A unique ID for the message location.
Direction
Used to define if a message location is an inbound (IN) or outbound (OUT) location.
– An IN location is one for which messages are received and entered into the EI system.
– An OUT location is one from which messages already in the EI system are sent to a destination (for
example, a folder on disk) by the message service.
Location Type
Required. The behavior of the location. Both Direction and Location Type define what the location does
when processed by the associated EI service.
See Working with Inbound Location Types on page 37, Working with Outbound Location Types on page
44, and Managing Location Types on page 16.
Processing Priority
An integer value that specifies the priority (0 = highest) for this location. The EI message service
processes locations with higher priorities first. Locations with the same priorities are processed in a
round robin fashion.
Grouping
Grouping properties allow a location to be grouped with other similar message locations. The groupings
section serves as a means of categorizing locations by a user-defined type (with implied data type) to
represent the message structures contained within a user-defined category and user-defined group. The EI
service instance designated to process the location is also configured in this section.
Message Service
Required. Defines which message service will run the message location.
The entry is populated by the message services defined on the Manage Message Services page.
EI_Default is the default service created during the installation configuration.
Message Type
Required. A user-defined message type with an implied Data Type, such as XML, FLAT, CSV,
Tab-Delimited, or Pipe-Delimited.
For CSV, Tab-Delimited, and Pipe-Delimited, the message type also indicates whether the message
contents contain a header row.
Message Category
Required. Defines with which Message Category the message location is associated.
The entry is populated by the Message Categories defined on the Manage Message Categories page.
Group
Required. Is used to group message locations (e.g., SAP).
Populated by the location groups defined on the Manage Message Location Group page.
Configuration
Configuration properties allow you to control the service’s retry and batch sizes and how many days to keep
history within EI on this location.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 35
AVEVA™ Enterprise Integration User Guide
Chapter 8 – Managing Message Locations
Retry Limit
The number of retries allowed before an error is logged.
Retry Delay (ms)
The time (in milliseconds) between each retry after a failure to receive a message from this location or
to send a message to this location.
Current Retries
Read-only property showing the current retry state (or 0) for the location. Applies only when the service
is running.
Purge After (days)
The number of days that must pass before a message location’s history is purged from the database. For
example, 365 would indicate keeping 365 days of history and purging history entries older than that.
Batch Size
Required. The number of files to be processed at one time from this location. This is only applicable for
Inbound locations.
Context
The properties that appear here vary based on the Direction and Location Type entries.
For information about these properties, see the location type topics in Working with Inbound Location Types
on page 37 and Working with Outbound Location Types on page 44. Also see Managing Location Types on
page 16.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 36
AVEVA™ Enterprise Integration User Guide
Chapter 8 – Managing Message Locations
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 37
AVEVA™ Enterprise Integration User Guide
Chapter 8 – Managing Message Locations
Time Interval
The location is processed daily between a start and end time. When EI detects that the current time falls
within the start and end times, it will process for each Interval Seconds configured. For example: Process
the location between 8 am to 10 am daily and verify every 3600 interval seconds.
Type CODE
Note: Code locations require a professional license to use them.
Code locations are used to call custom EI plug-ins. The inbound plug-in must implement the ReceiveMessage of
IMessageSendReceive. These locations can be used for any custom processing and should return a result set to
be stored into MessageHub upon successful processing. The result set can then be further processed by
outbound locations.
On the Message Location Details page, the following Context properties are available for these location types.
Assembly
The fully qualified assembly name containing a class that implements ReceiveMessage.
Class
The fully qualified class name (AssemblyName.ClassName) containing the implementation of
ReceiveMessage.
Is Scheduled, Type of Schedule
See Schedules for Inbound Locations on page 37.
Type DIRECT
Direct locations are intended as placeholder-type locations. That is, defining a Direct location does not cause any
processing to occur but is intended as a placeholder to allow for tying in transfer destinations to pass data along
to a downstream, outbound location.
Direct locations expect an external system to populate data for them in MessageHub. An example of a direct
location could be an external warehousing system that periodically collects new stock and sends those stock
records to EI by inserting them directly into the EI MessageHub SQL table. The stock records could then be
passed to an outbound CODE plug-in for further processing.
On the Message Location Details page, the following Context properties are available for these location types.
Assembly
The fully qualified assembly name containing a class that implements ReceiveMessage.
Class
The fully qualified class name (AssemblyName.ClassName) containing the implementation of
ReceiveMessage.
Is Scheduled, Type of Schedule
See Schedules for Inbound Locations on page 37.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 38
AVEVA™ Enterprise Integration User Guide
Chapter 8 – Managing Message Locations
Type FOLDER
Inbound Folder locations are used to monitor a folder for specific file types and to take those files and store
their content into MessageHub where they can then be transferred to an outbound location for further
processing.
When EI detects a file matching the search criteria, it removes that file from the folder and stores its content in
MessageHub. When configuring Folder locations, it is important to pick a message type that uses the same file
format so that summary expressions can be tied to all Folder locations within that message type grouping. For
example, Folders with a Label Format of *.XML should use message types with a data type of XML.
On the Message Location Details page, the following Context properties are available for these location types.
URI
Specifies a folder or network share where the service can access files. For example: F:\Data\WorkOrders.
Label Format
Identifies what files to look for.
Wildcards can be used. For example: *.xml or *.txt.
Is Scheduled, Type of Schedule
See Schedules for Inbound Locations on page 37.
Type MESJobEnd
The MESJobEnd location type uses a polling system to monitor when jobs on MES entities end. If a job has ended
(that is, has the status Complete), a query or stored procedure is triggered to run. This location relies on the MES
middleware to obtain a connection to the MES database. It also relies on user credentials provided in the EI
service’s config file.
EI exposes certain parameters that can be used by the query or stored procedure to gather pertinent
information regarding the job that just ended. These parameters are:
@ent_id
The entity ID on which a job just ended.
@last_wo_id
The work order ID of the job that just ended on the entity.
@last_oper_id
The operation ID of the job that just ended on the entity.
@last_seq_no
Sequential number of the job that just ended on this entity.
@job_pos
The job position on this entity for the job that just ended.
@user_id
ID of the user who ended the job.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 39
AVEVA™ Enterprise Integration User Guide
Chapter 8 – Managing Message Locations
It is important to note that EI stores a last executed UTC date/time for each entity being monitored. Each time
the service wakes up (or the configured schedule time has occurred), it queries the MES Job table for each entity
being monitored. If completed jobs have been found since the last wake-up time, EI loads the available
@parameters and executes the associated query or stored procedure. The last executed UTC date/time is
updated to indicate the last time slice verified in the MES Job table even when no job activity has been detected.
This trigger type runs on a polling system and will pick up any job end records each time it checks. This means
that linked jobs will get picked up on the polling once they are marked Complete. Using linked jobs in MES will
not enforce an order of operation.
Note: There is a potential for querying larger amounts of job data from the MES if the EI service is off for
extended periods or the location has been off or disabled for a long period of time. This is because EI must
internally query the MES for job activity since the last executed UTC date/time. If needed, the location’s
properties should be edited to reduce the <LastExecuteUTCDateTime>. These properties can be found in the
MessageLocationProperty table.
On the Message Location Details page, the following Context properties are available for these location types.
Entity to Monitor
Lists all entities being monitored for job end activity.
Clicking the Add Entity button displays a list of entities to choose from that can run jobs.
SQL or SP
A SQL query or stored procedure that will be executed on the MES database and accessible through the MES
middleware configuration.
The query (or stored procedure) can make use of the dynamic parameters indicated above. For example: get
all item_prod records produced by @ent_id when running @last_wo_id, @last_oper_id and @last_seq_no.
Is Scheduled, Type of Schedule
See Schedules for Inbound Locations on page 37.
Type MESShiftEnd
The MESShiftEnd location type is used to monitor shifts on MES entities and trigger a query or stored procedure
to run each time a shift has ended. This location relies on the MES middleware to obtain a connection to the
MES database. It also relies on user credentials provided in the EI service config file.
EI exposes certain parameters that can be used by the query or stored procedure to gather pertinent
information regarding the shift that just ended. These parameters are:
@ent_id
The entity ID on which a shift change occurred.
@last_shift_start_time
The UTC start time of the shift that just ended on the entity.
@last_shift_id
The ID of the shift that just ended on the entity.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 40
AVEVA™ Enterprise Integration User Guide
Chapter 8 – Managing Message Locations
It is important to note that EI stores a last executed UTC date/time for each entity being monitored. Each time
the service wakes up (or the configured schedule time has occurred), it queries the MES Shift_History table for
each entity being monitored. If completed shifts have been found since the last wake-up time, EI loads the
available @parameters and executes the associated query or stored procedure. The last executed UTC date/time
is updated to indicate the last time slice verified in the MES Shift_History table even when no shift activity has
been detected.
Note: There is a potential for querying larger amounts of shift data from the MES database if the EI service is off
for extended periods or the location has been off or disabled for a long period of time. This is because EI must
internally query the MES for shift activity since the last executed UTC date/time. If needed, the location’s
properties should be edited to reduce the <LastExecuteUTCDateTime>. These properties can be found in the
MessageLocationProperty table.
On the Message Location Details page, the following Context properties are available for these location types.
Entity to Monitor
Lists all entities being monitored for shift end activity.
Clicking the Add Entity button displays a list of entities to choose from that can schedule shifts and any child
entities that could inherit a schedule from a parent entity.
SQL or SP
A SQL query or stored procedure that will be executed on the MES database and accessible through the MES
middleware configuration.
The query (or stored procedure) can make use of the dynamic parameters indicated above. For example: get
all item_prod records produced by @ent_id within the start/end date/times of @last_shift_id.
Is Scheduled, Type of Schedule
See Schedules for Inbound Locations on page 37.
Type MESTable
The inbound MESTable location type can be used to export table data from an MES database. The data to be
exported can be gathered by a query, stored procedure, or an MES API GetAll middleware call.
If the chosen method returns one or more rows, then the contents of that result set are stored in MessageHub
and available for downstream outbound message locations. As an alternative, the primary query, stored
procedure, or middleware call can be used as the trigger and a secondary query, stored procedure, or
middleware call used as the results to store in MessageHub. In either case, the executed query must return one
or more rows to trigger the location.
When using a middleware call, a list of MES tables is provided to select from and the table’s associated MES API
GetAll parameters are exposed. Basic filtering is also possible by using one or more of the parameters. If one or
more filters are provided, they are passed to the associated GetAll and executed through the middleware.
Note that this location relies on the MES middleware to obtain a connection to the MES database. It also relies
on user credentials provided in the EI service config file.
On the Message Location Details page, the following Context properties are available for these location types.
Primary MES Type
Allows for configuring SQL (query or stored procedure) or MES middleware.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 41
AVEVA™ Enterprise Integration User Guide
Chapter 8 – Managing Message Locations
Use the results from the Primary SQL to pass to the destination location(s)
Selected by default. If selected, indicates that the results from the primary will be used as both the trigger
and the results to store in MessageHub. If not selected, the Secondary MES In Type properties appear.
Secondary MES In Type
If Use the results from the Primary SQL option is not selected, the secondary MES In Type can be used as
the data to store in MessageHub.
Query/SP
Appears if SQL is selected in the Primary MES In Type or Secondary MES In Type list.
Allows for entering a SQL query or stored procedure to be executed against the MES database for gathering
data to export.
To test the query or stored procedure entered here, click the Test button.
Table
Appears if Middleware is selected in the Primary MES In Type or Secondary MES In Type list.
Provides a list of all MES API classes containing a GetAll() method. The classes listed relate to a specific MES
table such as the Ent (entity) or Attr (attribute) table.
Parameters
Populates when Middleware is selected as the In Type and an MES API class is selected in the Table list.
The list of parameters provided by the GetAll() method selected. Basic filters can be provided and their
filtering functionality conforms to the specific GetAll() method.
Example: Backflush = 1 on table BOM Items would return all BOM items set to Backflush in the ERP.
Is Scheduled, Type of Schedule
See Schedules for Inbound Locations on page 37.
Type MSMQ
MSMQ locations are intended to work with Microsoft Message Queuing where EI can read messages from an
accessible queue and store the contents of that message in MessageHub for further downstream processing.
Typically, the queues accessed are Private queues but Public queues would also work.
On the Message Location Details page, the following Context properties are available for these location types.
Queue
The name of the MSMQ to monitor using Microsoft Direct Format Name Syntax.
For example, monitoring a queue called EIInboundOrders:
DIRECT=OS:.\PRIVATE$\EIInboundOrders DIRECT=OS:WOServer\PRIVATE$\EIInboundOrders
DIRECT=TCP:157.18.3.1\PRIVATE$\EIInboundOrders
Is Scheduled, Type of Schedule
See Schedules for Inbound Locations on page 37.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 42
AVEVA™ Enterprise Integration User Guide
Chapter 8 – Managing Message Locations
Type SQLQuery
SQLQuery locations are intended for running a query or stored procedure on a Microsoft SQL Server database to
gather data to store in MessageHub and pass onto an outbound location. An example of this type of location
could be to query inventory on a remote proprietary database based on certain conditions (in a where clause)
and to pass that data to an outbound location for further processing.
The SQLQuery location’s context contains a Primary and optional Secondary query or stored procedure and
requires a Schedule configuration to limit how often the query or stored procedure is executed on the remote
database. EI will trigger the location to run if the primary query returns one or more rows and will use the
results of that query as the data to pass to outbound (destination) locations. If the query or stored procedure
returns 0 rows, then the location will not trigger.
The Secondary query or stored procedure can be used as the data pump (instead of the Primary) to pass data to
one or more outbound locations. For example, use the Primary to determine if the location should trigger and
use the Secondary as the data to collect and pass to an outbound location for processing.
Note: The account used in the connection strings should be set up with restricted security access to the
database to which EI is being connected. EI relies on SQL security to prevent malicious intent such as dropping
tables or databases. There is no restriction to what DML statements can be executed on the SQL database and
therefore these situations need to be prevented via security. If using Integrated Security for the SQL connection,
make sure that the EI service user account has permissions to execute the statements.
On the Message Location Details page, the following Context properties are available for these location types.
Primary SQL
Connection
An encrypted connection defined in the Connection Listing page.
To test the connection entered here, click Test.
Query/SP
A valid SQL query or stored procedure name.
To test the query or stored procedure, click Test. The results of the executed SQL are displayed in a
separate window.
Use the results from the Primary SQL to pass to the destination location(s)
If selected, use the results from the Primary SQL to pass to the destination locations. By default, this check
box is selected.
When selected, the Primary SQL is used as both the trigger and the data to pass to destination locations.
When cleared, the Primary SQL is used as the trigger and the data from the Secondary SQL is used to pass to
destination locations. The Secondary SQL properties are defined in the following property description.
If the Primary SQL returned rows, then use this SQL to pass data to the destination location(s)
Connection String
An encrypted connection is defined on the Connection Listing page.
To test the connection entered here, click the Test button.
Query/SP
A valid secondary SQL query or stored procedure name.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 43
AVEVA™ Enterprise Integration User Guide
Chapter 8 – Managing Message Locations
To test the query or stored procedure entered here, click the Test button. The results of the executed
SQL will be displayed in a separate window.
Is Scheduled, Type of Schedule
Required. See Schedules for Inbound Locations on page 37.
Type CODE
Note: Code locations require a professional license to use them.
CODE locations are used to call custom EI plug-ins. The outbound plug-in must implement the SendMessage of
IMessageSendReceive. These locations can be used for any custom type of processing.
On the Message Location Details page, the following Context properties are available for these location types.
Assembly
The fully qualified assembly name containing a class that implements ReceiveMessage.
Class
The fully qualified class name (AssemblyName.ClassName) containing the implementation of
ReceiveMessage.
PreSend Assembly
Optional. If used, both the pre-send assembly and class must be specified.
The fully qualified assembly name containing a class that implements IMessagePreSend.
Common use would be to modify the content (body of the message) or its label before a message is
processed.
PreSend Class
Optional. If used, both the pre-send assembly and class must be specified.
The fully qualified class name (AssemblyName.ClassName) containing the implementation of
IMessagePreSend.
Common use would be to modify the content (body of the message) or its label before a message is
processed.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 44
AVEVA™ Enterprise Integration User Guide
Chapter 8 – Managing Message Locations
Type FOLDER
Outbound Folder locations are used to store the contents of an inbound location’s MessageHub body to a file.
By default, the location creates new, unique files every time a message transfer moves data from an inbound
location to the outbound location.
Outbound Folder locations can be configured to create new files, overwrite files, append to existing files, or
simply return an error if the file exists. When configuring outbound Folder locations, it is important to select a
message type that uses the same file format not only for summary expressions but it becomes necessary for
using file append functionality.
When appending message content to a file, EI uses the message type Data Type to determine how to process an
append operation. For example, a Data Type of XML will tell EI to expect an XML structure and to take all of the
contents of that XML message except for the root node and append that to an existing file. Similarly, a Data Type
of CSV will tell EI to append the full content of the file. Or, if the message type was defined as CSV with a header
row, then EI would take the second row onward for its append operation.
On the Message Location Details page, the following Context properties are available for these location types.
URI
Specifies a folder or network share where the service can access files. For example: F:\Data\WorkOrders.
Label Format
Identifies either the file extension when using File Option – Create Unique or a specific file name when using
any of the other File Options.
For example: *.xml or *.txt, or Orders.csv.
PreSend Assembly
Optional. If used, both the pre-send assembly and class must be specified.
The fully qualified assembly name containing a class that implements IMessagePreSend.
Common use would be to modify the content (body of the message) or its label before a message is
processed
PreSend Class
Optional. If used, both the pre-send assembly and class must be specified.
The fully qualified class name (AssemblyName.ClassName) containing the implementation of
IMessagePreSend.
Common use would be to modify the content (body of the message) or its label before a message is
processed.
File Options
Create Unique
Creates a unique file with an extension as provided by Label Format and stores this file at the location
specified in the URI.
Files will be unique even when re-processing the same message. EI will append a unique number to the
file as Orders_1.xml or Orders_56.xml.
Overwrite
EI overwrites the file with file name = Label Format at the location specified in the URI.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 45
AVEVA™ Enterprise Integration User Guide
Chapter 8 – Managing Message Locations
This location expects a valid file name to be entered in the Label Format field. Example: Orders.txt.
Append
EI appends the message contents to the file with file name = Label Format at the location specified in
the URI.
This location expects a valid file name to be entered in the Label Format field. Example: Orders.txt.
If Append is selected, there are the following additional options.
– Max File Size (MB): On each append operation, EI will verify the current file size + estimated file size
of the message content to be appended. If the size projected is >= Max File Size, then the If Max
Exceeded rule is executed
– If Max Exceeded: Create New: EI creates a new file using Label Format and appends the current
date/time stamp. Example: Orders20150402091233202.txt (YYYYMMDDHHMMSSms#).
– If Max Exceeded: Log Error: If EI projects that the append operation will exceed the Max File Size,
then an error is logged and nothing is appended to the file.
Return An Error
EI either creates the file with file name = Label Format at the location specified in the URI or returns an
error if the file name already exists.
This location expects a valid file name to be entered in the Label Format field. Example: Orders.txt.
Type MESTable
Outbound MESTable locations are intended for importing data into an MES database using the MES API. These
locations are typically linked via Message Transfer Requirement to an inbound Folder location or SQLQuery
location. The data gathered from the file or query can then be mapped to the parameters of one or more MES
database tables. This location relies on the MES middleware to obtain a connection to the MES database. It also
relies on user credentials provided in the EI service config file.
Several tables are available for selection. Upon selection, the table’s API parameters (Field Names) are
displayed. Bolded Field Names are required and must be mapped or defaulted to a value. Required fields and
some others (depending on API) are displayed with the Included option check box selected, indicating that the
content fields need to be mapped to them. Other fields are optional but do require a default value, which EI
provides (e.g., Backflush = 0 on BOM items). Selecting the Included check box will cause these fields to require a
mapping.
EI uses the If Row Exists options to determine what actions to take if the data already exists in the MES
database. The If Row Exists functionality is dependent on the table selected and the table’s alternate key.
It is important to note that when importing data from a mapped data source (Folder or SQLQuery), EI will import
each source row into the associated MES database table and track the overall success of that batch operation.
That overall success is what determines the location’s MessageHub Status when viewing from the Message
Listing and Detail.
For example, when importing 10 rows into Table Attribute:
Message Status = Success if all 10 rows were imported without error.
Message Status = Partial Success if 5 rows imported without error and 5 rows existed already and the If Row
Exists option was set to Treat as Error.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 46
AVEVA™ Enterprise Integration User Guide
Chapter 8 – Managing Message Locations
Message Status = Error on fatal errors or all 10 rows existed already and the If Row Exists option was set to
Treat as Error.
EI uses the Message Transfer Requirement’s Exec Seq No parameter to determine the order to import data into
tables when mapping a single file or query to multiple outbound MESTable locations. It is important to sequence
each of these outbound MESTable locations in the proper order to satisfy the MES database’s referential
integrity.
On the Message Location Details page, the following Context properties are available for these location types.
Table
Identifies the table in the MES database in which to import the data.
If Row Exists
Options that determine what to do if the data being imported already exists in the MES database.
Ignore
EI queries the table based on the selected table’s key. If the row already exists, then EI does nothing.
Otherwise, the row is added.
Update
EI queries the table based on the selected table’s key. If the row already exists, then EI updates it.
Otherwise, the row is added.
Treat As Error
EI queries the table based on the selected table’s key. If the row already exists, the message status
potentially goes to Partial Success. Otherwise, the row is added.
Delete
EI queries the table based on the selected table’s key. If the row already exists, it is deleted.
Ignore and Treat as Success
Ignore the imported data and display the status as success (provided all rows are successful).
Parameters
The columns of the parameter table are described below. For information about the parameters associated
with MES API methods, see the Wonderware MES Stateless API Reference help.
Field Name
A list of all parameters associated to the table. These are not necessarily table columns but a
combination of those and the associated API calls to perform Add, Update, or Delete functionality.
Included
When selected, indicates that the Field will be found in the imported data. Fields with the Included
option check box selected require the user to map the source location to these Fields. Mappings are
created after the outbound MESTable has been saved. For more information, see Mappings on page 53.
Default
A default value can be entered that will then be used as the value for that Field when EI makes MES API
calls.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 47
AVEVA™ Enterprise Integration User Guide
Chapter 8 – Managing Message Locations
Type MSMQ
MSMQ locations are intended to work with Microsoft Message Queuing where EI can write messages to an
accessible queue. Typically, the queues accessed are Private queues but Public queues can also be used,
provided the necessary security access has been considered.
On the Message Location Details page, the following Context properties are available for these location types.
Queue
The name of the MSMQ to monitor using Microsoft Direct Format Name Syntax.
For example, monitoring a queue called ProductionData:
DIRECT=OS:.\PRIVATE$\ProductionData DIRECT=OS:WOServer\PRIVATE$\ProductionData
DIRECT=TCP:157.18.3.1\PRIVATE$\ProductionData
PreSend Assembly
Optional. If used, both the pre-send assembly and class must be specified.
The fully qualified assembly name containing a class that implements IMessagePreSend.
A common use would be to modify the content (body of the message) or its label before a message is
processed.
PreSend Class
Optional. If used, both the pre-send assembly and class must be specified.
The fully qualified class name (AssemblyName.ClassName) containing the implementation of
IMessagePreSend.
A common use would be to modify the content (body of the message) or its label before a message is
processed.
Type SQLQuery
Outbound SQLQuery locations are intended for running a query or stored procedure on a SQL Server database.
An example of this type of location is executing a stored procedure on a production database after instructions
are received from the inbound location.
Note: The account used in the connection strings should be set up with restricted security access to the
database to which EI is being connected. EI relies on SQL security to prevent malicious activity such as dropping
tables or databases. There is no restriction to what DML statements can be executed on the SQL database and
therefore these situations need to be prevented via security. If using Integrated Security for the SQL connection,
make sure that the EI service user account has permissions to execute the statements.
On the Message Location Details page, the following Context properties are available for these location types.
Connection
An encrypted connection defined in the Connection Listing page
To test the connection entered here, click the Test button.
Query/SP
A valid SQL query or stored procedure name.
To test the query or stored procedure entered here, click the Test button. The results of the executed SQL
are displayed in a separate window.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 48
AVEVA™ Enterprise Integration User Guide
Chapter 8 – Managing Message Locations
Execute on Data
Used to set whether the outbound query should be run only once or for every row provided by the inbound
location.
Transfer Destinations
Transfer destinations define the transport or link between a source location (inbound) and a destination location
(outbound). A message transfer requirement can be defined for any inbound location and appears when editing
a location with a direction of IN.
There is no limit to how many outbound destination locations that can be configured against an inbound
location and in some cases (MESTable OUT), the processing sequence can be defined using the Exec Seq No field
to control the sequence of which outbound location processes the message content first.
Transfer destinations can also transform the message before passing it onto a destination location. These
transformations can be configured using XSLT or a plug-in to alter the message body before being processed by
the destination location.
When using plug-ins, a transfer can be aborted based on logic and the contents of the message can be
transformed from one format to another based on custom logic.
It is also possible to configure multiple abort and/or transform operations before a final message structure is
delivered to the destination location.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 49
AVEVA™ Enterprise Integration User Guide
Chapter 8 – Managing Message Locations
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 50
AVEVA™ Enterprise Integration User Guide
Chapter 8 – Managing Message Locations
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 51
AVEVA™ Enterprise Integration User Guide
Chapter 8 – Managing Message Locations
4. Optionally, complete the Abort Transfer properties for the plug-in that will perform abort processing of the
received message before it can be transferred to the specified OUT location.
See IMessageAbortTransfer on page 93 for more information about this type of plug-in class. These
properties can be left blank if there is no abort transfer plug-in configured.
Assembly
The assembly name for the abort transfer class. For example: WW.Messaging.
Class
The class name for the abort transfer class. For example: WW.Messaging.AbortClassName.
5. To save the transform entry with the current property settings, click Save on the page's toolbar.
Once a transform entry has been created, you can perform the following tasks with it from the Transfer
Destination tab.
Transform Order
You can apply multiple transfer operations to a single location. This helps avoid the need to copy code to specific
transfer classes. For example, the system might need to look up a piece of data and apply it to the message. This
has already been defined in a class. For this location, you might also need to modify the format of the message.
By applying two layers of transforms—and controlling the order of operations—you can do both without
modifying code.
To change a transform's order in the grid and thus its order of operation
Select the entry and click the Move Up or Move Down button on the page's toolbar.
Deleting the Transform Entry
To delete the entry
Click its Delete button.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 52
AVEVA™ Enterprise Integration User Guide
Chapter 8 – Managing Message Locations
Mappings
Mappings provide the ability to map a data source such as a file or SQL query result to an outbound MESTable
location. The mapping describes which elements from the source file signify rows and which elements within
those rows map to which parameter in the outbound MESTable’s field list.
The data to be mapped can be XML, CSV, pipe-delimited, or tab-delimited. Text templates are also possible.
Mapping functionality in EI allows messages to be transformed between two destinations: a column in
destination A can be mapped to move to a different name column in destination B. Similarly, with a delimited
text file, a value on index 0 of a file can be mapped to become the value on index 3 of a destination location.
On the Message Location Details page, the Mapping tab in OUT direction locations manages all the mappings
actions. See the figure below for an example of the Mapping tab.
Note that mappings requirements can only be added for locations that are already tied with a Message Transfer
Requirement.
Source Destination
0
1
5
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 53
AVEVA™ Enterprise Integration User Guide
Chapter 8 – Managing Message Locations
Source Destination
can_run_jobs
description
can_capture_util
Source Destination
can_run_jobs
description
can_capture_util
Source Destination
col_1
col_2
col_3
Flat Source
The source file for this mapping is a flat file.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 54
AVEVA™ Enterprise Integration User Guide
Chapter 8 – Managing Message Locations
Mapping entries for this type need to have a source value that should be a pair of numerical values separated by
a comma. The first value is the index (zero-based) of where the system should start reading in the source file.
The second value is the number of characters that the system should read after the index. See the table below
for an example.
Source Destination
0,10
60,20
90,11
Source Destination
can_run_jobs
description
can_capture_util
Source Destination
1
2
3
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 55
AVEVA™ Enterprise Integration User Guide
Chapter 8 – Managing Message Locations
Source Destination
can_run_jobs
description
can_capture_util
Source Destination
can_run_jobs
description
can_capture_util
Source Destination
0 item_id
1 item_type
2 location_name
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 56
AVEVA™ Enterprise Integration User Guide
Chapter 8 – Managing Message Locations
Adding Mappings
Mappings can only be added for locations that are already tied with a Message Transfer Requirement.
1. On the Mapping tab on the Message Location Details page, click the Add button to the right of the grid.
Editing Mappings
1. On the Mapping tab grid on the Message Location Details page, click the Mapping Details button of the
mapping to be edited.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 57
AVEVA™ Enterprise Integration User Guide
Chapter 8 – Managing Message Locations
2. Change any source or destination option values, as needed, and add, edit, or delete any number of mapping
entries.
The mappings details are described below.
Delimiter Character
Read-only. Displays the delimiter character in the delimited text file to be used in this mapping, based on the
locations-configured message type.
Has Header Row
Determines whether the delimited text file involved has a header row.
Template Format
The template to be used in the flat file used in this mapping.
This template format will be applied to each record in the source input.
The template’s keywords to be substituted need to be enclosed in double percentage signs as shown below.
%%keyword%%
For example:
Material is: %%item_id%%, Item Type is:
%%item_type%%, currently Item is located in:
%%location_name%%
XML Element To Contain Rows
The name of the XML element that will represent a row of data.
XML Header
The header, if any, of the XML file used in this mapping.
Mapping Entry
Represents a single mapping entry. It is formed by a Source Column/Index/Element/Attribute, a Destination
Column/Index/Element/Attribute, and a Translation ID if any. For more information about translations, see
Managing Translations on page 68.
3. To save the changes, click Save.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 58
AVEVA™ Enterprise Integration User Guide
Chapter 8 – Managing Message Locations
Deleting Mappings
1. On the Mapping tab grid on the Message Location Details page, click the Delete button of the mapping to
be deleted.
2. On the confirmation prompt, click OK.
Helper Functions
When Source Location is either XML Attribute-Based Source or XML Element-Based Source and output is MES
Table Destination to update data, there might be Helper Functions available to identify target rows.
When a Helper Function is available, a button appears in the ID column of the table:
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 59
AVEVA™ Enterprise Integration User Guide
Chapter 8 – Managing Message Locations
Entering the name of a template XML file placed in the server directory …/EI/Config/, the data-bearing
attributes and elements are displayed for selection to resolve the desired row key. (Values must resolve to
unique rows within the MESTable.)
Data elements from the XML template can be dragged to the appropriate parameters for the Helper Function.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 60
AVEVA™ Enterprise Integration User Guide
Chapter 8 – Managing Message Locations
Once selected, the parameters are displayed in the Mapping Entries panel.
When the Source Location Type is MESTable and the Output Type is XML Attribute-Based or XML
Element-Based, Helper Functions allow the selection of row data from tables where a Helper Function is
available.
Clicking the Add Format Mapping button displays a new Mapping Entry Row. Clicking the Helper Function
button displays the Helper Options panel, where a Helper and source column can be selected.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 61
AVEVA™ Enterprise Integration User Guide
Chapter 8 – Managing Message Locations
Columns are selected by dragging the desired column to the mapping input.
Once a column has been selected, a label is applied, which will appear in the Destination XML.
Upon closing the Helper Options panel, the Mapping Entries panel displays the output label and indicates the
source as the table key with the Helper Function button, indicating a Helper Function was used.
Post Actions
Post actions can be used to act on the process message status result of an outbound location. A post action can
be used to simply email a distribution list, informing recipients that a message failed. Or it can chain another
inbound location to run depending upon success or failure. Post actions can typically be defined on two different
message status results:
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 62
AVEVA™ Enterprise Integration User Guide
Chapter 8 – Managing Message Locations
Success
Error
When the outbound location has a type of MESTable, then a third status is available to which to tie post actions:
Partial Success
Partial Success occurs when a batch operation of insert/updates or deletes was partially processed successfully
but certain rows in the batch of records were marked as errors due to how the location was configured. For
example: If Row Exists = Treat as Error.
Note that post action requirements can only be added for locations that are already tied with a Message
Transfer Requirement.
To add post actions
1. Click the Edit button of the source location and status pair that will trigger the post action (i.e., the success
status or the error status).
The Post Action Details page appears.
2. Click Add.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 63
AVEVA™ Enterprise Integration User Guide
Chapter 8 – Managing Message Locations
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 64
AVEVA™ Enterprise Integration User Guide
Chapter 8 – Managing Message Locations
Body
The text to include in the email body.
Include Message Body
When this option is selected, EI will send the message body of the processed message as content in the
email body. For example, this can be used to send the contents of a file that failed to process.
Copy to Folder
The Copy to Folder post action can be used to copy the message body to a file folder or network share.
The following property is available to this post action type.
File Path
A file folder or network share accessible by the EI service. The folder must also have Write permission
enabled for the service to create files.
Execute EXE
The Execute EXE post action can be used to run an executable depending on the status outcome of the location
being processed. The executable must not expose a UI and cannot expect user input.
The following context fields are available to this post action type.
Path
A file folder or network share accessible by the EI service.
File
A valid executable file to execute.
Note: Executables that provide a user interface, such as NotePad.exe or any executable expecting user
input, will not work. EI services are not expected to interact with the desktop, and desktop interaction for
Microsoft services in general is being deprecated by Microsoft in future Windows releases.
Context Parameters
Optional context parameters (command line parameters) to pass to the executable file. For example: 123,
"Order".
SQL Query
Depending on the status outcome of the location being processed, the SQL Query post action can be used to
trigger a query.
Connection
An encrypted connection defined on the Connection Listing page.
To test the connection entered here, click the Test button.
Query/SP
A valid SQL query or stored procedure name.
To test the query or stored procedure entered here, click the Test button. The results of the executed SQL
are displayed in a separate window.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 65
AVEVA™ Enterprise Integration User Guide
Chapter 8 – Managing Message Locations
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 66
AVEVA™ Enterprise Integration User Guide
Chapter 8 – Managing Message Locations
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 67
Chapter 9
Managing Translations
The EI Translations functionality is tightly coupled with the Mappings functionality. Translations allows the
contents of a message to be manipulated and values within messages to be substituted.
To open the Translations Listing page
On the Configuration menu, click Messaging Configuration and then click Translations.
3. To add a translation entry, click the Add Entry button above the grid.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 68
AVEVA™ Enterprise Integration User Guide
Chapter 9 – Managing Translations
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 69
AVEVA™ Enterprise Integration User Guide
Chapter 9 – Managing Translations
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 70
Chapter 10
The Distribution Lists functionality of EI is tightly coupled with the Post Actions functionality. It offers a means of
managing groups of email addresses as a single unit. Email distribution lists offer a way of reusing lists of
from/to/SMTP server addresses for repetitive references in post action configurations. For example, an email
distribution list can be defined for Production Planners to send emails based on the success or failure of
importing SAP control recipes into MES or lists of quality personnel for sending the results of held product
awaiting inspection.
To open the Distribution List Listing page
On the Configuration menu, click Messaging Configuration and then click Distribution Lists.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 71
AVEVA™ Enterprise Integration User Guide
Chapter 10 – Managing Distribution Lists
Description
Description of the distribution list.
SMTP Server
SMTP server to be used for sending the emails.
From Address
From Address to be used for sending the emails. The From Address does not have to be a real email address
and is used solely for identifying the sender.
For example: [email protected].
To Address
Address or addresses that will belong to this distribution list. Multiple addresses must be separated by a
semi-colon (;).
3. To create the distribution list, click Save.
To edit a distribution list
1. On the Distribution List Listing page, click the Name link of the distribution list to be edited.
The Distribution List Details page appears.
2. Modify the properties as needed.
3. To save the changes, click Save.
To delete a distribution list
1. On the Distribution List Listing page, click the Name link of the distribution list to be deleted.
The Distribution List Details page appears.
2. Click Delete.
3. On the confirmation prompt, click OK.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 72
Chapter 11
Managing Connections
The connections functionality of EI allows you to encrypt SQL connection strings. Each connection string is
stored and transported in an encrypted state. The connection details are only decrypted when used. If an error
occurs, only the connection is identified.
To open the Connection Listing page
On the Configuration menu, click Messaging Configuration and then click Connections.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 73
AVEVA™ Enterprise Integration User Guide
Chapter 11 – Managing Connections
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 74
AVEVA™ Enterprise Integration User Guide
Chapter 11 – Managing Connections
If the connection is successful, the Connection Status field changes to green and updates to Connection
Established Successfully.
To edit a connection
1. On the Connection Listing page, click the Name link of the connection to be edited.
The Connection Details page appears.
2. Modify the properties as needed.
3. To save the changes, click Save.
To delete a distribution list
1. On the Connection Listing page, click the Name link of the connection to be deleted.
The Connection Details page appears.
2. Click Delete.
3. On the confirmation prompt, click OK.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 75
Chapter 12
Application Configuration
The Application Configuration feature allows you to manage configuration data for a specific plant and set their
default values.
The configuration data consists of the following event log items only at this time.
Email
If an email distribution list is defined here, EI sends a warning message to the distribution list when a
location is automatically disabled.
EventLog_DaysToKeep
Retention period for event log messages.
MessageHub_PurgeErrors
If set to 1, then errors are purged based upon the associated locations days to keep value.
MES Enabled
Determines if the MES functionality is enabled in EI. By default, this flag is set to 0 (off).
To use MES type locations (MESShiftEnd, MESJobEnd, MESTable), this flag must be set to 1 and the EI
service’s app.config file must also be set.
Use the EI Configurator utility to turn MES functionality on by navigating to the MES Connection and Failure
Behavior tab and configuring the MES user/password, then click Update.
Action Privileges
Edit PortalBase_AppSettings_Config
Update PortalBase_AppSettings_Config
Refresh PortalBase_View
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 76
AVEVA™ Enterprise Integration User Guide
Chapter 12 – Application Configuration
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 77
Chapter 13
Event Log
The Event Log Listing page allows you to view EI sub-systems errors or warnings that have occurred and
recorded in the system event log. In addition, errors and warnings might also be sent to the ArchestrA System
Management Console.
Action Privileges
View PortalBase_View
Refresh PortalBase_View
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 78
AVEVA™ Enterprise Integration User Guide
Chapter 13 – Event Log
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 79
Chapter 14
Message Log
The Message Log feature allows you to view messages received from or sent to external systems (e.g., SAP,
SAM, etc.)
The Message Log page displays all the messages that the EI system has handled and provides details of these
messages.
The Message Log grid displays the message details described below. Depending on the message type, some of
the contextual information described below might not be available.
#
The unique message ID created by the system.
Location Id
The message location ID of the message's location type.
Insert Date Time
The date/time that the message entered or exited the system.
Group
The message group.
Dir.
The message direction:
OUT
Message goes from EI to another system
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 80
AVEVA™ Enterprise Integration User Guide
Chapter 14 – Message Log
IN
Message entering EI from another system
Src #
The unique source message ID created by the system.
Source Location Id
The source message's location ID of the source message's location type.
Message Type
The message type of a given message category.
Summary
Important information from the message. Content is based on the message type.
Status
The message status indicator:
Processing
A message that is currently being processed.
Processed
A message that has successfully entered or exited the system.
Error
There was an error processing the message.
Paused
A message that is held back from leaving the EI system (because its target location is Off).
Archived
A message that has been archived.
Un-Paused
A message that was paused and has been manually selected for re-processing. This state will only exist
temporarily between the user marking it for re-processing and the message processor processing the
message.
Retrying
A message that has caused an error, but the EI system is attempting to process it again.
Status Message
The latest status message for this message.
Buttons Privileges
Refresh Portalbase_View
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 81
AVEVA™ Enterprise Integration User Guide
Chapter 14 – Message Log
Buttons Privileges
Reset Portalbase_View
Re-Process WEI_Message_Modify
Archive WEI_Message_Modify
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 82
AVEVA™ Enterprise Integration User Guide
Chapter 14 – Message Log
Message #
Filter for messages whose ID is within this range. If an incorrect range is given, the Message Log is simply
refreshed.
Status
Filter for messages with the selected status.
Summary
Filter for messages with a summary that matches any part of this entry.
Message Type
Filter for messages of the selected message type.
Category
Filter for messages of the selected category.
Location
Filter for messages whose location match this entry.
Content
Filter for messages with content that matches any part of the entry.
Direction
Filter for messages of the selected direction.
Group
Filter for messages of the selected group.
Re-Processing Messages
You can re-process a single message or a group of messages.
1. On the Message Log page, select the check boxes of the messages listed in the grid to be re-processed.
2. Click the Re-Process button.
3. When prompted by the confirmation message, click OK.
Archiving Messages
You can archive a single message or a group of messages. The corresponding message records in the database
are marked as archived. The archived message records are not deleted from the database. The result of this is
that messages that have been archived will no longer appear in the Message Log unless the search criteria are
set to All or Archived.
1. On the Message Log page, select the check boxes of the messages listed in the grid to be archived.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 83
AVEVA™ Enterprise Integration User Guide
Chapter 14 – Message Log
To select all messages, select the check box at the top left corner of the grid.
2. Click the Archive button.
3. When prompted by the confirmation message, click OK.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 84
Chapter 15
Message Display
On the Message Display page, you can view message details received from or sent to external systems (e.g.,
SAP, SAM, etc.).
Actions Privileges
Refresh Portalbase_View
Listing Portalbase_View
Export WEI_Message_Modify
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 85
AVEVA™ Enterprise Integration User Guide
Chapter 15 – Message Display
Actions Privileges
Re-Process WEI_Message_Modify
Archive WEI_Message_Modify
As text Portalbase_View
As xml Portalbase_View
Save WEI_Message_Modify
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 86
AVEVA™ Enterprise Integration User Guide
Chapter 15 – Message Display
Archiving a Message
Archiving an EI message allows you to remove a message that has been sent and is no longer required. Note that
these steps will mark a record as archived in the database. It does not delete the record from the database.
To archive the current message on the Message Display page
1. Click the Archive button.
2. When prompted by the confirmation message, click OK.
Re-Processing Messages
Any message in the EI system can be re-processed—that is, resent—to its destination if required. For example,
you might want to re-process an error or paused message.
To re-process the current message on the Message Display page
1. Click the Re-Process button to re-process the message.
2. When prompted by the confirmation message, click OK.
Note: Check the Event Log Listing page for more information on errors.
Exporting Messages
To export the current message on the Message Display page
1. Click the Export button.
2. Choose a Destination location.
The message will be exported to the selected location.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 87
AVEVA™ Enterprise Integration User Guide
Chapter 15 – Message Display
To view and edit the message content of the current message on the Message Display page
1. On the toolbar, click the As Text button.
The message appears in plain text in the Message Body box.
2. Optionally, edit the message in the Message Body text box as needed and click SaveMsg.
3. On the toolbar, click the As XML button to view message as XML again.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 88
Chapter 16
The Message Summary by Location Category page lists summaries of various EI messages. The following actions
can be performed:
Turn Off or On a location category.
Send EI messages.
View the message log for each location category.
The Message Summary by Location Category grid displays the number of messages declared and sent to
external systems for each message category. The grid includes the following columns.
Change Status
Buttons for changing the location category status.
o Click On to change the status from Off (manual routing of messages to the destination location) to on
(automatic routing of messages to the destination location).
o Click Off to change the status from On to Off.
Status
Location category status: On (green) or Off (red).
Category
The location category. This can be one of the location categories as described in Managing Location
Categories on page 27.
Processing
Total number of messages currently being processed.
Processed
Total number of messages sent to an external system.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 89
AVEVA™ Enterprise Integration User Guide
Chapter 16 – Message Summary by Location Category
Errored
Total number messages that have failed.
Retrying
Total number of message that are in the retry state.
Paused
Total number of messages that have a status paused.
Created Date/Time
The date and time when the category was created.
Send Paused Messages
Buttons to send a specific number of or all paused messages.
View Messages
Opens the Message Listing page, pre-populated for the message category.
Buttons Privileges
Refresh Portalbase_View
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 90
AVEVA™ Enterprise Integration User Guide
Chapter 16 – Message Summary by Location Category
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 91
Chapter 17
Plug-In Development
A EI system plug-in can be created to implement custom functionality. A EI system user can define plug-in
references throughout the EI application that will execute when a message is processed.
The Plug-in Reference locations and their corresponding interfaces are listed in the following table.
To create a plug-in, the correct API interface must be used. The following topics describe the API interfaces for
the plug-in class types.
IMessageSendReceive
Definition
This interface defines two methods: SendMessage and ReceiveMessage.
Implementation
This interface would be implemented in a plug-in when defining a Send-Receive Class. The fully-resolved class
name can then be entered in the Send-Receive Class field on the Manage Location Types edit page.
By default, three Send-Receive Class plug-ins have been defined for use:
WW.Messaging,WW.Messaging.FolderSendReceive
Used to process XML, flat file, or CSV files. It can receive them from a folder (usually dropped by another
system) or output the message contents to a folder.
o Must define a folder path in the URI field of the message location.
WW.Messaging,WW.Messaging.DotNetClassSendReceive
Used to do in-depth processing of the message contents that require the use of Microsoft.NET classes.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 92
AVEVA™ Enterprise Integration User Guide
Chapter 17 – Plug-In Development
IMessagePreSend
Definition
Defines the method PreSend.
Implementation
This interface would be implemented in a plug-in when defining a PreSend Class. The fully-resolved class name
can then be entered in the PreSend Class field on the Location Details page for the desired message location. A
class that implements this interface can only be used on a message location where the Direction field is set to
OUT.
Common Use
Modifying the content (body of the message) or its label before a message is processed.
IMessageTransform
Definition
Defines the method TransformMessage, which returns a structure of type MessageData.
Implementation
This interface would be implemented in a plug-in when defining a TransformClass. The fully-resolved class name
may then be entered in the Transform Class field of a Transfer Destination Location for a message location.
Common Use
Modifying the status or category before a message is processed.
IMessageAbortTransfer
Definition
Defines the method CheckAbortTransfer.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 93
AVEVA™ Enterprise Integration User Guide
Chapter 17 – Plug-In Development
Implementation
This interface would be implemented in a plug-in when defining an AbortTransferClass. The fully-resolved class
name can then be entered in the Abort Transfer Class field of a Transfer Destination Location for a message
location.
Common Use
When a message is still waiting for crucial information to be updated and cannot be sent out until that data is
received.
IMessageProcessor
Definition
Defines the methods ProcessMessage and GetMessage.
Implementation
This interface would be implemented in a plug-in when defining a MessageProcessorClass. The fully-resolved
class name can then be entered in the URI field on the Message Location page.
Common Use
Only used for message locations with a Location Type Send-Receive Class plug-in defined as a
WW.Messaging.WW.Messaging.DotNetClassSendReceive.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 94
Chapter 18
EI Web Services
EI Message Manager is a web service that provides a message passing mechanism that provides positive
feedback to the remote application that the message was received and stored in the EI database as opposed to
message passing using MSMQ or files. The web service defines one action and that is to add a single message to
a specified location.
User Interface
The web service may be exercised manually by opening the web page at a URL such as
http://<ComputerName>/<EIInstanceName>/MessageManager.asmx
where
<ComputerName> is replaced with the name of the EI server
<EIInstanceName> is replaced with the name of the EI instance that was created using the EI Configurator
utility
For example, if browsing from the EI Server and the default EI instance name was used in the configuration, then
the URL would be http://localhost/EI/MessageManager.asmx and the web page would appear as shown in the
figure below.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 95
AVEVA™ Enterprise Integration User Guide
Chapter 18 – EI Web Services
This web page lists the methods offered by the web service that consists of the AddMessage method. The
method name is a link that can be clicked to display a page, as shown in the figure below, showing the
AddMessage details and a form which can be used to invoke the method to insert a message into EI. In addition,
the Service Description link may be clicked to view the web service definition (WSDL).
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 96
AVEVA™ Enterprise Integration User Guide
Chapter 18 – EI Web Services
The following two figures show the EI Message Log and the Message Display pages showing the just-added
message.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 97
AVEVA™ Enterprise Integration User Guide
Chapter 18 – EI Web Services
WebSvc.Url = Properties.Settings.Default.EI_Plugin_EISvc_MessageManager;
WebSvc.UseDefaultCredentials = true;
//Call the AddMessage method to insert the message into EI:
//Add message to EI
WebSvc.AddMessage("TestIn","<? xml version = 1.0 encoding = utf - 8 ?>
< TestMsg >< MsgBody > This is the message content.</ MsgBody >
</ TestMsg >","Test Message Sent");
These code snippets are from a Visual Studio project in which a reference to the web service was created using
the following procedure.
1. In the Visual Studio Solution Explorer tree, right-click References and then click Add Service Reference.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 98
AVEVA™ Enterprise Integration User Guide
Chapter 18 – EI Web Services
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 99
AVEVA™ Enterprise Integration User Guide
Chapter 18 – EI Web Services
4. Enter the URL of the EI web service in the URL box and click the Go button.
The URL shown in the previous figure contains a placeholder, <EI server name>, which should be replaced
with the node name of the EI server.
If the URL is successfully contacted, then the MessageManager.asmx page appears below the URL. The Web
reference name box can be edited to customize the class name for the web service that will be available for
use in the code, as shown in the figure below. This value was entered as WebSvc for the code snippet above.
When this procedure is complete, the new web reference appears in the Solution Explorer window under
the Web References category, as shown in the figure below.
Version 6.2
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved. Page 100