OpcenterEXFN DevelopmentConfigurationGuide
OpcenterEXFN DevelopmentConfigurationGuide
04/2021
PL20201124062203470
Guidelines
This manual contains notes of varying importance that should be read with care; i.e.:
Important:
Highlights key information on handling the product, the product itself or to a particular part of the documentation.
Note: Provides supplementary information regarding handling the product, the product itself or a specific part of
the documentation.
Trademarks
All names identified by ® are registered trademarks of Siemens AG.
The remaining trademarks in this publication may be trademarks whose use by third parties for their own purposes
could violate the rights of the owner.
Disclaimer of Liability
We have reviewed the contents of this publication to ensure consistency with the hardware and software
described. Since variance cannot be precluded entirely, we cannot guarantee full consistency. However, the
information in this publication is reviewed regularly and any necessary corrections are included in subsequent
editions.
Security information
Siemens provides products and solutions with industrial security functions that support the secure operation of
plants, systems, machines and networks. In order to protect plants, systems, machines and networks against
cyber threats, it is necessary to implement – and continuously maintain – a holistic, state-of-the-art industrial
security concept. Siemens’ products and solutions only form one element of such a concept.
Customer is responsible to prevent unauthorized access to its plants, systems, machines and networks. Systems,
machines and components should only be connected to the enterprise network or the internet if and to the extent
necessary and with appropriate security measures (e.g. use of firewalls and network segmentation) in place.
Additionally, Siemens’ guidance on appropriate security measures should be taken into account. For more
information about industrial security, please visit https://www.siemens.com/industrialsecurity.
Siemens’ products and solutions undergo continuous development to make them more secure. Siemens strongly
recommends to apply product updates as soon as available and to always use the latest product versions. Use of
product versions that are no longer supported, and failure to apply latest updates may increase customer’s
exposure to cyber threats.
To stay informed about product updates, subscribe to the Siemens Industrial Security RSS Feed under https://
www.siemens.com/industrialsecurity.
Revision PL20201124062203470
State Published
Author Siemens AG
Language en-US
Solution Definition
New solutions are created in Solution Studio, starting from Apps created in Project Studio.
Solution Studio is a full web configuration client from which any authorized user can manage its solution. A solution
can reference multiple Apps.
Solution Studio offers administrative functionalities (for example to create, update or delete a solution) and UI
Development tools, such as the Mashup Editor, which enables you to quickly design and configure screens, and the
UI Application editor, which enables you to aggregate these screens into a UI Application.
Solution Studio also offers backup and restore functionalities as it saves all configuration and deployment
information in a system repository (for example, the distribution logic of worker roles, event subscriptions, host
configurations, security roles).
Functional Blocks
The customer solution is configured through the App Public Object Model and UI building blocks by defining the
relevant manufacturing rules (e.g. which commands are called for a particular event) and additional UI Applications
for different target user roles.
Solution Deployment
The Manufacturing Solution, which you developed and configured with Project Studio and Solution Studio, can be
deployed in a runtime environment through Solution Studio deployment functionalities.
The Manufacturing Solution can be deployed in a distributed environment. This essentially means that you can
deploy it over several web server hosts, whilst still granting load balancing and failover capabilities. Each host can
be individually joined to the network and the current solution can be deployed on it. When all hosts are correctly
updated to the latest solution version, Opcenter Execution Foundation will be ready to perform create/
update operations on the production database and start runtime services on all runtime hosts. Each host can also
communicate its status to the network in order to activate failover logic.
1.3 Apps
Apps are used in Project Studio to create and generate specific manufacturing use cases, based on multiple
manufacturing functionalities (i.e. Functional Blocks).
Extension Apps
Like Functional Blocks, Apps correspond to Visual Studio solutions, and they are made up of a series of Visual
Studio projects, each with a specific purpose.
There are projects to:
Database distribution
One of the advantages to having multi domains is to allow a database architecture where each domain is hosted on
a different server, or several domains are hosted on several database servers.
Currently, Opcenter Execution Foundation supports only an architecture where all domains are hosted on a single
server.
However, adopting multi-domain from the start makes it possible to adopt different complex and distributed
architectures in the future.
The standard fields required are a name and description for the new entity, a list of tags/keywords, which make it
possible to search for the entity, and whether or not the entity can be physically extended (sealed).
Entities can be extended in two different ways:
• Physical extension: new columns are added to the entity table in the database.
• Logical extension: a new column is added to the facet table that accompanies each entity in the database.
Physical extension
The physical extension can be viewed as a semantic extension: a certain entity, such as a lot, could be considered
complete and exhaustive for a vertical solution if it also contains, for example, the Barcode property (or the Color
property or any other property). In this case, the added property is shared and can be used by all the other entities
that inherit from the modified entity.
Entities can be physically extended through inheritance, by creating a new sub-entity, as long as the entity has not
been sealed.
For example, you may have the WorkOrder entity containing a set of properties, such as ID, name, description:
• To customize this entity for a discrete manufacturing solution, you could extend it by creating a new sub-entity
called ProductionOrder, which contains the following properties: ErpOrder and ErpPlant. This new
entity extends WorkOrder and inherits ID, name, description, from WorkOrder.
• To customize the ProductionOrder entity for a specific project, you could extend it through a new sub-entity
called WorkBookingOrder, which contains the following properties: SerialNumber and ParentBatch. This
entity inherits all the properties from WorkOrder entity (ID, name, description) and
from ProductionOrder entity (ErpOrder and ErpPlant).
Revision management
Entities that belong to the Master Data domain support revision management.
The instances of these entities are enriched with specific properties and SDK methods, which enable revision
management. For example, a specific revision can be locked, to ensure that it is not modified, or uniquely identified
as the current revision.
User Authentication
Workflow
The manufacturing functionality workflow involves four main steps, which are described below and illustrated in
the following workflow diagram:
1. Create a Functional Block.
2. Model Data.
3. Implement Business Logic.
4. Create a Package.
Workflow
The creation phase involves the following steps:
1. Create either a:
• Functional Block from scratch: this option creates a new Functional Block that belongs to a specific data
model domain.
• Functional Block with an external data source: this option will import artifacts from an external data
source (such as Microsoft SQL Server or Oracle Database).
2. If needed, create references to existing Functional Blocks: this option references an existing Functional Block to
integrate and extend its artifacts into your model.
The name of the Functional Block must not be identical to the name of any referenced Functional
Blocks or artifact types (e.g. "event", "command" etc) and must not contain reserved keywords.
5. Enter the location where the Functional Block will be created. The location name cannot contain the following
special characters: < (less than), > (greater than), : (colon), " (double quote), / (forward slash), \ (backslash), |
(vertical bar or pipe), ? (question mark), * (asterisk), & (ampersand), # (hashtag), % (percentage), , (comma).
6. Click OK: the creation process is simplified by an integrated wizard which guides you through the necessary
steps.
7. Enter a prefix for the Functional Block (see constraints below). The prefix is then added to the Functional Block
name in order to easily identify it during the development and configuration process.
8. Select which data model domain your Functional Block will belong to.
9. Modify the major version (the first two-digit number) of the Functional Block if the default value (01.00.00) does
not correspond to your requirements.
10. Insert a description providing other users with additional and exhaustive information on the functionality
provided by the Functional Block.
Note: During the modeling phase, it will be possible to modify the description of the Functional Block at any
time, right-clicking the Installer project and selecting the Properties command.
11. Select the projects you need (a complete Functional Block will require all of them):
• Model Project: from which you can model entities, commands, events and types.
• Command Handler Project: from which you can implement the business logic for commands.
• Event Handler Project: from which you can implement the business logic for events.
• Installer Project: where the files required to create the functional block package are contained.
Once you have created your Functional Block, you can subsequently remove or add projects from Visual
Studio.
Bear in mind that you cannot add Reading Function or User Interface projects or an App solutions to a
Functional Block, as well as any other projects which are not supported by the Functional Block wizard.
Result
If you have selected all available projects the structure displayed in the Solution Explorer pane is the following:
Prerequisites
• The external database is configured with the required permissions:
• SQL Server configuration, as described at section Configuring a Third-Party MSSQL Database of the
Opcenter Execution Foundation Installation Guide
• Oracle configuration, as described at section Configuring a Third-Party Oracle Database of the Opcenter
Execution Foundation Installation Guide
• Views have been created respecting the prerequisites for external data source views.
Procedure
1. From the start page of Project Studio, select File > New > Project.
2. In the left pane, click Installed and then expand the Templates\Simatic IT node.
3. Select Functional Block (Library).
4. Enter a name for the Functional Block, which will then be used in the solution. The name can contain 20
characters maximum, it cannot contain dots and cannot be modified once inserted.
The name of the Functional Block must not be identical to the name of any referenced Functional
Blocks, and must not contain C# reserved keywords , such as event, events or commands.
5. Enter the location where the Functional Block will be created. The location name cannot contain the following
special characters: < (less than), > (greater than), : (colon), " (double quote), / (forward slash), \ (backslash), |
(vertical bar or pipe), ? (question mark), * (asterisk), & (ampersand), # (hashtag), % (percentage), , (comma).
6. Click OK: the creation process is simplified by an integrated wizard which guides you through the necessary
steps. Pay attention that to use an external data source you must select the User domain as described in the
following steps.
7. Enter a prefix for the Functional Block (see constraints below). The prefix is then added to the Functional Block
name in order to easily identify it during the development and configuration process.
• Model Project: from which you can model entities, commands, events and types.
• Command Handler Project: from which you can implement the business logic for commands.
• Event Handler Project: from which you can implement the business logic for events.
• Installer Project: where the files required to create the functional block package are contained.
14. Open the Model project: the External Data Source tab will be displayed in the Model Explorer pane, from
where you can now import views.
Result
If you have selected all available projects the structure displayed in the Solution Explorer pane is the following:
Once you have created your Functional Block, you can subsequently remove or add projects from Visual
Studio.
The person in charge of creating the views must know both the logic and the semantic of the source tables,
in order to correctly use the C# types while implementing the handlers that use the corresponding entities
as a reading model.
Third-party types
Views can contain only Opcenter Execution Foundation supported types and the conversion from third-party to
supported types is performed as follows:
Oracle
Considered as a number
(38,19)
Microsoft SQL Server Is Supported Project Studio System .NET Corresponding Type
Type
Microsoft SQL Server Is Supported Project Studio System .NET Corresponding Type
Type
Prerequisite
You have defined a Functional Block associated with a User domain.
Procedure
1. Within the Functional Block of User type, open the Model project.
2. In the Model Explorer, open the External Data Source area.
3. Right-click the required data source provider (either MSSQL or Oracle) and then click Add Oracle/MSSQL
Server.
If you cannot see the Oracle data source provider, check the Prerequisites for Opcenter Execution
Foundation Configuration Tool in the Opcenter Execution Foundation Installation Guide.
Parameter Description
Server Name The name of the server (and the server instance, if required). Only
for MSSQL, click on the drop-down list box to automatically populate it
with the available servers.
Schema The schema name (only for Oracle). It cannot contain dots (.).
Authentication The authentication mode of the user. The available options are:
• Windows Authentication: in this case the database
connection is made using the credentials of the interactive
user who is running Visual Studio (and consequently Project
Studio) and who must also have the necessary grants to
access the SQL/Oracle views.
• (Only for MSSQL) Sql Authentication: in this case the
database connection is made using the credentials of the
user who must have the necessary grants to access the SQL
views.
• (Only for Oracle) Oracle Authentication: in this case the
database connection is made using the credentials of the
user who must have the necessary grants to access the
Oracle views.
For more information, see How To Configure Third-Party Databases in
the Opcenter Execution Foundation Installation Guide.
User Name (Only in case of database authentication) The name of the user who
must have the necessary grants to access the SQL/Oracle views.
Editing a connection
You can edit your database connection, as long as it uses the same data source provider, by right-clicking the
connection node in the External Data Source view and selecting Edit.
The system connects to the target repository and loads its views.
• If the name of a new database view corresponds to a previously imported entity, and differences are found, the
corresponding view is marked with an asterisk and an exclamation mark. The view can then be updated.
• Any views that were previously imported and that are not present in the new database connection will still be
displayed as artifacts in the central work pane, but a warning message will be displayed.
Refreshing a connection
If you know changes have been made to the MSSQL/Oracle database views, you can incorporate these changes into
your imported views by refreshing the connection.
This is simply done by right-clicking the connection node in the External Data Source view and selecting Refresh.
Any inconsistencies between the source database views and imported views will be marked by an asterisk and an
exclamation mark. At this point you can update the corresponding database views.
Changing provider
If you want to change provider you must first remove any views you imported from the initial provider.
Imported views can be deleted either by right-clicking any entities that have been dragged and dropped into the
central pane and selecting Delete, or by deleting the corresponding entities from the Object Model view.
You then add the new connector following the standard procedure.
Prerequisites
• You have defined a Functional Block with a User domain (which is specific for reading data from external data
sources)
• You have correctly configured your third-party database (see How To Configure Third-Party Databases in the
Opcenter Execution Foundation Installation Guide)
• You have created your views respecting specific prerequisites
• Once you have imported a view from a particular data source provider (e.g. MSSQL Server) you cannot at that
point add views from other data source providers (e.g. Oracle). To switch data source provider you must delete
all the entities from the previous provider in the model, and then import new views from the new provider.
• If you want to import views from different external data sources, you should use separate Functional Blocks.
Procedure
1. Within the Functional Block of User type, open the Model project.
2. In the Model Explorer, open the External Data Source area.
3. In the tree list, expand the node with your data source and select the views relative to the entities to be
imported in the reading data model by either:
• dragging and dropping the views into the central area, or
• right-clicking the required views and selecting Import View. Views imported in this way are not
displayed as entities in the central working area.
Result
Imported entities are displayed:
• in the Object Model view
• in the External Data Source in bold
• in the central working pane if they were imported via a drag and drop operation.
Write a description for an imported entity and for each single property of an
imported entity
Remove an imported entity from your model (by deleting it from the Object
Model)
Project Studio guides you in this process so you are constantly aware of the possible implications of your choices.
Views can be updated by adding properties and editing annotations within a new minor version, but a new major
version is required to edit property types and delete properties.
Updating views
Update views by right-clicking the modified view in the External Data Source view and selecting Update: one of
the following three messages will be displayed with a list of the corresponding properties:
The selected property has been New properties have been inserted The entity is enriched with
added to the data source view. into the source database view additional properties
The selected property has been Properties have been removed from The corresponding entity
removed from the data source the source database view properties are removed, and if
view. used:
• in relationships, these
relationships are also removed.
• in command argument(s),
these arguments are also
removed.
• in parameter type parameters,
these parameters are also
removed.
The selected property has been Any combination of the following • If entity properties have been
changed in the data source view. modifications may have been made added, the entity is enriched
to the source database view: with additional properties.
• If entity properties have been
• some property types have
removed, the corresponding
changed
entity properties are removed,
• properties have been inserted
and if used:
• properties have been removed
• in relationships, these
relationships are also
removed.
• in command
argument(s), these
arguments are also
removed.
• in parameter type
parameters, these
parameters are also
removed.
If entity property types have
changed the corresponding
properties are updated, and if
used:
• in relationships, these
relationships are also
removed.
• in command
argument(s), these
arguments are also
removed.
• in parameter type
parameters, these
parameters are also
removed.
Version Types Add Element Remove Element Change Element Change Handlers
Patch
Minor
Major
Elements may be entities, facets, commands, pre-checks, post-actions, events, parameter types, value types,
enumeration types, type aliases and their related arguments.
Elements that are already part of the model cannot be modified or removed in Patch or Minor versions.
Patch
When you create a new patch no changes can be made to the model itself.
The patch is basically intended for bug fixing. Only the business logic at C# level in the handlers can be modified.
All options that allow additions and changes to the data model will be disabled in Project Studio.
Minor Version
When you create a new minor version you can add elements to your model, such as entities or commands.
Generally you cannot modify the existing model, for example you cannot add new properties or attributes to
existing entities. Properties can only be added in the following case: if the existing entity has been defined as
Sealed or if the entity has been imported from an external data source view. Since these entities cannot be
extended, you can freely add properties without compromising the integrity of the model.
However, you can add parameters to existing commands, pre-checks, post-actions, events and so on.
None of the added elements can be set as mandatory, as this would break compatibility with the existing version.
All options that allow changes to and deletion of elements in the data model will be disabled in Project Studio. You
can however modify and delete elements that have been added in the minor version itself.
A new minor version will reset the patch number to 00 (e.g. a new minor version 02 could be for example 01.02.00).
Major Version
A new major version leaves you with complete freedom to delete and modify elements and destroy compatibility.
A new major version will reset the patch and minor version numbers to 00 (e.g. a new major version 02 would be
02.00.00).
New Major/Minor versions vs new Patch versions require different operations in Solution Studio (i.e.
update vs reload, respectively, as explained at Updating Apps and Extension Apps in a Solution
and Reloading Apps and Extension Apps in a Solution).
Procedure
1. Right-click the Installer project of the Functional Block for which you want to create a new version, in the
Solution Explorer pane and select Properties.
2. Click the Version button and enter the new version, noting that:
• if you enter a new Major version the Minor and Patch versions will be set to 00
• if you enter a new Minor version the Patch version will be set to 00.
If the original Functional Block had been referenced in Reference Manager from another Functional Block,
you must now update these references.
There is no limit to the number of Functional Blocks you can reference. However, as a general rule, you
should add references to Functional Blocks that are stable and preferably read-only to avoid inconsistency
issues.
Patch
Minor
Major
packages.reference content
<functionalblocks>
<functionalblock>
<name>RefMan.FBLibRM</name>
<version>01.00.00</version>
<type>Library</type>
</functionalblock>
</functionalblocks>
You can also perform this operation manually, using the standard Visual Studio Add Reference command,
but with the following drawbacks:
• You will have to manually add the model assembly .dll files of the Functional Block to the command
and event handler project.
• You will have to add details of the referenced Functional Block to the installer project so that it will be
included in the Functional Block package.
• Project Studio will not disable operations according to the type of version you are working on, with the
consequent risk of incompatibilities.
If two referenced Functional Blocks themselves reference the same Functional Block (i.e. A and B both
reference C) Reference Manager checks to see whether they reference the same version.
If they differ by patch or minor version the highest version is loaded.
For example:
• A references version 01.00.01 of Functional Block C
• B references version 01.00.02 of Functional Block C
Reference Manager will load version 01.00.02 as this should not cause compatibility issues.
If they differ by major version an error is returned and the operation will not be possible.
Procedure
1. In the Solution Explorer pane, double-click the packages.reference file in the Solution Items folder.
2. If enabled, click Restore packages, in order to be sure to correctly update all solution references.
3. Click on the Browse tab and select the Functional Block you want to reference. If it can be installed, its details
will be displayed in the pane on the right, otherwise an error message will be displayed.
4. Click Install. If the Functional Block contains references to other Functional Blocks, these will be displayed
under Dependencies and will automatically be installed if their .zip files are available in the folder, otherwise
you will receive an error message.
Result
• The packages you have installed will be displayed in the Installed tab and will have a green tick icon next to
them.
• According to the projects contained in the referenced Functional Block, the Solution Explorer tree view will
contain, under the References folder of each project, the .um, .umd and .dlls of the referenced projects. The
folder SimaticITPackages, if it does not already exist, will be created in the folder where your project files are
saved. A subfolder will be created for each referenced Functional Block, its name is comprised of the name and
version of the referenced Functional Block. The files contained in the .zip file are saved in this folder, with the
following structure:
• config folder, with the Dbinit.xml file for initializing the database
• handlers folder, with the command and event handlers
• model folder, with the data model files and assemblies
• ExternalDependencies folder, with third-party files required by the Functional Block you are referencing
• Manifest.xml file
• The .um file of the original Functional Block displays all the referenced artifacts in the Model Explorer.
Prerequisite
The output zip file of the original version we want to upgrade from, together with the zip of the new version we
want to upgrade to must be already present in the folder %ProgramData%
\Siemens\SimaticIT\Unified\Engineering\Packages\FunctionalBlocks.
If a referenced Functional Block is missing in the file system repository (i.e. %ProgramData%
\Siemens\SimaticIT\Unified\Engineering\Packages\FunctionalBlocks), and the system prevents you from
building the solution, we suggest that you perform the procedure described in the
document Troubleshooting: How to fix a Project Studio Solution if a referenced Functional Block is missing
available on GTAC site. The article will help you to manually remove the missing references from the
project and be able to install or restore the packages you need.
Procedure
1. In the Solution Explorer pane, double-click the packages.reference file in the Solution Items folder.
2. Click Restore packages, in order to be sure to correctly update all solution references.
3. Click on the Installed tab and select the Functional Block you want to update. If it can be updated, its details
will be displayed in the pane on the right, otherwise an error message will be displayed.
4. Click Update. If the Functional Block contains references to other Functional Blocks, they will be automatically
installed if their .zip files are available in the folder, otherwise you will receive an error message.
If two referenced Functional Blocks themselves reference the same Functional Block (i.e. A and B both
reference C) Reference Manager checks to see whether they reference the same version.
If they differ by patch or minor version the highest version is loaded.
For example:
• A references version 01.00.01 of Functional Block C
• B references version 01.00.02 of Functional Block C
Reference Manager will load version 01.00.02 as this should not cause compatibility issues.
If they differ by major version an error is returned and the operation will not be possible.
Prerequisites
The new output zip file of the Functional Block you want to restore, created during the Functional Block generation,
must be saved in the folder %ProgramData%
\Siemens\SimaticIT\Unified\Engineering\Packages\FunctionalBlocks.
If a referenced Functional Block is missing in the file system repository (i.e. %ProgramData%
\Siemens\SimaticIT\Unified\Engineering\Packages\FunctionalBlocks), and the system prevents you from
building the solution, we suggest that you perform the procedure described in the
document Troubleshooting: How to fix a Project Studio Solution if a referenced Functional Block is missing
available on GTAC site. The article will help you to manually remove the missing references from the
project and be able to install or restore the packages you need.
Procedure
1. Double-click the packages.reference file in the Solution Items folder of the Solution Explorer.
2. Click Restore packages. If the zips of the referenced Functional Blocks have been saved in the correct folder the
referenced Functional Blocks will be restored on the user's machine, otherwise an error message will be
displayed.
Reference Manager provides useful information on any possible incompatibilities which may incur by
referencing a specific version, and if you do not use Reference Manager this valuable information will not
be available.
Procedure
You must perform the following steps to manually reference a Functional Block:
1. Add a reference to the required Functional Block.
2. Add the model assembly .dlls to the handler projects of commands, reading functions and events (i.e. the model
assembly dlls either of the referenced Functional Blocks or of the same Functional Block, according to the
project implementations).
Prerequisites
The output files of the Functional Block you want to reference must have been saved in specific destination folders,
so that they can be referenced. These output files are created during the Functional Block generation.
Extract the following files from the output package of the Functional Block to be referenced and then copy them to
the following folders:
Procedure
1. Inside the Solution Explorer pane, right-click the model project folder and select Add > Reference.
2. Click on the Browse button and browse to the .um file placed in %ProgramData%
\Siemens\SimaticIT\Unified\Engineering\Dev\ModelSource.
These references are automatically managed in Project Studio. Reference Manager automatically adds model
assemblies for referenced Functional Blocks.
However, you can perform this operation manually. This is essential if you have referenced Functional Blocks
without using Reference Manager.
Procedure
1. Right-click your command (or event) handler project and select Add > Reference.
2. Browse to the output assembly folder of the model project, select the .dll files to be referenced and confirm the
operation:
• for the model assemblies of the Functional Block on which you are working, the folder could be C:
\MyFolder\<Prefix>.<FunctionalBlockName>.<Acronym>Model\bin\Debug
• for the model assemblies of referenced Functional Block, the folder could be: %ProgramData%
\Siemens\SimaticIT\Unified\Engineering\Dev\ModelBin (remember that you must have also referenced
the .um data model file from within your model project, and not from the command or event handler
projects).
If you try to delete the assembly of a data model that has already been deployed you could encounter
problems when you try to deploy the solution. It is possible to temporarily allow these potentially
destructive deletions during the configuration phase.
Procedure
1. In the Solution Explorer, expand the Installer project > Config folder and open
the <Prefix>.<FunctionalBlockName>.References.xml file.
2. Enter/modify the values in the following tags inside the <functionalblock> node:
Tag Description
Tag Description
<version> The version tag of the Functional Block. For example, if the zip file name is
Siemens.ACM_OPV01.00.00.zip the version to be inserted is: 01.00.00.
Workflow
The main steps of the Modeling phase, performed in the Model Project, are:
1. Modeling entities.
2. Modeling commands.
3. Modeling events.
4. Modeling types.
5. Build the Model project.
• Solution Explorer
• Model Explorer
• Model Designer
• Model Details
• Properties pane
Solution Explorer
If you have selected all available projects while creating the Functional Block the Solution Explorer pane displays
the following structure:
If you created a Functional Block associated with a user domain, as in the following example, the Model
Explorer pane will have an additional External Data Source tab.
Clicking on the Object Model tab you will see that your Functional Block is already populated with two referenced
events and a specific value type.
The artifact tree can be viewed in a hierarchical or flat mode, by enabling or disabling the flat view icon in the
menu bar. The flat view allows you to see all entities, facets and extensions at the same level, which means you can
see all entities, even if the root entity has been deleted or belongs to a referenced model.
The flat view also displays the relative indexes.
The filter icon in the menu bar allows you to select only a specific group of artifacts.
Model Designer
Your model can be displayed graphically in the central Model Designer pane, with its corresponding relations and
extensions, so you can easily see and check the relationships that exist between different elements. Model diagrams
are saved as DM files and can be versioned in source control systems, but cannot be merged. A default DM file is
created with the name of the model itself, which you can modify as required, but it cannot be renamed or deleted.
You can also create additional model diagrams by right-clicking the Diagram folder in your model, selecting Add
New Item > Add New Diagram and and providing a name for the new Model Diagram Class you will create. These
additional files will be saved in the Diagrams folder, together with the default DM file. They can be deleted but not
renamed.
Each DM model can display a different part of the data model, which may be particularly useful if the data model
contains many artifacts, or if you want to display only a particular part of the model. DM files are graphical
representations of the same underlying data model, so if, for example, you delete an artifact from the model it will
be removed from all the DM files where it was present. In this case each DM file will display the dirty asterisk in its
title bar, indicating that the file must be saved as the underlying model has changed.
Right-clicking in any empty area within the Model Designer pane allows you to perform a series of useful
operations involving the model artifacts, such as
• adding new artifacts
• selecting artifacts in order to move them
• collapsing and expanding the view
• exporting the view as an image
• hiding all artifacts
• increasing/decreasing the size of the tiles (zooming in/out).
The configurations performed for the data model are displayed in the Model Details pane after selecting the
relative artifact either in the Siemens Project Studio Model tree or in the central Model Designer pane. From this
pane, it is also possible to define new properties for entities, define relations between entities, create indexes and
specify parameters for commands and events, by clicking on the corresponding tab, and right-clicking at the top of
the specific window. However, it is easier to perform these operations in the Model Designer pane.
Properties pane
If you click on any of the properties in the Model Designer pane, the Properties pane is displayed, where you can
define the attributes of the selected property.
Naming Conventions
In order to avoid duplicated names, the uniqueness check of artifact names is case insensitive.
Regarding the artifact name, the only characters supported are alphanumeric characters and underscore
(_) and the first character cannot be a digit.
Naming Conventions
In addition to the reserved keywords, the uniqueness check of artifact names is case insensitive so Artifact names
must respect the following naming rules In addition to the keywords check Artifact names must respect the
following rules:
• Allowed characters are uppercase and lowercase letters, digits and '_' (underscore).
• The starting character can be uppercase and lowercase letter or '_' (underscore).
• Artifact names must be unique (within the FB/App and the uniqueness check is case insensitive).
• Id
• IsCurrent
• IsDeleted
• IsFrozen
• IsLocked
• LastUpdatedOn
• Operation
• OptimisticVersion
• Revision
• SessionId
• SourceRevision
• ToBeCleaned
• Discriminator
Events
The word EventFullName cannot be used in the parameters of events.
Reading Functions
The following words cannot be used within reading functions:
• FunctionResponse
• FullName
• AppName
• BaseReadingFunctionFullName
C# reserved words
The following words are C# keywords and should never be used in the name of a Functional Block or App or by any
element which could subsequently be part of a C# identifier:
Deleting an entity
These potentially destructive operations can be permitted temporarily in the configuration phase by enabling data
loss, but it is of upmost importance to remove this setting before deploying the solution in production.
Even if data loss is enabled, potentially destructive operations are possible when the data types are
compatible. For example, if you decide to change an int from 32 to 8 bit in a specific column, the column
must not contain numbers greater than 256, otherwise the update operation will fail in any case.
Procedure
1. With local administrative rights, create a file called deploy_configuration.xml in the folder
%SITUnifiedSystemRoot%bin.
2. Edit the file as follows:
3. If you are in a distributed environment, copy the file on all Opcenter EX FN hosts, in the same folder mentioned
at step 1.
4. Update the database while deploying the solution package.
Make sure you delete the deploy_configuration.xml file before using your solution on the production
line.
You can also hide/show entities, extensions, relationships and compositions by right-clicking on the entity
and selecting Hide/Show Selected Artifacts, Hide/Show Related Artifacts, Hide/Show Relationships/
Compositions.
System Entities
All Functional Blocks contain a reference to an internal SystemData.Foundation Functional Block. This Functional
Block defines a set of entities, which are not visible in the Object Model or Public Object Model of your Functional
Block or App, and that are:
• File (see Attaching Documents to Entities)
• Folder (see Attaching Documents to Entities)
• AuditTrailRecord (see How to Retrieve Audit Trail Information and Apply Custom Logic in the Opcenter Execution
Foundation User Manual)
• SegregationTags (see What is Data Segregation in the Opcenter Execution Foundation User Manual)
Only the AuditTrailRecord entity can be published in the Public Object Model.
Modifying entities
The operations described above and their results are summarized in the Model Details pane which is
displayed when you create and select an entity:
Tab Description
In the Properties tab you view and modify the properties added to the selected entity.
The Extension tab displays the extended entities that have been created starting from the
selected entity. This information is read-only.
In the Relations tab you can view and modify relationships that have been created
between entities.
In the Compositions tab you can view and modify composition relationships you have
created between entities.
The Facets tab displays the logical extensions that have been created for the selected
entity. This information is read-only.
The Indexes tab allows you to view and modify indexes created for the selected entity.
Accessibility options
Entities have specific options, which may modify their accessibility.
These options are defined when they are created, and may be inherited by any extended entities.
A Major version is required to successively change these options. If you are working on a minor version, you can
however modify the elements added within the minor version itself.
Behaviors
You can assign a behavior to an entity to enrich it with additional specific properties and platform methods to
manage these properties.
Behaviors are defined for a specific domain.
Revision The Revision behavior allows you to give a version Master Data
identifier to instances of entities and then specify which
specific version you want to use.
As the Revision is added to the logical key of the entity:
• you must define a logical key for the entity before
building the model.
• once set, and consequently part of the logical key,
this behavior cannot be removed from the entity.
Procedure
1. Right-click in any empty area in the central Model Designer pane and select Add > Entity.
2. Leave Base Entity as None as new entities must be created at root level.
3. Enter a name for your entity. If the name provided for the new entity is not valid the border of the edit box will
be red to confirm the operation is not enabled. Certain reserved keywords should not be used in the entity
name.
4. Enter a description for your entity. The Description edit box supports markdown formatting, thus allowing you
to correctly format the information to be included in the reference documentation file.
5. Clear Restricted if you want to allow command handlers from Functional Blocks in the same domain to directly
perform Create/Update/Delete operations on the entity.
6. Select Sealed if you don't want the entity to be physically extended.
7. Clear Securable if you want to unrestrict the entity's visibility to any authorized users.
8. Select Revision if you want to manage revisions for your Master data entity.
Result
The newly-created entity is now displayed in the central working pane with the entity icon , and properties can
be added to the entity.
Deleting entities
Entities can be deleted (right-clicking the name or icon of the entity in the central Model Designer pane and
selecting Delete) if they have not been physically or logically extended.
To delete entities that have been extended, you must either first remove its extended entities or select the Delete
on cascade option, which means that the entity's extensions will also be deleted.
If you try to delete the entity of a data model that has already been deployed you could encounter
problems when you try to deploy the solution.
It is possible to temporarily allow these potentially destructive deletions during the configuration phase.
The Restricted flag is inherited from the base entity, and cannot be modified for extended entities.
3. Enter a description for the extended entity. The Description edit box supports markdown formatting, thus
allowing you to properly format the information to be included in the reference documentation file.
Result
The extended entities you have created are displayed in the Model Designer pane and in the Extension tab of
the Model Details pane (if the parent entity is selected).
Your extended entity can be physically extended with other entities, as long as it is not sealed.
You can now add properties to your extended entity in the same way as they are added to root entities.
Limitations
• You cannot extend entities contained in a Functional Block associated with a third-party user domain.
• Only root entities can be logically extended.
• Facets cannot have a logical key.
• If you associate more than one instance of the same facet to the same entity instance, the queries that
you will generate in the Signal Rules will retrieve only one facet instance, without the possibility to
choose which facet instance.
• In a Functional Block relationships cannot be created between entities and facets.
• Same facets cannot be published in different Extension Apps.
Procedure
Facets can be either created from scratch or as a copy of existing ones. When a facet is copied, its properties are
copied, but not its index.
1. Right-click the name or the icon of the entity itself in the central Model Designer pane and select New
Facet. The entity you are extending will be displayed in the Base Entity edit box.
2. Enter a name for the facet. The name for the facet cannot contain spaces or special characters and it cannot
start with a number or end with the word Facet. Certain reserved keywords should not be used in the facet
name.
3. Enter a description for the facet. The Description edit box supports markdown formatting, thus allowing you to
properly format the information to be included in the reference documentation file.
Result
The facets you have created are displayed in the Model Designer pane and in the Facets tab of the Model
Details pane.
Your facet can no longer be extended in any way.
You can now add properties to your facet in the same way as they are added to root entities.
4. Click on the browse button next to the new property to select the property type. There are four possible types of
properties:
• System Types (e.g. string, bool)
• Value Types: made up of one or more of properties, which can be used cross-domain.
• Enumeration Types: a data type consisting of a set of named values called enumerators.
• Type Aliases: made up of a custom type for which custom constraints have been defined.
Parameter Types
Parameter Types, which are made up of one or more properties, can be used as complex types only
inside commands and events (not inside entities).
The properties displayed are filtered by type in the Model Details pane:
Local
Local + Inherited
All
If the property of an entity is used by other artifacts (for example, as an input parameter of a command),
you can change the property name but you cannot modify the following attributes:
• the property types and the property annotations
• the entity annotations (i.e. Sealed, Securable, Restricted and Revision)
If you try to modify these attributes, an error is displayed in Project Studio.
When you click on a property in Project Studio, the Properties pane is automatically displayed, where you can
modify the values for your property attributes.
You can also assign a description to the property in this pane. The Description edit box supports markdown
formatting, thus allowing you to properly format the information to be included in the reference documentation
file.
Property attributes are not maintained when the property is then re-used within a different entity, command or
event.
If you try to delete or modify the data type or shorten the length (string/binary) of a property attribute, which
belongs to a data model that has already been deployed, you could encounter problems when you try to deploy the
solution.
It is possible to temporarily allow these potentially destructive deletions during the configuration phase.
MaxLength attribute
If the MaxLength attribute is set for an entity, and this limit is exceeded, a validation error rule is triggered.
If, for any artifact type, the MaxLength attribute for String and Blob types is not specified (empty value) the
maximum length possible for the type will be automatically applied (i.e. 2GB (-1 byte)), regardless of whether your
underlying system is x32 or x64.
If specified the value can be between:
• 1 and 2GB (-1 byte) for Oracle databases
• 1 and 4GB (-1 byte) for SQL databases
• 1 and 2000 characters for Oracle or SQL databases if the LogicalKey is set to true.
If the From - To attribute is set, the validation rule depends on the data type:
• for an int or decimal: the value cannot exceed the specified range,
• for a string: the length of the string cannot exceed the specified range.
Decimal type
Decimal type entity properties are represented in .NET using the System.Decimal floating-point data type but are
persisted on the database using a fixed-point type.
When using the Microsoft SQL Server database provider, the maximum allowed precision (mantissa) is 38 and the
scale (exponent) can range from 0 to the precision value. When using the Oracle database provider, the maximum
allowed precision (mantissa) is 31 and the scale (exponent) can range from 0 to the precision value.
Due to a Oracle ODP.NET library bug, a scale value of 0 is not supported, so, if 0 is used, the system automatically
converts it to 1 and increments the precision value by a unit. If the precision specified by the user is already at its
maximum value (31), it will stay 31 and the maximum integer digit available will, therefore, be only 30.
While the .NET System.Decimal datatype allows a lower precision of 29 digits (in respect to the 31/38 offered by the
databases), it is subjected to floating-point arithmetic, which consequently means that it may have 29 digits before
or after the decimal separator. You must choose how to cope with this in a fixed-point decimal arithmetic. It would
be necessary to use a mantissa of 58 and a scale of 29 to cover losslessly all the .NET Decimal range. This is not
available on the database so it is necessary to select whether to give up digits to the left of the decimal separator
(thus having more digits to the right of the decimal separator) or sacrificing digits to the right of the decimal
separator (and being able to store larger numbers).
The default values are:
• precision = 18,
• scale = 3.
From - To
If the From - To attribute is set, the validation rule depends on the data type:
• for an int or decimal: the value cannot exceed the specified range,
• for a string: the length of the string cannot exceed the specified range.
Mandatory
If you set a property to Mandatory, the value of these properties cannot be null.
If you want to add the Mandatory attribute to a new or existing entity property and if the corresponding table is
already populated, the following default values will be inserted to respect validation constraints and ensure reading
capabilities (while if you set a custom default value for this newly added property, this value will be inserted instead
of the system default value):
String -
Bool false
Decimal 0
Guid 00000000-0000-0000-0000-00000000000
Blob 0
Timespan 0
EnumerationType 0
The operation of updating the database will fail if you set the Mandatory attribute to a new navigation property of
an entity, whose corresponding database table is already populated, because the system default value is not
related to an existing entity.
The Mandatory attribute has the following effect on the validation rules of Value Types:
Yes Value Type instantiated with all properties Validation rules turned on
set to null
Yes Value Type instantiated with at least one Validation rules turned on
property filled
No Value Type instantiated with all properties Validation rules turned off
set to null
String
Decimal
Integer (int,
tinyint,
smallint,
bigint)
DateTime
Guid
Bool
ValueType
Blob
TimeSpan
Enumeration
Type
Facets
String
Decimal
Integer (int,
tinyint,
smallint, bigint)
DateTime
Guid
Bool
ValueType
Blob
TimeSpan
EnumerationTy
pe
Value Types
String
Decimal
Integer
(int, tinyint,
smallint,
bigint)
DateTime
Guid
Bool
Blob
TimeSpan
Enumeration
Type
Parameter Types
String
Tinyint
Smallint
Int
Bigint
Decimal
Bool
Datetime
Guid
entity.propertyId
Blob
TimeSpan
EnumerationType
List<simple property>
List<value type>
List<entity prop>
List<enumeration
type>
The Allow Empty String annotation (which accepts True or False) allows you to pass an empty string as
property value. It can only be used with String types and if Optional is set to False.
Modeling notes
All business entity types should have a Logical Key, except for some specific cases.
An example of entity which should not require a Logical Key could be a Log entity which tracks all events related to
a specific plant. In this use case, the system should treat each event as a different row, both inside the same
database and across different databases. If an entity has no logical key defined, the AId is set to the same value as
the Id value.
You can set the Logical Key on the following properties:
Backward-navigation properties
Constraints
• If LogicalKey is set to true:
• it is mandatory to provide a value for the property (this is valid also for Value Types: if you
promote to LogicalKey a Value Type of an entity, all the Value Type properties become
mandatory regardless of how they have been set in the Value Type and you cannot create the
entity unless you define all the Value Type values).
• the corresponding property of the entity will be displayed with a key icon
• its value cannot be changed anymore
• If a Value Type contains properties whose Reference attribute is set to true, the LogicalKey attribute
cannot be assigned to the Value Type.
• If you set the logical key on a new entity property whose corresponding database table is already
populated and if the entity has no other logical keys, the operation of updating the database will fail
because the system will try to set a system default value for all the existing rows as it does for
the mandatory fields in update mode (while this is not acceptable for a logical key).
• No errors will be returned if you set the logical key on an existing entity property whose corresponding
database table is already populated (as long as the data stored in the logical key column is unique) or if
you set the logical key on a new property if the entity has already another logical key (in this case, the
first logical key already ensured that data is unique, regardless of the inserted system default value).
Implementation notes
When you are about to create an entity, you must set the properties that belong to its Logical Key before calling the
Submit() method.
If you try to submit an entity, which has the same Logical Key as an entity that has already been inserted, the
system returns an error.
After the entity is created in the database, you can no longer:
• modify the properties of the Logical Key
• add foreign keys to an already existing attribute (this does not apply to the Public Object Model in the App).
If you have already set a value for a Logical Key property, you can no longer change it.
Example
If you had a MaterialDefinition entity type with the following properties:
• Name
• Description
• MajorVersion
• MinorVersion
• MaterialClass (navigation property)
you could set a meaningful Logical Key on Name, MajorVersion, MinorVersion.
If you did so, you could store many materials having same name but different versions (regardless of the class and
the description).
Procedure
1. Right-click the name or the icon of the entity, in the central Designer Model workspace.
2. Select Add > New Index.
3. In the Add New Index dialog box select the properties to include in the index and modify their order with the
arrows.
To create an index on the ID of an entity, select its name in square brackets as the index property.
For example, in the following example the ID of the entity is [MaterialDefinition].
Result
The index and its properties are displayed in the Indexes tab of the Model Properties pane.
From here you can edit/delete the index by right-clicking it and selecting Edit/Delete.
The indexes of referenced entities cannot be modified.
Clustered Indexes
If an index is set as clustered, the data rows within the entity will be ordered according to the index.
Clustered indexes can be created for root level entities (not for extended entities or facets), and there can be only
one clustered index for each root entity.
Clustered indexes cannot be created for the entities of referenced Functional Blocks, even if they belong to the
same domain.
For more information on Index Management, see also Managing Indexes in Opcenter Execution
Foundation.
Possible relationships
Entities Type of relationship Allowed
An extended entity and its base entity, where the Many to One
base entity is target entity (One).
An extended entity and its base entity, where the Many to One
base entity is source entity (Many).
For example, if you create a Many to One relationship between two entities (e.g. Order and Customer), the source
entity provides a list of related entities. This list is provided by the mandatory forward-navigation property.
Additionally, you may want to have a way to browse the source entities from the target entity. This is provided by
the backward-navigation property, which is optional for Many to One relationships and mandatory for Many to
Many relationships.
Example
For example, you may need to create a relationship between Work Order Operations (Many/Source) and
their Work Order (One, Target).
In this case:
• each Work Order Operation will have a mandatory forward navigation property, indicating its
"parent" work order and
• each Work Order may have an optional backward navigation property, indicating its "child" work
order operations.
1. Right-click the source entity, which will act as the Many part of the relationship, in the central Designer Pane
and select Add New Relationship.
3. Enter a unique name in the Navigation Property field of the source entity, with which the relationship can be
recognized as a property of the entity. This property is used as a forward-navigation property.
4. If required, enter an optional Navigation Property also for the target entity, to make it possible to identify
linked source entities from the target entity. This property is used as a backward-navigation property.
5. Ensure the Cardinality of the source entity is set to Many and the target entity is set to One (default values).
6. Select Mandatory if one instance of the Source entity must be linked to one instance of the Target entity (i.e.
Null is not allowed as a value). In this case it is not possible to set the delete behavior to OnDeleteSetNull.
7. Select Logical Key if the navigation property will be part of the logical key of the source entity.
8. Select the required deletion behavior (logical deletion) from the Delete Action drop-down list:
• OnDeleteCascade: if the target entity (Work Order in the example) is deleted, the source entities related
to the target entity (Work Order Operations in the example) are also deleted.
• OnDeleteSetNull: if the target entity (Work Order in the example) is deleted, the navigation properties
of the source entities related to the target entity (Work Order Operations in the example) are set to null.
This option cannot be used if the relationship has been defined as Mandatory, as in this case the
navigation property, being mandatory, can never be set to null. If you try to set the relationship as
Mandatory with OnDeleteSetNull, the build operation will fail in Project Studio.
• OnDeleteNoAction: means that no delete operations are allowed. In our example, if you try to delete a
Work Order when it has related Work Order Operations, the operation will fail with errors. The related
Work Order Operations must be deleted before attempting to delete the Work Order.
9. Add an optional description for the relationship.
10. Click OK.
Example
For example, you may need to create a relationship between Users (Many/Source) and
their Groups (Many, Target).
In this case:
• each User will have a mandatory forward navigation property, indicating all the groups it is related to
and
• each Group will have a mandatory backward navigation property indicating all the users related to it.
1. Right-click one of the entities, which will act as the source entity, in the central Designer Pane and select Add
New Relationship.
4. Enter a mandatory Navigation Property for the target entity, to make it possible to identify linked entities from
the target entity. This property is used as a backward-navigation property.
5. Ensure the Cardinality of the both entities is set to Many.
6. Select the required deletion behavior from the Delete Action drop-down list:
• OnDeleteCascade: if the target entity is deleted it will be removed and the source entities related to the
target entity are deleted as well.
• OnDeleteSetNull: in order to delete an entity, the navigation properties that link it to other entities must
first be set to null.
• OnDeleteNoAction: means that no delete operations are allowed. If you try to delete a target entity
when it has related source entities, the operation will fail with errors. The related source entities must be
deleted before attempting to delete the target entity.
7. Add an optional description for the relationship.
8. Click OK.
Result
The two entities associated in the relationship will be connected through an association link in the Model Designer
pane indicating their type of relationship (n-1 or n-n). If you click on the association link, the source entity is
highlighted in blue.
Other types of links, such as entity extensions, facets and signals, are represented by a dotted (non-clickable) line.
You can create, edit and delete the entity properties, relationships and compositions both in the Model Details
pane as in the Model Designer by expanding the related nodes: Properties, Relationships and Compositions.
A key icon indicates whether a navigation property has been set to Logical Key.
The relationship is displayed in the Relationships tab in the Model Details pane.
The Navigation properties are used to create a column on the entity that will work as a foreign key.
To delete/edit the relationship, right-click the selected relationship in the Model Details pane and select Delete/
Edit. If it cannot be edited (e.g. in a referenced entity) it will be grey.
For the required business logic, see also Creating Associations Among Entities and Querying on Referenced
Entities.
Composition relationships have the advantage of being treated as a group when copied. If the composite entity is
copied all its part entities are also copied, along with their forward and backward navigation properties.
For more details on copying composition relationships see Copying Entity Instances.
Part Entity Base Entity The part entity can be a root entity.
Part Entity Multi-Composite Entity The part entity can have only one
composite entity.
Composite Entity Multi-Part Entity The composite entity can have more
than one part entity.
Procedure
1. Right-click the name or the icon of the part entity, which will act as the source entity for the relationship, in the
central Designer Pane and select Add New Composition.
2. Select the entity which will act as the target composite entity in the relationship from the Composite Entity
Name drop-down edit box.
3. Enter a unique name in the Navigation Property field with which the relationship can be recognized as a
property of the part entity.
4. Select a direction for the cardinality of the relationship, which can be OneToMany or ManyToOne, depending
on which entity in the relationship is the composite (One) and which is the part (Many).
5. Select Mandatory if a value must be provided for navigation property (i.e. Null is not allowed as a value).
Mandatory cannot be selected for recursive or ManyToMany relationships. If selected, the build operation
would fail.
6. Add an optional description for the relationship.
7. Click OK.
Result
The two entities associated in the composition relationship will be connected with a line in the Model
Designer pane:
The relationship is also displayed in the Composition tab in the Model Details pane.
To delete/edit the relationship, right-click the selected relationship and select Delete/Edit. If it cannot be edited
(e.g. in a referenced entity) it will be grey.
The Navigation properties are used to create a column on the entity that will work as a foreign key. You can query
on related entities through the Include extension method.
Workflow
The procedure for creating and using a Value Type, which is described in this page, consists in several subsequent
macro-steps:
4. Add any other required properties and associate them to the properties of the entity you want to expose.
5. In the Properties pane check that the Reference attribute of each property is set to True (the default value
when you link a property to an entity, see the note below).
6. Build the model project and then the Functional Block package as usual.
7. (Optional) Repeat the same procedure to create other Value Types in other domains. For example, in
the ReferenceData domain you can create a UoM entity, and a UOMVT Value Type that maps the Name of
the UoM entity.
• To create the properties of the referenced entity in the reading model you must reference the whole
entity (as in step 3), if you fail to do so the properties will not be created in the reading model.
• Setting the Reference attribute to True allows you to use the OData EXPAND function and the
INCLUDE function in queries and projection queries to retrieve data on the referenced entity. If the
Reference attribute is set to False, the defined entity properties will be created in the reading model,
but the referenced entity cannot be accessed in queries.
• In the writing model, the properties are created in additional columns, whether the Reference
attribute is set to True or False.
1. Create or open the required Functional Block: this is the project which contains the entity you want to link to the
properties exposed through the Value Type of the referenced domain.
2. Verify that the references to the required Functional Block have been correctly managed: the reference Value
Type is consequently displayed:
Example
The picture below displays a relationship between the OperationalLot entity belonging to the Operation Data
domain, the MaterialDefinition entity belonging to the Master Data domain and the UoM entity belonging to the
Reference Data domain. This relationship is achieved by creating a Value Type that maps some of the properties of
the MaterialDefinition entity (MaterialDefinition_VT Value Type) and some properties of the UoM entity (UOM_VT
Value Type), by creating a reference from the Operation Data domain to the Master Data domain and
the Reference Data domain, and then setting the MaterialDefinition_VT and the UOM_VT Value Types as
properties of the OperationalLot entity.
Procedure
1. Inside the Model Explorer pane of your Functional Block, click the entity you want to join.
2. In the Properties tab of the Model Details pane right-click the property (of type Guid, Int or String) that will be
used for the relationship, and select Create Relationship.
3. In the Parent Entity Name edit box browse to the entity to which you want to create the relationship.
4. Click OK: the relationship is displayed in the central pane and the property used to create the relationship is no
longer displayed in the list of properties.
Relationship Characteristics
The characteristics of the relationship cannot be modified and are:
Characteristic Value
cardinality OneToMany
Removing a relationship
To remove a relationship:
1. Click on the Relationships tab in the Model Details pane.
2. Right-click the row corresponding to the relationship you want to delete.
3. Select Remove Relationship.
Procedure
1. Right-click the entity in the Model Explorer tree and select Rename.
2. Enter a new name for the entity which has not already been used within the Functional Block. Certain reserved
keywords should not be used in entity and type names.
Result
The entities and types are automatically renamed in all work areas in Project Studio.
The properties of entities and types can be renamed by simply retyping their names in the Model Details pane.
If you rename entities and/or types that have already been used in the logic of command/event handlers
you must manually update the code contained in these files.
The commands in your Functional Block are outlined in the modeling phase in Project Studio.
Any commands included in data models you may have referenced when the Functional Block was created are
displayed in the MES Model Explorer, but you can also create new commands in the same environment.
Referenced commands are displayed with a lock icon and they cannot be modified in Project Studio.
Commands can either be protected or private, which affects the rules that determine how commands can be
invoked.
In the following sections we will go through:
• the difference between private and protected commands (command classification)
• how to create commands
• how to add parameters
• how to develop Pre-Checks for executing a validation logic for commands.
• how to develop Post-Actions to extend commands.
Procedure
Commands can be either created from scratch or as a copy of existing ones.
1. In the central Designer Model pane right-click and select Add > Command.
2. Enter a name for the new command. This name cannot successively be modified. Certain reserved keywords
should not be used in command names.
3. Enter a description for the command. The Description edit box supports markdown formatting, thus allowing
you to correctly format the information to be included in the reference documentation file.
4. Select either of the following:
• Protected, (selected by default) the command can be invoked from any Functional Block that contains a
reference to the current one and belongs to the same domain.
• Private, the command can be invoked only within the current Functional Block and only inside the same
domain. For this type of commands, additional constraints are applied to the code implementing event
handlers and IUnifiedSdkLean interface.
5. Clear Securable (Protected commands only) if you do not want to assign the command invocation to any roles.
6. Click OK: commands are displayed in the central Designer Model pane with a specific icon in the model tree,
according to their access modifier:
private commands
protected commands
Referenced commands are visible only if they are protected (not private) and are identified with the
icon
Adding parameters
1. Right-click the name or the icon of the artifact in the central Designer Model pane and select either Add new
Input Parameter or Add new Output Parameter.
2. In the Properties tab of the Model Details pane, enter a user-friendly name. Certain reserved keywords
should not be used in parameter names.
3. Click on the browse button and select the property from the Property Browser dialog box, which can belong to
three distinct categories:
• properties of other entities (from Data Model node),
• System Types: simple types, such as string, bool, int etc..,
• Types: Parameter Types, Type Aliases, Enumeration Types.
1. Select the parameter of your artifact in the Parameters tab of the Model Details pane.
2. In the Properties pane enter the attributes for your selected properties:
String
Integer
(int, tinyint,
smallint, bigint)
DateTime
Guid
Bool
Decimal
ParameterType
TimeSpan
EnumerationTy
pe
• If the UseDefaultIfNotSet option is set to true, when the user does not specify the parameter value in
the command invocation, the system automatically sets the parameter value to the type default. If the
property is set to false, when the user does not specify the parameter value in the command
invocation, the system returns an error. The default is the system type default (e.g. for integers: 0, for
boolean: false, and so on).
• The Command output parameters (i.e. the Command Response) for which the Optional attribute has
been set to False, are mandatory at runtime only if the Response does not contain an error code.
• If, for any artifact type, the MaxLength attribute for String and Blob types is not specified (i.e. empty
value) the maximum length possible for the type will be automatically applied (i.e. 2GB (-1 byte)),
regardless of whether your underlying system is x32 or x64. If specified, the value must be between 1,0
and 2GB (-1 byte).
• The AllowEmtpyString annotation (which accepts True or False) allows you to pass an empty string
as parameter value. It can only be used with String types and if Optional is set to False.
The Base Commands for which you implement the Pre-Check can belong to: the same Functional Block
that contains the Pre-Check, a referenced Functional Block, a Base App or Extension Apps.
If you need to add a Pre-Check to the Public Commands of an App, you must create an Extension App for
that App.
If you call a Functional Block command containing Pre-Checks and published in more than one Extension
App of the same Base App, at runtime all Pre-Checks will be executed. In case of ambiguity problems, the
system will adopt the following behavior:
• If a Pre-Check is enabled in one Extension App and disabled in another Extension App, at runtime the
Pre-Check will be executed.
• If a Pre-Check is enabled in all Extension Apps with a different execution order, at runtime the Pre-
Check will be executed according to the alphabetical order by default.
• If the Pre-Check behavior is configured setting the StopAndFail in one Extension App and the
FailAndProceed in another Extension App, at runtime the StopAndFail behavior will be applied and
the Pre-Check execution will be stopped at the first Pre-Check failure.
Procedure
1. In the Object Model pane, right-click the Base Command (or Composite Command) and select New Pre-Check.
2. Enter the Pre-Check name and description.
3. Leave the Enabled check-box selected (set by default) if you want the Pre-Check be always executed by default
(regardless of the App that publishes it). If you want to disable it, remove the selection and the Pre-Check will
not be executed.
4. Only in Public and Composite Commands, configure the Pre-Check behavior by setting
the PreCheckBehavior option, as following:
• Leave the StopAndFail value (default) to stop the Pre-Check execution at the first Pre-Check failure.
• Set the FailAndProceed value to proceed with the Pre-Check execution anyway.
5. Click OK.
After building the Object Model as for the other Object Model artifacts, you can proceed as described at section How
to Implement Pre-Checks for Business Logic Execution.
If you want to change the configuration of a Command with Post-Actions from Protected to Private, you
must remove all Post-Actions manually before proceeding, otherwise an error will be returned.
The Securable attribute is not available because the Post-Actions are always associated to the same role
permissions that are associated to the referenced Base Command.
The Optional attribute is available to make the Post-Action execution optional. In this case, both in Project Studio
and in Solution Studio you can decide either to enable the Post-Actions and execute them or to disable the Post-
Actions and not execute them. Otherwise, the Post-Action execution is mandatory by default.
Procedure
1. In the Object Model pane, right-click the Base Command (or Composite Command) and select New >
Post-Action.
2. Enter the Post-Action name and description.
3. Click OK.
4. If you want the Post-Action execution be optional, open the Properties pane and set the Optional attribute to
True. Otherwise, if you leave this option set to False (default), the Post-Action execution will be mandatory.
5. If you want the execution of an optional Post-Action be disabled, open the Properties pane and set the
Enable attribute to False. Otherwise, if you leave this option set to True (default), the Post-Action execution will
be enabled.
Events are identified by a specific icon and are displayed as orange elements in the Model Designer pane.
Referenced events are displayed with a lock icon and they cannot be modified in Project Studio, although
event handlers can be created for them.
A referenced event is visible regardless of the domain in which the source event was created.
System Events
All Functional Blocks contain a reference to an internal Functional Block, the SystemData.Foundation Functional
Block. This Functional Block exposes a set of events, which are visible in the Model Project of your Functional Block
as referenced events:
• AuditTrailRecordCreated (see How to Retrieve Audit Trail Information and Apply Custom Logic in the Opcenter
Execution Foundation User Manual)
• CommittedEvent
• DebugStartupEvent
• SessionAligned, SessionAlignment, SessionCreated, SessionDeleted, SessionPopulated and
SessionUpdated.
• TimerEvent
Workflow
To model events, you have to:
1. Create events.
2. Add input parameters.
3. Create event handlers.
While defining the event structure, we suggest that you unify the information contained in the event structure with
the information you will use in the event envelope.
Procedure
Events can be either created from scratch or as a copy of existing ones.
1. In the central ModelDesigner pane right-click and select Add > Event.
2. Enter a name for the new event. This name cannot successively be modified. Certain reserved keywords should
not be used in the event name.
3. Enter a description for the event. The Description edit box supports markdown formatting, thus allowing you to
correctly format the information to be included in the reference documentation file. Events are identified by a
specific icon
Procedure
To define custom event handlers both for events modeled inside the same domain and for events that are
referenced from other domains:
1. Select the required event in the Event node in the Model Explorer and drag it into the central Designer Model.
2. Right-click the event and select New Event Handler.
3. Enter a name for the new event handler and confirm: the new handler is displayed in the Handlers tab of
the Model Details pane.
Procedure
Value Types can be either created from scratch or as a copy of existing ones.
1. In the Model Designer pane, right-click in any empty area and select Add > Value Type.
2. Enter a name for the value type. The name must not contain spaces or special characters and cannot start with a
number. Certain reserved keywords should not be used in the value type name.
3. Enter a description for the value type. The Description edit box supports markdown formatting, thus allowing
you to properly format the information to be included in the reference documentation file.
4. Click OK: value types are identified by a specific icon in the Model Explorer pane.
Result
The newly created value type is an empty container to which you must add properties.
If you add system type properties, the value type can be used inside entities as a property container. To use the
value type in this way, create an entity and select the value type you have created while browsing the type of the
property.
If you add properties of other entities as property types, the value type will be used inside target entities of other
domains as a reference value type.
Procedure
1. In the Model Explorer pane right-click the Types node and select New Type Alias.
2. Insert a name for the type alias. The type alias name cannot contain spaces or special characters and it cannot
start with a number. Certain reserved keywords should not be used in the type alias name.
3. Select the base simple type on which you want to base your type alias (string, tinyint, smallint, int, bigint,
decimal, DateTime, Guid, Bool, Blob or TimeSpan).
4. Enter a description for the type alias. The Description edit box supports markdown formatting, thus allowing
you to correctly format the information to be included in the reference documentation file.
Result
Type aliases are displayed in the Model Explorer pane, identified by the icon .
You can now specify the attributes for the type alias in the Properties pane. These attributes will be inherited by the
entity property, or the command/event/reading function parameter that uses the just defined type alias as
property/parameter type (see the table below).
To delete a type alias, which has been used in a property or parameter, you must select the Delete on
Cascade option in the delete dialog box.
This will delete the type alias and all the properties and parameters that use the type alias.
DateTime
Guid
Blob
TimeSpan
Procedure
Parameter types can be either created from scratch or as a copy of existing ones.
1. In the Model Designer pane, right-click in any empty area and select Add > Parameter Type.
2. Enter a name for the parameter type. Certain reserved keywords should not be used in the parameter type
name.
3. Enter a description for the parameter type. The Description edit box supports markdown formatting, thus
allowing you to correctly format the information to be included in the reference documentation file.
Result
The new parameter type is displayed in the Model Designer pane with the icon.
To delete a parameter type, which has been used in a property or parameter, you must select the Delete
On Cascade option in the delete dialog box.
This will delete the parameter type and all the properties and parameters that use the parameter type.
Type Description
System Types Possible simple properties are: string, int, bigint, smallint, tinyint,
decimal, bool, DateTime, Guid, Blob, Span.
Entity Properties You can use the type of an entity property (not the property itself) by
browsing to the entity object and then to one of its properties.
Enumeration Types A data type consisting of a set of named values called enumerators.
Parameter Types You can nest any parameter type taking into account that the related
property must be set to Optional.
Type Description
Procedure
Enumeration types can be either created from scratch or as a copy of existing ones.
1. In the Model Designer pane, right-click in any empty area, select Add > Enumeration Type.
2. Enter a name for the enumeration type. The name must not contain spaces or special characters and cannot
start with a number. Certain reserved keywords should not be used in the enumeration type name.
3. Enter a description for the enumeration type. The Description edit box supports markdown formatting, thus
allowing you to correctly format the information to be included in the reference documentation file.
4. Click OK.
Result
The new enumeration type is displayed in the Model Designer pane with the icon.
The newly created enumeration type is an empty container to which you must add the enumerators .
4. Click on the enumerator you have just added and modify its value, which must be an integer.
Procedure
1. In the Model Explorer, select the artifact you want to set as deprecated.
2. In the Properties pane > Accessibility area, fill the Deprecated field by inserting the Opcenter Execution
Foundation version where the artifact is deprecated.
Procedure
1. Within the Model project from where the file has been removed, right-click the Properties folder and select Add
> New Item.
2. From the displayed dialog box, select the Assembly Information File template and click Add. The system will
assign a default name to the file, regardless of the name you assigned.
At this phase you can build only the model, not the entire solution. If you compile the entire solution now, you will
receive a blocking error because command and event handlers have not been imported yet.
Prerequisites
If you are building a model created in a previous version of Opcenter Execution Foundation, make sure you have
correctly migrated the model to the current version.
Any system integrators/customers that use Opcenter Execution Foundation to customize applications and
business logic, must write the code in a secure way, by respecting any secure coding guidelines in place on
the customer’s site.
The Opcenter Execution Foundation platform cannot be held responsible for the security of the modeled
artifacts, such as UI Components, events, commands, reading functions and so on.
Workflow
The main steps of the implementation phase are:
1. Import the handler templates (command handlers, event handlers, pre-check handlers and so on).
2. Add file references to the model assemblies to build logic on entities that belong to the same Functional Block.
The file references for referenced Functional Blocks should be added using Reference Manager.
3. Write the business logic by invoking the required platform public functionalities. The syntax of the logic you
write is dynamically checked by the UAF C# Analyzer.
4. For remote command invocations, see How to Manage Remote Artifacts.
5. For entity creations, see How to Manage Entity Instances.
Possible operations
Refer to the dedicated sections about the integration with specific parts of the product, such as for example
• Integrating with Automation Gateway Server
• Exchanging messages with external systems
• Integrating Electronic Signature
• Handling Timers
• Using Semi-Automatic Acquisition in Work Instructions
• Managing Application Logs
For more information on how to extend the business logic of referenced Functional Blocks, see How to
Implement Pre-Checks for Business Logic Execution and How to Extend Business Logic with Post-Actions.
Workflow
The minimum workflow to be followed to implement Command Handlers is as follows:
1. Import Command Handlers.
2. Write the business logic.
3. Debug your code inside Command Handlers.
The model assemblies of entities that have been modeled in the same Functional Block are managed
automatically within Project Studio if you use the Import from the Model command. If you import
command handlers manually you will then have to manually import the relative manifest and .dll files.
Similarly, the model assemblies of entities from referenced Functional Blocks are automatically managed
by Reference Manager. However, if you do not use Reference Manager you will have to manually add the
model assemblies of referenced Functional Blocks.
In some cases, for example if a .cs file has been removed by mistake, you may need to manually add command
handler templates to your project instead of using the import functionality:
1. Expand the command handler project.
2. Right-click on the Commands sub-folder and select Add > Existing Item.
3. Browse to the .cs files that you want to use in your project (for example,
MyProject.RFModel\bin\Debug\MyProject.RFModel\Commands).
Examples
The command handler below implements the code for a command, defined as follows:
using Siemens.SimaticIT.Unified.Common;
using Siemens.SimaticIT.Unified;
[...]
namespace MyDomain.MySubDomain
{
/// <summary>
/// Class initialize
/// </summary>
public partial class MyCommandHandlerShell : ICommandHandler
{
private IUnifiedSdk Platform;
/// <summary>
/// Execute
/// </summary>
/// <param name="unifiedSdk"></param>
/// <param name="command"></param>
/// <returns></returns>
public Response Execute(IUnifiedSdk unifiedSdk, ICommand command)
{
this.Platform = unifiedSdk;
return MyCommandHandler((MyCommand)command);
}
/// <summary>
/// Retrieve the type of the command
/// </summary>
public System.Type GetCommandType()
{
return typeof(MyCommand);
}
}
}
using Siemens.SimaticIT.Unified.Common;
using Siemens.SimaticIT.Handler;
using Siemens.SimaticIT.Unified;
using Siemens.SimaticIT.SDK.Diagnostics.Tracing;
[...]
namespace MyDomain.MySubDomain
{
/// <summary>
/// Partial class init
/// </summary>
[Handler(HandlerCategory.BasicMethod)]
public partial class MyCommandHandlerShell
{
/// <summary>
/// This is the handler the MES engineer should write
/// This is the ENTRY POINT for the user in VS IDE
/// </summary>
/// <param name="command"></param>
/// <returns></returns>
[HandlerEntryPoint]
private MyCommand.Response MyCommandHandler(MyCommand command)
{
Guid myGuid = Guid.NewGuid();
Platform.Tracer.Write("Siemens-SimaticIT-Trace-BusinessLogic",
Siemens.SimaticIT.SDK.Diagnostics.Common.Category.Informational,
"My local variable value is {0}",
localVariable);
If you have not used Reference Manager to add references to Functional Blocks you can add model assemblies
manually.
Read data from write model, if the entity is inside the same domain
Read data from write model, if the entity is inside another domain
Read data from read model, if the entity is inside the same domain
Read data from read model, if the entity is inside another domain
Read data from read model, if the entity is from a user domain
Write data (create, update, delete entity instance), if the domain of the entity (if
and the domain of the command/event are the same and the Functional the entity is not
Blocks are different. restricted)
Write data (create, update, delete entity instance), if the domain of the entity
and the domain of the command/event are different
Write data (create, update, delete entity instance), if the entity belongs to a
user domain
Trigger events
Subscribe to events
Automation Gateway functionalities, exposed by the Automation Sdk interface, can be accessed only if you
compile the Command Handler/Event Handler/Reading Function Handler by choosing the 64-bit
compilation option.
Command validation
If you set validation attributes on the command parameters, when you invoke a command (either from another
handler, or from a client through the Service Layer or from a client that uses IUnifiedSdkLean interface), the
provided values will be validated accordingly. If you set validation attributes on the command output parameters,
the response that a command handler returns will be validated too. A failure in this validation will result in the
command execution failing.
using System;
using System.Collections.Generic;
using System.Linq;
using Siemens.SimaticIT.Unified.Common;
using Siemens.SimaticIT.Handler;
using Siemens.SimaticIT.Unified;
using Siemens.MasterData.prjb.MSModel.DataModel;
using Siemens.MasterData.quality.MSModel.Commands;
using Siemens.MasterData.prjb.MSModel.Events;
using System.Threading.Tasks;
[...]
namespace Siemens.MasterData.prjb.MSModel.Commands
{
/// <summary>
/// Partial class init
/// </summary>
[Handler(HandlerCategory.BasicMethod)]
public partial class NCHandlingHandlerShell
{
/// <summary>
/// This is the handler the MES engineer should write
/// This is the ENTRY POINT for the user in VS IDE
/// </summary>
/// <param name="command"></param>
/// <returns></returns>
[HandlerEntryPoint]
private MyCommandHandling.Response MyCommandHandlingHandler(MyCommandHandling
command)
{
ITracer tracer = Platform.Tracer;
// code for entity instance creation done by means of Submit platform API
var iev = Platform.Create<IMyEntity>();
iev.prop1 = command.input1;
iev.prop2 = command.input2;
// manage an enumeration type
iev.prop3 = Platform.Types.Color.Red;
// .....
Platform.Submit(iev);
Command chains
Opcenter Execution Foundation does not manage direct calls between .NET classes. To invoke logic that is
described inside other parts of your program, you must call a command or raise an event. A command
handler usually contains a sequence of commands that are executed within a single transaction, which may
operate on different entities within the same domain. Since a command may call another command, which may call
another command, and so on, we talk about a chain of commands, or rather, a tree of commands, because from
one command we can send the request to more than one command.
Transactions
Although all commands are defined in the same way, only the first command of the tree is the one that triggers the
entire execution logic. This command is called the root command and determines the scope of the
entire transaction. This means that the entire command tree shares the same transaction scope.
The first invoked command also conveys contextual information that the system uses to execute, or not execute,
the required logic. An example of context could be the identity of the user that is sending the command request.
Inside the same command tree, the identity information is shared among all the steps of the command execution
and is used by the Opcenter Execution Foundation platform to evaluate whether a request can be fulfilled or
not. Command requests performed without identity information will not be processed.
In the command chain, when the root command is launched, all sub-commands in the command chain use the
same transaction. This also applies to the parallel execution of commands within the same transaction.
A root thread is instantiated when a root command execution is required, and this thread is responsible for setting
the correct database connection and database transaction.
Command requests performed without identity information will not be processed.
If you are using remote commands, be aware that this invocation mode is out of the transaction. Refer
to How to Manage Remote Calls for more information.
Optimistic concurrency
Every time a new entity is inserted or updated, a unique version is generated as an attribute of the entity. On any
entity update, a check on the entity version is performed to make sure that the entity has not been modified in the
meantime. To handle possible concurrent transactions which attempt to modify the same piece of data, Opcenter
Execution Foundation applies an optimistic concurrency control, which allows multiple transactions to access the
same data, as it is assumed that data conflicts are rare.
Opcenter Execution Foundation applies the Snapshot Isolation level that prevents from detecting entity changes
performed in other transactions. According to the database management system in use, concurrent transactional
updates are differently handled.
On SQL Server databases, if a transaction attempts to commit modifications to data that have been changed since
the transaction began, the transaction will be roll-backed and an error will be raised.
On Oracle databases, this behavior is not available, and if concurrent transactions are going to modify the same
piece of data, no exception is raised and the changes are applied by the commit operations one after the other.
If the failure occurs in the handler code and the user does not handle it properly, the system does not
execute any retry operation. The result of the command will be completed with a failure indicating the
problem in the handler.
The maximum time that the client (such as either an Event handler, or an SdkLean application or the Service Layer)
could potentially wait for is:
MaxTotalTime = RetryTime(N) + Tout
where:
• N is the maximum number of possible retries (by default 3)
• Tout is the timeout of the last retried command (by default 30 seconds)
The result of this formula, if Tout and N are set to their defaults, is 150 seconds. Note that the maximum total time is
not the sum of the retry times. The formula, which uses N set to a maximum possible value, represents the
maximum time delay that can be scheduled for the command, added to the last possible timeout of the command.
After this time has elapsed, if the client is an SdkLean application or an Event Handler, a UnifiedException is raised.
If you are accessing via Service Layer, you will receive a "500" HTTP status code (Internal Server Error) and the body
of the response will contain the "error.code" field set to "1005".
• If the operation is a not a long-running operation, Opcenter Execution Foundation does not abort the operation
and a check is executed before committing changes to verify whether a transaction error or command timeout
has occurred. If affirmative a rollback operation is performed.
• If the operation is a long-running operation that belongs to either
the IUnifiedSdkInformation and IUnifiedSdkDataReading interfaces (e.g. BulkInsert method), Opcenter
Execution Foundation verifies the timeout during the execution and aborts the operation throwing a
UnifiedException. Commit operations, however, cannot be aborted once their execution has started.
The logic of command timeout management is valid for all commands. Retries are supported for some types of
commands.
A different behavior is applied to the transaction management of composite commands.
• the code that contains the call (i.e. whether you are inside a command handler, an event handler or a Lean Sdk
Client)
• the command type (i. e. whether the command is private or protected)
• the domain of the model you are implementing
If you develop a call to a private command contained in a referenced Functional Block, the system returns
an error at runtime and invalidates the whole transaction. This situation may occur because if you try to
call a referenced private command, Visual Studio Intellisense permits you to browse referenced private
methods and the functional block solution compilation does not return any error, leading you to the idea
that such a call type is possible. The error raises only at runtime, when the worker tries to resolve the call.
To successfully implement command calls, verify that the following references to the assemblies containing the
definitions of the commands have been added to your handlers:
• <Prefix>.<DomainName>.<FunctionalBlockName>.Model.Commands.dll: this is the assembly containing the
definitions of the commands.
using Siemens.SimaticIT.Unified.Common;
using Siemens.SimaticIT.Unified;
[...]
You can use a task to wait for the end of an asynchronous call as follows:
using Siemens.SimaticIT.Unified.Common;
using Siemens.SimaticIT.Unified;
[...]
Remember to properly check and manage responses of command invocations. In particular, pay attention
to unsuccessful responses of sub-Commands.
Workflow
1. Import the Pre-Check Handler.
2. Implement the Handler of the Pre-Check.
3. Build the package.
3. Expand the following folder structure (automatically created at the end of the import procedure):
CommandHandler project\<FunctionalBlockName>.<DomainAcronym>Model\Commands\Pre-
Checks\<BaseCommandName>. Here you will find the imported C# files: <Pre-CheckName>Handler.cs
and <Pre-CheckName>HandlerExecution.cs.
Example
using [...]
namespace [...]
{
[Handler(HandlerCategory.BasicMethod)]
public partial class AlreadyExist_PreCheckHandlerShell
{
[HandlerEntryPoint]
private PreCheckResponse
AlreadyExist_PreCheckHandler(ManageEntityAllProperties command)
{
string trace = $"[ManageEntityAllProperties] - [{"AlreadyExist"}]
{"starting ..."}";
platform.Tracer.Write("Siemens-SimaticIT-Trace-Execution-Engine",
Category.Informational, trace);
var entity = platform.ProjectionQuery<IAllProperties>().FirstOrDefault(x
=> x.propertyString == command.parameterString);
if (entity != null)
{
trace = $"[ManageEntityAllProperties] - [{"AlreadyExist"}] Entity
<{entity.propertyString}> already exists";
platform.Tracer.Write("Siemens-SimaticIT-Trace-Test", Category.Error,
trace);
var response = new PreCheckResponse();
response.SetError(1, $"Entity <{entity.propertyString}> already
exists");
return response;
}
trace = $"[ManageEntityAllProperties] - [{"AlreadyExist"}] {"completed"}";
platform.Tracer.Write("Siemens-SimaticIT-Trace-Execution-Engine",
Category.Informational, trace);
return new PreCheckResponse();
}
}
}
From the code of Pre-Check Handlers you can only execute read operations and access the functionalities exposed
by the IUnifiedPreCheckSdk interface from Protected Commands and the IUnifiedSdkPreCheckComposite
Interface from the Composite Commands, documented in the Opcenter Execution Foundation Platform Reference
Online Help.
The following table sums up the operations that you can execute from the code of a Pre-Check Handler.
Read data from the writing model, if the entity is inside the same domain
Read data from the writing model, if the entity is inside another domain
Read data from the reading model, if the entity is inside the same domain
Read data from the reading model, if the entity is inside another domain
Read data from the reading model, if the entity is inside a user domain, i.e.
legacy system data
Get the properties and the content of the file as a data stream by specifying the
file GUID
Get CommittedEvents
Write data (create, update, delete entity instance), if the domain of the entity
and the domain of the Pre-Check Handler are the same
Write data (create, update, delete entity instance), if the domain of the entity
and the domain of the Pre-Check Handler are different
Write data (create, update, delete entity instance), if the entity belongs to a user
domain
Trigger events
Subscribe to events
Workflow
1. Import the Post-Action Handler
2. Implement the Handler of the Post-Action
3. Build the Package
3. Expand the following folder structure (automatically created at the end of the import procedure):
CommandHandler project\
<FunctionalBlockName>.<DomainAcronym>Model\Commands\PostActions\<BaseCommandName>. Here
you will find the imported C# files: <Post-ActionName>Handler.cs and <Post-
ActionNAme>HandlerExecution.cs.
Thanks to this implementation pattern, you can share manufacturing services among Apps and reduce the
complexity of the relationship build mechanism. This pattern, indeed, improves the development experience,
reducing the effort of the project implementation.
The Service Apps model will be reached by enriching your Apps and Functional Blocks with remote command
invocations and remote entity queries.
Available operations
• How to Manage Remote Calls
• How to Manage Remote Entity Queries
Workflow
To enrich your solution with remote calls, go through the following steps:
1. Create the Remote Artifact project.
2. Create a new class implementing IRemoteCommand.
3. Invoke your Remote Command.
Remember: A Command can be remotely invoked only if it belongs to the Public Object Model of an App/
Extension App.
To explain how remote calls must be implemented, let's introduce two terms: the Target Command and the
Remote Command.
• With Target Command we will refer to the Command that actually performs the business logic, which must be
present in the Public Model of a certain App.
• With Remote Command we will refer to a new wrapper class, namely implementing the IRemoteCommand
interface, which must be built on the basis of the Target Command data structure and is internally used to find
the Target Command.
To properly implement the new class, you must know in advance the structure of the Target Command. Remember
that no intellisense is provided.
The IRemoteCommand interface requires a set of information (such as app name, called ServiceName, the app
version, namely ServiceVersion, and command parameters) that is used by an internal discovery service to address
the call to the correct command.
Remember: To correctly build a Remote Command you must know how the Target Command is modeled.
(*) The service version is a mandatory parameter. If, at runtime, the discovery service does not find the
precise version, it selects the version of the actually deployed app.
For more details, see the error type table below.
When you are invoking a remote command from a SendCommand/CallCommand method, take into account the
following information about how to handle errors:
Invalid App Name Each remote command must be specified along with its name. If you have specified
a wrong app name, an exception of type UnifiedDiscoveryServiceException is
raised.
Invalid App version Each remote command must be specified along with its version. If you have
specified a wrong app version, a warning message is traced with the Event Tracing
for Windows with the Siemens-SimaticIT-Trace-DiscoveryService provider
enabled. In this case, the Remote Command will be invoked anyway.
Invalid Command The remote command must be constructed by specifying the exact command name
contract and parameters names and types. If this is not done, an error is returned where the
IsSucceeded boolean is false and in the error object you will find an error code 6404
with the related error message.
Missing mandatory The remote command must be constructed by specifying the exact parameters
parameters (name, type and value). If this is not done, an error is returned where the
IsSucceeded boolean is false and in the error object you will find an error code 6400
with the related error message.
Invalid Response The remote command must be constructed by specifying also the exact return type.
If this is not done, an error is returned where the IsSucceeded boolean is false and
in the error object you will find an error code 6500 with the related error message.
For diagnostics purposes, you can use the ITracer functionalities: remote invocations propagate the
CorrelationID to the called remote commands (for more information, see Grouping Correlated Messages).
A dedicated trace provider is available to log operations executed by the Discovery Service (Siemens-
SimaticIT-Trace-DiscoveryService). See Choosing Trace Providers.
Remote commands are always out of transaction. This means that, in case of error, no rollback is
automatically performed.
For this reason, we recommend that you use them in a non-transactional context (e.g. in Composite
commands), or in any situation where:
• it is not required an atomic execution of the involved business logic;
• it is possible to deal with the scenario where the same remote call is invoked more than once due to
the retry mechanism of a command handler execution in case of commit failure.
In future implementations, Foundation will provide compensation logics that are now in charge of the
user.
Compensation logic, which is now under the user responsibility, are planned for future implementations.
Workflow
To enrich your solution with queries on remote entities, go through the following steps:
1. Create or enrich the Remote Artifact project.
2. Create a new class implementing IRemoteEntity.
3. Query your remote Entity.
Remember: An Entity can be remotely queried only if it belongs to the Public Object Model of an App/
Extension App.
To explain how remote queries must be implemented, let's introduce two terms: the Target Entity and the Remote
Entity.
• With Target Entity we will refer to the Entity that actually models the needed information, which must be
present in the Public Model of a certain App.
• With Remote Entity we will refer to a new wrapper class, namely implementing
the IRemoteEntity interface, which must be built on the basis of the Target Entity data structure and is
internally used to find the Target Entity.
To properly implement the new class, you must know in advance the structure of the Target Entity. Remember that
no intellisense is provided.
The IRemoteEntity interface requires a set of information (such as app name, app version and entity name) that is
used by an internal discovery service to run the query by means of the correct entity. Additionally, you must also
specify the entity properties that you want to be filled in with the related query results.
Remember: To correctly build a Remote Entity you must know how the Target Entity is modeled, but
unlike remote commands (for which an exact mapping between target and remote command parameters
is required) here you only need to declare the properties whose values you want to retrieve.
(*) The service version is a mandatory parameter. If, at runtime, the discovery service does not find the
precise version, it selects the version of the actually deployed app.
Adapt the following example to properly implement an IRemoteEntity class and declare only the properties whose
values you want to retrieve (i.e. not necessarily all values that have been defined at target entity level:
Detail of the StatusType property in the Remote Entity class. We suggest that you create a dedicated .cs file to
define the StatusType Value Type.
• $filter, used to specify a filtering where clause, for example: { "filter", "Name eq 'Matxx'"},
• $orderby, used to order the returned data, such as for example in ascending or descending mode, for example:
{ "orderby", "Name desc"},
• $top, used to return only the specified number of records, for example: { "top", "10"},
• $skip, used in conjunction with the top option to paginate data records, for example: { "skip", "10"}.
Unlike the remote command invocations, for which you have a Response class that returns information related to
the command execution and the execution error, the GetRemotEntities method returns either an IQueryable type
of the entity you have specified, or throws an exception (UnifiedRemotingException). This exception does not
invalidate the Handler execution.
If an event handler is removed from the model, you must manually delete the corresponding C# class,
otherwise it will be included in the App manifest.
Prerequisite
The manual procedure must not be used as an alternative to the Import from Model command, as when
event handlers are added manually it will then also be necessary to manually import the relative manifest
and .dll files.
Read data from write model, if the entity is inside the same domain
Read data from write model, if the entity is inside another domain
Read data from read model, if the entity is inside the same domain
Read data from read model, if the entity is inside another domain
Read data from read model, if the entity is from a user domain
Write data (create, update, delete entity instance), if the domain of the entity (if
and the domain of the command/event are the same and the Functional the entity is not
Blocks are different. restricted)
Write data (create, update, delete entity instance), if the domain of the entity
and the domain of the command/event are different
Write data (create, update, delete entity instance), if the entity belongs to a
user domain
Trigger events
Subscribe to events
Examples
The event handler below implements the code for an event, defined as follows:
using Siemens.SimaticIT.Unified.Common;
using Siemens.SimaticIT.Unified.Lean;
[...]
namespace MyDomain.MySubDomain
{
/// <summary>
/// Class initialize
/// </summary>
public partial class MyEventHandlerShell : IEventHandler
{
private IUnifiedSdkEvent Platform;
/// <summary>
/// Execute
/// </summary>
/// <param name="unifiedSdk"></param>
/// <param name="evt"></param>
/// <param name="envelope"></param>
/// <returns></returns>
public void Execute(IUnifiedSdkEvent unifiedSdk, IEvent evt, EventEnvelope
envelope)
{
this.Platform = unifiedSdk;
MyEventHandler((MyEvent)evt, envelope);
}
/// <summary>
/// Retrieve the type of the event
/// </summary>
public System.Type GetEventType()
{
return typeof(MyEvent);
}
}
}
using Siemens.SimaticIT.Unified.Common;
using Siemens.SimaticIT.Handler;
using Siemens.SimaticIT.Unified.Lean;
[...]
namespace MyDomain.MySubDomain
{
/// <summary>
/// Partial class init
/// </summary>
[Handler(HandlerCategory.Event)]
public partial class MyEventHandlerShell
{
/// <summary>
/// This is the Event handler the MES engineer should write
/// This is the ENTRY POINT for the user in VS IDE
/// </summary>
/// <param name="evt"></param>
/// <param name="envelope"></param>
/// <returns></returns>
[HandlerEntryPoint]
private void MyEventHandler(MyEvent evt, EventEnvelope envelope)
{
// Put your code before the CallCommand
MyOtherCommand.Response res = Platform.CallCommand<MyOtherCommand,
MyOtherCommand.Response>(new MyOtherCommand { ParamOfMyOtherCommand =
command.InfoParameter1 });
var localVariable = res.OutputParamOfMyOtherCommand;
// Put your code after the CallCommand
Platform.Tracer.Write("Siemens-SimaticIT-Trace-BusinessLogic",
Siemens.SimaticIT.SDK.Diagnostics.Common.Category.Informational,
"My local variable value is {0}",
localVariable);
}
}
}
This second option offers a higher communication reliability than the first, because if the host of the worker process
fails, this option ensures a retry execution of the Event Handler.
Since events are used as a decoupling mechanism for the business logic (i.e. there is no response sent to the
sender), the Platform considers completed those Event Handlers that fail for unhandled exceptions. Only
infrastructure failures are covered for reliability. User code that raises exceptions during the processing should be
fixed in order to avoid losing data.
If you use the IUnifiedSdkLean interface to subscribe to an event, you can set the acknowledgement mode of the
executed callback code within the Subscribe method signature by choosing a deferred acknowledgement
(acknowledgment notified after a successful callback execution) instead of an immediate acknowledgement
(delivered at the beginning of the callback execution).
If you use the Solution Studio standard subscription functionality, you can leverage a similar behavior by setting the
IsReliable attribute in Project Studio.
The IsReliable attribute modifies the mechanism of the execution acknowledgment for the Event Handlers and
consequently the moment in which Events are completely handled.
Be aware that the use of the IUnifiedSdkLean interface with multiple user callbacks, which are subscribed to the
same event, does not prevent these callbacks from being re-executed if a failure occurs in between.
On the other hand, if you configure the IsReliable attribute on events that are subscribed to multiple Event
Handlers inside workers, the Platform correctly manages the Event Handlers as follows: the completed Event
Handlers are not re-executed if they have been completed before the failure, while Event Handlers that abort during
the failure are re-executed from the beginning (see note below).
using Siemens.SimaticIT.Unified.Common;
using Siemens.SimaticIT.Unified;
[...]
You should not modify the event and the envelope to be sent after you have called the FireEvent/
FireEventOnCommit methods, because these changes could modify the payload of the triggered event.
This could happen, for example, if you send multiple events using a loop and if you re-use the same event
and envelope class instances to specify different values. See code examples for the IUnifiedSdk Interface of
the Opcenter Execution Foundation Platform Reference Online Help.
Event validation
When you raise an event, you do not receive any response from the subscriber, apart from a successful reply when
the message arrives at the Manufacturing Service Bus.
If you set validation attributes on the event parameters, when you fire an event the provided values will be
validated accordingly (as it happens for commands). A failure in this validation will return an execution
fail (i.e. System.ComponentModel.DataAnnotations.ValidationException).
Event envelope
The FireEvent method and the FireEventOnCommit method contain an optional input parameter, the envelope
parameter, which defines the properties of the event instance.
When you raise the event, you can specify the event instance you are firing through the properties of the envelope
object, which is described by the EventEnvelope Class of the Opcenter Execution Foundation Platform Reference
Online Help.
The envelope object properties can be used to filter on events by setting filters at event subscription level.
Examples
using Siemens.SimaticIT.Unified.Common;
using Siemens.SimaticIT.Unified;
[...]
• If editing is restricted you can create, update or delete instances of entities only by using the commands from
the same Functional Block as the entity.
• If editing is not restricted you can create, update or delete instances of entities with commands from different
Functional Blocks, as long as both Functional Blocks belong to the same domain.
The Restricted flag is set to true by default when the entity is created, but can be modified during the
creation phase.
To instantiate entities you can only use the platform Create method. If you use standard C# instantiation methods,
the command execution will return an error.
To create an entity instance, you must work with the Opcenter Execution Foundation writing model, which is
exposed through the entity interfaces. Consequently, you have to call the Create method by specifying the interface
type (an underlying class instance will be generated, see TypeMapper).
You can retrieve the interface type through the RetrieveQueryTargetType method, and providing as an
input parameter either the logical name used in Project Studio for the entity (<namespace>.<entity-
name>) or the full interface name (<namesapce>.<interface-name>).
After the Create method, you can manipulate the entity instance and then call the Submit method in order to
persist the entity on the database. This method submits the entity instance to the command handler context and
makes it available to the other commands of the same transaction. The Submit method persists the specified entity
along with all the entities present in the graph to which the specified entity belongs (i.e. if you submit an entity and
its forward and/or backward navigation properties point to other entities, they will be persisted, too). The
submitted entities will be visible outside the transaction after the commit operation, which is implicitly performed
after the end of each root command. Bear in mind that when removing a child from a parent, the graph of the
parent entity will no longer have any references to the child. Since the information about the link between children
and parents is persisted on the database within the children records, it is necessary to submit the child explicitly
(for examples, see Adding and Removing Navigation Properties).
To read from the just created instance, you can use the Query method, which reads only from the writing model,
inside the transaction, inside the same domain. If you try to do the same with the ProjectionQuery method, you
cannot retrieve any data from the just created instance.
The Create method has an override method which allows you to create multiple instances at the same time. It
accepts in input the interface type and the number of instances you want to create, and returns a list of IEntity
types. This list of IEntity types can be passed in input to the bulk insert method for multiple entity creation.
When you update an entity instance through the Submit method, Opcenter Execution Foundation updates the row
version within the database and updates the cache of the command (i.e. the chain of commands that refer to a root
command). The row version is internally used for data integrity check in optimistic concurrency while the cache
allows you to execute quick queries without querying the database. For this reason, the cache is also refreshed with
the data returned by the GetEntity method each time you invoke it (see the Opcenter Execution
Foundation Platform Reference Online Help). The GetEntity public method is provided with two overload methods:
the first method accepts in input the Id of an entity instance and it should be used each time you want to perform a
query by Id, the second method accepts in input the entity logical key. Both methods search first inside the cache
and then, only if no results are found, inside the database.
CreateUoMCategory Input: NId (string) Natural key identifier. This property is flagged
as a LogicalKey, so if another UomCategory
with the same NId is already present, the
creation operation will fail.
using Siemens.SimaticIT.Handler;
using Siemens.SimaticIT.Unified.Common;
using Siemens.SimaticIT.Unified;
[...]
/// <summary>
/// This is the handler the MES engineer should write
/// This is the ENTRY POINT for the user in VS IDE
/// </summary>
/// <param name="command"></param>
/// <returns></returns>
[HandlerEntryPoint]
private CreateUoMCategory.Response CreateUoMCategoryHandler(CreateUoMCategory
command)
{
IUoMCategory uomCategory =
Platform.Query<IUoMCategory>().SingleOrDefault(x => x.NId == command.NId);
if (uomCategory != null)
{
return new CreateUoMCategory.Response{ Error = new ExecutionError(-1,
"already exists") };
}
uomCategory = Platform.Create<IUoMCategory>();
uomCategory.NId = command.NId;
uomCategory.Name = command.Name;
uomCategory.Description = command.Description;
Platform.Submit(uomCategory);
return new CreateUoMCategory.Response { UoMCategoryId = uomCategory.Id };
}
This example shows how you can update an instance of the UoMCategory entity by means of
the UpdateUoMCategory command defined as follows:
using Siemens.SimaticIT.Handler;
using Siemens.SimaticIT.Unified.Common;
using Siemens.SimaticIT.Unified;
[...]
/// <summary>
/// This is the handler the MES engineer should write
/// This is the ENTRY POINT for the user in VS IDE
/// </summary>
/// <param name="command"></param>
/// <returns></returns>
[HandlerEntryPoint]
private UpdateUoMCategory.Response UpdateUoMCategoryHandler(UpdateUoMCategory
command)
{
IUoMCategory uomCategory =
Platform.Query<IUoMCategory>().SingleOrDefault(x => x.Id == command.Id);
if (uomCategory == null)
{
return new UpdateUoMCategory.Response { Error = new
ExecutionError(-1, "does not exist") };
}
if (command.Name != null)
{
uomCategory.Name = command.Name;
}
if (command.Description != null)
{
uomCategory.Description = command.Description;
}
Platform.Submit(uomCategory);
return new UpdateUoMCategory.Response();
}
For code examples, see Delete and BulkDelete methods in the Opcenter Execution Foundation Platform
Reference Online Help.
If you query on the child side, the query will be faster because the related item will be always only one (see
section Adding an entity by using back-navigation properties below).
To remove relationships, you cannot use the Clear method. Use either of the Remove method as shown
below.
If you know the Id of the parent entity, you can use “myChild.ParentNav_Id = myParent.Id;" instead of
“myChild.ParentNav = myParent;”. This latter way is faster because you do not need to Query the parent.
If the parent entity has a back-navigation property towards its children, the back-navigation property is
automatically aligned when executing “myChild.ParentNav = myParent;” and so, even if you replace
“Platform.Submit(myChild);” with “Platform.Submit(myParent);” you reach the same goal because the parent
entity represents a graph containing its children (that will be submitted together with the parent).
Here the Submit method submits both the parent and the child because the Submit method submits all the entities
belonging to the graph which is passed as argument to the method; indeed, the parent entity, which is passed to
the Submit method, has a link to the child entity (through the back-navigation property).
Platform.Submit(facet); // or Platform.Submit(myEntity);
If you want to link a facet to a parent entity by using the forward-navigation property, you can use the following
snippet of code:
Platform.Submit(facet);
If you remove a facet from an entity and then you submit the facet, the facet remains orphan (i.e. it can be linked to
another entity).
To remove a facet, you can write the following snippet of code:
Platform.Submit(facet);
Platform.Submit(facet);
To remove relationships, you cannot use the Clear method. Use either of the removal methods as shown
below.
platform.Query<Siemens.SimaticIT.SystemData.Foundation.DataModel.ProjectionModel.ISeg
regationTag>();
myTeam.SegregationTags.Add(segregationTag);
Platform.Submit(myTeam);
To remove data segregation tags you cannot use the Clear method. You can create a loop after materializing the
data segregation list as follows:
Attribute Description
IsFrozen Frozen instances are visible in the database and can be queried and deleted
but cannot be updated.
The IsFrozen attribute of Instances is set to true with the Opcenter EX
FN IUnifiedSdk Interface Freeze method and subsequently set to false if
necessary with the Unfreeze method.
The IsFrozen attribute is independent from the IsLocked and IsCurrent
properties, which are part of the Revision behavior.
The Freeze/Unfreeze methods are also provided with overload methods
which use the type and Id of the entities to be frozen/unfrozen. The Ids can be
directly passed in by means of a LINQ query expression as an input parameter
for the method. These methods are much faster than the Freeze/Unfreeze
methods which work on single instance, because only a single round-trip is
required on the database.
Attribute Description
IsDeleted Deleted instances are no longer visible and cannot be queried or modified, but
are present in the database.
The Opcenter EX FN IUnifiedSdk Interface Purge method can physically remove
all logically deleted instances, which were deleted prior to the date set in the
beforeDate property of the method.
The Purge method is domain specific, and cannot be used cross-domain.
Info on Purge
• If a logically deleted entity is physically deleted with the Purge
method, all its related entities are also physically deleted,
regardless of the delete behavior specified in the relationship (e.g.
OnDeleteSetNull, OnDeleteNoAction or OnDeleteCascade).
• The Purge method is transactional on each single entity.
Consequently, a rollback operation will be performed only on the
instances of the entity for which the method failed or timed out.
• Indexes should be recreated after purging operations.
• When the IsDeleted attribute of an entity is greater than 0 (i.e.
true) the entity will not be visible or queryable in the database,
but this attribute will be used by the Purge method to physically
delete the entity from the database.
ToBeCleaned Instances marked for cleaning are still visible but cannot be modified or
deleted, until they are eventually physically removed by the maintenance.
The user can set the ToBeCleaned flag according to their maintenance policy,
using the MarkForCleaning method of the Opcenter EX FN IUnifiedSdk
Interface.
The MarkForCleaning method is limited to Master Data Domain and
Operational Data Domain.
The BulkMarkForCleaning method uses the type and Id of the entities to be
marked for cleaning. The Ids can be directly passed in by means of a LINQ
query expression as an input parameter for the method. This method is much
faster than the MarkForCleaning method which works on single instance,
because only a single round-trip is required on the database.
Available operations
Attribute Value Can submit Can logically Can purge Can mark Can copy
delete for
cleaning
IsFrozen true
IsFrozen false
IsDeleted 0 (false)
IsLocked true
IsLocked false
ToBeCleaned true
The operation is never possible on instances with the attribute set as specified.
The operation may be possible on instances with the attribute set as specified, if no other attributes in
this table prevent it.
The operation is possible but has no effects.
Attribute inheritance
The attributes are inherited according to the following logic:
Derived entity instances Derived entity instances are not linked to the root
entity and IsFrozen, IsDeleted and ToBeCleaned
attributes are not inherited from any entity.
Constraints
• The entity must belong to the Master Data domain.
• The entity must be a base entity.
• You must assign a logical key to the entity. This check is carried out when the model is built.
Revision Properties
When an entity is flagged as Revision four properties will be automatically added to the class of the entity when the
model is built.
These properties can only be modified by specific Opcenter EX FN Platform methods, exposed by the IUnifiedSdk
interface (for more information see the Opcenter Execution Foundation Platform Reference Online Help).
The IsCurrent and IsLocked properties are independent from the IsFrozen attribute, which is part of the
entity life cycle attributes.
The IsLocked and IsCurrent properties can both be set to true for the same entity, consequently not
allowing any changes to be made to the current revision.
Examples of use
The following is an example of the management of a Master Data entity, with the Revision behavior:
• Creating the MaterialDefinition entity
• Locking the MaterialDefinition entity
• Copying the MaterialDefinition entity
• Setting the MaterialDefinition entity to IsCurrent
Creating the MaterialDefinition entity
///example of code meta language, where Id is the unique identifier of the single
instance
///example of code meta language, where Id is the unique identifier of the single
instance
LockMaterialDefinitionRevision(Id)
{
var p = Platform.Query<IMaterialDefinition>(x => x.Id == Id);
Platform.Revision.Lock(p)
}
///example of code meta language, where Id is the unique identifier of the single
instance
CopyMaterialDefinitionRevision(Id,NewRevision)
{
Platform.Revision.AddNewRevision<IMaterialLot>(Id, NewRevision);
}
This AddNewRevision method copies all the properties as they are, changing only the SourceRevision and
Revision properties.
Setting the MaterialDefinition entity to IsCurrent
///example of code meta language, where Id is the unique identifier of the single
instance
SetCurrentMaterialDefinition(Id)
{
var p = Platform.Query<IMaterialDefintion>(x->x.Id equals Id);
Platform.Revision.SetCurrent(p)
}
If you consider the example of a data model containing Lot, ExtendedLot, ExtendedExtendedLot, and you call the
Create<ILot> method, the method can return an instance of Lot, ExtendedLot or ExtendedExtendedLot since they
all implement the ILot interface. The choice of the correct class is based on the TypeMapper and the instructions
defined by the user.
TypeMapper customization
You can customize the default behavior of the TypeMapper by using two methods: RegisterMapping and
ResetMappings .
With the RegisterMapping method you can call the Create method on a certain entity and use it to actually create
the instance of another entity.
As an example, we may have EntityB that derives from EntityA.
RegisterMapping<IEntityA, IEntityB> modifies the TypeMapper behavior so that the Create method will return
an EntityB instance even if IEntityA was specified.
If you call the ResetMappings method you will remove all customizations that have been specified inside the
current command. In this way, you will return to the previously defined value, which could be either the default
configuration of the TypeMapper or the TypeMapper configuration that has been set in the caller command.
The configuration of the TypeMapper is always propagated to the sub-commands, if these are called.
The RegisterMapping<T, K> method has a non-generic corresponding method: RegisterMapping(type entityA,
type entityB) which works in the same way.
Product, Libraries and Project Functional Blocks define respectively Lot, ExtendedLot, ExtendedExtendedLot.
Libraries and Project extend the base entity by inheriting properties from the upper layer.
The following pseudo-code describes how to implement the entity creation:
CreateLotCommand
{
CreateInstanceOfLot.
SetLotProperties.
SubmitLot.
}
CreateExtendedLot
{
Call CreateLotCommand.
SetNonInheritedExtendedLotProperties.
SubmitExtendedLot.
}
CreateExtendedExtendedLot
{
Call CreateExtendedLotCommand.
SetNonInheritedExtendedExtendedLotProperties.
SubmitExtendedExtendedLot.
}
The command chain contained in this example demonstrates that only the command associated to the base entity
(Lot) actually creates the entity.
Code example
The following example shows how to use the TypeMapper to create an extended entity, using the create commands
of the base entity.
In this example:
• Lot has two properties: Name and Quantity.
[HandlerEntryPoint]
private CreateLot.Response CreateLotHandler(CreateLot command)
{
var lot = Platform.Create<ILot>();
lot.Name = command.LotName;
lot.Quantity = command.LotQuantity;
Platform.Submit(lot);
[HandlerEntryPoint]
private CreateExtendedLot.Response CreateExtendedLotHandler(CreateExtendedLot
command)
{
Platform.RegisterMapping<ILot, IExtendedLot>();
var lotId = Platform.CallCommand<CreateLot, CreateLot.Response>(new
CreateLot(command.Name, command.Quantity).Id;
var lot = Platform.GetEntity<IExtendedLot>(LotId);
lot.Description = command.Description;
Platform.Submit(lot);
[HandlerEntryPoint]
private CreateExtendedExtendedLot.Response
CreateExtendedExtendedLotHandler(CreateExtendedExtendedLot command)
{
Platform.RegisterMapping<ILot, IExtendedExtendedLot>();
var lotId = Platform.CallCommand<CreateExtendedLot,
CreateExtendedLot.Response>(new CreateExtendedLot(command.Name, command.Quantity,
command.Description).Id;
var lot = Platform.GetEntity<IExtendedExtendedLot>(LotId);
lot.ExpirationDate = command.ExpirationDate;
Platform.Submit(lot);
Copy method
The method returns the Id of the new entity:
Where:
• entityType is a C# type
• entityId is the Guid of the entity to be copied
• PropertyValuesSpecification type is created as an instance of a new Sdk class, which contains the name and
value of each property to be modified.
There is also a generic version of the Copy method with the following parameters:
The new logical key of the composite entity is then added to the logical key of its part entities as a foreign key. Since
the logical key of the composite entity is part of the unique contraint of each part entiy, there is no need to re-define
any unique values of the part entities.
If the copied part entity has navigation properties for relationships that do not belong to the composition, the link
to the orignal entities is maintained, but a new copy of the linked entities is not created.
You cannot perform a Copy operation starting from the part entity in a composition relationship.
Description String
Description String
Description String
You have a command (CreateMaterialDefinition) that will be used to create the entity instance and its facets.
// OR
// Add facets to entities using forward-navigation properties
// designator1.MaterialDefinition = matDef1;
// matRef.MaterialDefinition = matDef1;
// designator2.MaterialDefinition = matDef2;
Platform.Submit(matDef1);
Platform.Submit(matDef2);
Removing facets
A facet is automatically deleted if you delete the entity to which the facet belong. If you want to delete a facet
manually, you can call the Delete method of the UnifiedSdk interface (e.g. Platform.Delete(myFacet)).
2.1.3.6.9 Inserting Multiple Entity Instances via Bulk Insert and Bulk Import
You can insert multiple entity instances through the following methods, exposed by the IUnifiedSdk public
interface: BulkInsert and BulkImport.
BulkInsert method
The BulkInsert method can be invoked from a command handler (the method is transactional) but it is not
available for Lean applications (IUnifiedSdkLean) or from event handlers (IUnifiedSdkEvent interface) .
Unlike the Submit method, it does not execute update operations: it only inserts new entity instances.
The accepted input for the BulkInsert method is a list of IEntity types (List<IEntity>) as well as an option regarding
the operation type. The list of entities is returned by the override Create method. The options, which are applicable
only on MS SQL Server, allow you to choose between setting a table lock or a row lock during the bulk insert (see MS
SQL Server documentation for further explanations). A row lock is suitable if the system must keep running and
there are other actors who are writing on the destination tables; whereas a table lock is more appropriate if the
destination tables are used by concurrent bulk-inserts and there are no other actors writing on the destination
tables.
If you want to insert multiple objects that have relationships with other objects, the method first inserts all root-
level objects (i.e. the objects without parent entities) and then the objects that have dependencies with the already
inserted objects. During this operation, the method groups and inserts objects of the same type and then their
children (while the Submit method inserts each object and its related objects within the same workflow).
Consequently, it is particularly advantageous to use the BulkInsert method if you need to insert a considerable
number of instances of the same entity type with relationships with other entities. This operation can also be
performed when the root-level object is in Frozen status.
The method returns an error if you try to update an already existing root entity. If a child entity already exists, the
method skips it without returning any errors.
At the end of the BulkInsert operation, the CommittedEvent is fired with the following characteristics: the Tag
property of the envelope object (instance of EventEnvelope class) is set to Bulk and the return argument payload is
empty. To retrieve the event payload, specific methods are available (see CommittedEvent details).
After using the BulkInsert method, the row version of the entity instance is not automatically updated in the
command cache (in this same way as the Submit method). Consequently, if you need to submit an updated entity
instance directly after a BulkInsert, you must first requery the entity instance you want to modify.
The following code snippet shows a partial example of how to call the BulkInsert method. This example considers
that there is a back-navigation on the Material Class and consequently it is sufficient that you invoke the BulkInsert
on the IMatClass to automatically insert the linked Material Definitions.
BulkInsert method
BulkImport method
The BulkImport method inserts or updates a list of entities specified in input through a list (IEnumerable) of IEntity
types in the database.
The method is transactional and can be invoked only from the code of Command Handlers.
Unlike the BulkInsert method, which fails if the entity already exists in the database, the BulkImport method
checks whether an entity, with the same logical key, is already present, and if so, it updates all its property values
(excluding internal systems fields). If the target entity to be updated does not contain the logical key, the method
cannot update its records (and thus it only appends values on new rows).
The method fails by default if you try to update an entity instance which is flagged as frozen, locked or marked to
be cleaned (ValidationOption is set to Managed). If you want to update an entity instance flagged as frozen,
locked or marked to be cleaned, the ValidationOption of the BulkImport parameter must be set to Unmanaged.
If the target entity to be updated contains many-to-many relationships that are not included in the source entity,
the method does not delete this piece of information, but simply adds/updates the specified values (i.e. BulkDelete
+ BulkInsert <> BulkImport).
If you set the FacetOption of the BulkImport parameter to Replace, all the facets of the target entity to be updated
will be removed and replaced by the facets of the imported entity. If you choose Append as parameter option value,
all facets of the imported entity will be added to the facets of the existing entity.
If you set the M2MOption of the BulkImport parameter to Replace, all the many-to-many relationships of the
target entity to be updated will be removed and replaced by the many-to-many relationships of the imported
entity. If you choose Append as parameter option value, all many-to-many relationships of the imported entity will
be added to the many-to-many relationships of the existing entity.
If you set M2MOption of the BulkImport parameter to ReplaceSegregationTag, all the segregation tags of the
target entity to be updated will be removed and replaced by the segregation tags of the imported entity.
After using the BulkImport method, the row version of the entity instance is not automatically updated in the
command cache (in this same way as the Submit method). Consequently, if you need to submit an updated entity
instance directly after a BulkImport, you must first requery the entity instance you want to modify. Keep in mind
that primary key and foreign key properties are not aligned on the instances after a bulk import operation is
occurred.
• You can invoke a BukImport and then a Submit operation (in the same transaction) only if:
• the Submit and BulkImport involve different entity types,
• the Data Segregation is not active.
If the entities involved by BulkImport and Submit are the same, or if the Data Segregation is active,
the runtime execution returns an error. In this last case, you should either repeat
the BulkImport method to update previously inserted records, or update and submit the record in a
separate transaction.
• If you invoke the BulkImport on an audit trail relevant entity type, the BulkImport will behave as
follows:
• in case of inserted entity, all information is traced (with action set to added)
• in case of updated entity, the oldValue is always set to null (with action set to modified)
Workflow
All Opcenter EX FN machines that remotely connect to a SQL Server instance must be able to ping the SQL
machine by its hostname and IP address.
The following sections describe how you can manage files-to-entity associations in the data model and how you
can access the file repository once your solution has been deployed, by using a Functional Block Command (not a
Composite Command). Even if the APIs are available in a Composite Command Handler for creating a file/folder
directly, the association of the file to an entity is possible in a Functional Block Command only.
1. Data modeling
2. Command Handler implementation
3. File entity exposition on the Service Layer
4. UI project implementation
Data modeling
For each file you want to upload to the file store, you must create at least the following data model objects:
• an entity, which contains a FileType property defined as a value type.
• a Command, which contains at least two input parameters: a parameter defined as Blob type, and another
parameter representing the MIME type. The Blob system type will contain the file binary data. The MIME
type represents the file type. The possible values of MIME types are available on internet (for example at http://
www.freeformatter.com/mime-types-list.html). This Command can be invoked from the client side in order to
transmit a byte array, which will be internally handled in a temporary file store (System File Store) to optimize
performance.
Example
The model project contains an entity (PnDefect) and a Command (AssignDefectImg).
The PnDefect entity is decorated by the following properties:
• defectImg, which is a FileType system value type
• pnCode, which is a string
var p = Platform.Create<IPnDefect>();
p.pnCode = pn_code;
p.defectImg.Id = img_guid;
Platform.Submit(p);
return new AssignDefectImg.Response() { };
}
else
{
// Part Number Code not found
return new AssignDefectImg.Response()
{
Error = new ExecutionError(-1, "Part number code not valid: " +
command.pnCode)
};
}
If the Data Segregation functionality is enabled, you can segregate the documents attached to an entity. The class
defining a document (Content) has been extended by adding the TagsNamesToAssociate property. This property
defines a list of tags that allows you to associate segregation tags to an instance/document. About its value:
• If the value is "null", then the system associates the selected tags of the current session to the document by
default.
• If the value is empty, no tags are associated to the document.
• If the value contains tags, then the system associates these tags the document.
When interactive users run queries from the Service Layer, they can see the documents only if they have the tags
associated to the document.
child.Parent_Id = parentId;
If you do not have the Id of the parent entity, the following strategy would be still quite fast:
But if you use the Include method as in the following code snippet, the time execution would be extremely slow
because the method actually retrieves all the data from the table of the related entities:
If you want to associate entities that have a many-to-many relationship, you must always use the Include method.
Nevertheless, if you apply this method to the property that contains less elements, the code execution could be
extremely fast anyway. If we consider a relationship between some Users entities and Groups entities, we can
assume that a User entity will belong to few Groups entities while a Groups entity may contain a lot of Users.entities.
Consequently, the following piece of code:
because in the former example the Include method retrieves a few amount of data while in the second example it
retrieves a lot of data.
3. Compile the model project, import the handler class of MyCommand and implement the logic of the
MyCommand command.
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Siemens.SimaticIT.DSL.Common;
using Siemens.SimaticIT.Unified.Common;
namespace TypeAliasDoc.MasterData.FBTADoc.MSModel.Commands
{
/// <summary>
/// My Command with TypeAlias
/// </summary>
[UnifiedAccessibility(true)]
/// <summary>
/// My Input with TypeAlias
/// </summary>
/// <summary> TypeAliasDoc.MasterData.FBTADoc.MSModel.Types.MyString
</summary>
[Siemens.SimaticIT.DSL.Common.UnifiedTypeAlias(typeof(MyCommand),
"Input1", "TypeAliasDoc.MasterData.FBTADoc.MSModel.Types.MyString")]
[Required()]
[MaxLength(10)]
public string Input1 { get; set; }
.....
}
}
Limitations
You cannot directly modify the annotations within the object instance that uses the TypeAlias (for
example, in the property of a command parameter), but you must modify it in the type alias definition
(TypeAlias).
A TypeAlias cannot be part of a logical key.
If you use an annotation that cannot be used inside a certain context, the system will allow you to define
the annotation in the TypeAlias definition, but will return an error when you will actually use it in a certain
object instance (for example, you can set the default annotation on the TypeAlias but when you try to use
it in a command you will receive an error).
DataSegregationTags string A JSON representing the list of the tags for each entity
instance.
Empty CommittedEvents
The CommittedEvent is fired as an empty structure in the following cases:
• after you have used the Query() method,
• if you have performed a creation and then a deletion of the same entity within the same transaction.
In these cases, Entities and Relations empty parameters are serialized as empty lists.
The described JSON elements are based on an example. This example shows the CommittedEvent that would be
fired if you committed two entities (IEntity1 and IEntity2), linked through a many-to-many relationship,
and containing the following set of properties:
The following JSON example is returned if you create two entities and then freeze one of them:
The following JSON example is returned if you freeze an entity that has a related entity in composition (the action of
freezing is applied on all child entities in cascade):
The following JSON example is returned if you freeze and lock an entity:
The Entities object will return only the entity Id and the entity type if you have performed one of the following
operations on an entity: delete, freeze, unfreeze, lock, unlock, mark for cleaning:
If the deleted entity has related entities, the Relations object returns additional information (see below).
If you have deleted an entity with one-to-many relationships with OnDeleteSetNull delete option selected, this
element returns a set of information with the following format:
The envelope, on which you can set a filter, associated with the CommittedEvent contains the following
parameters:
Tag string The returned value is set either to Standard (if the event
is fired at the end of a standard submit operation), Bulk
(if the event is fired at the end of a bulk insert/import
operation) or Import (if the event is fired at the end of an
Import data operation).
GetCommittedEvent() This method retrieves a specific event associated with a certain event
identifier (SessionId) and the related data domain. The sessionId is
always related to a specific data domain and cannot be defined
as Guid.Empty. If you specify a data domain that does not correspond
to the data domain in which the event was actually fired, the system
raises an exception. The DataDomain parameter can assume one of
the three values defined in the EntityDomain class
(ReferenceData, MasterData, OperationalData).
For bulk insert, bulk import ad import data operations, this
method also returns the event payload (i.e. it also returns
the Relations and the Entities serialized objects).
GetCommittedEvents() This method retrieves the list of events that have been fired after a
certain event. This method could be useful if you want to implement
logic that retrieves all fired events at the startup of a client application,
or for example, if during system down time you were not notified of
CommittedEvents for a brief period. This method accepts the same
input parameters as
the GetCommittedEvent() method: SessionId and DataDomain.
The platform also offers an overload method which accepts in input
the PageSize parameter. This parameter specifies the maximum
number of the CommittedEvents you want to receive. Indeed, if the
number of the events were excessively high, performance issues might
be encountered. This method allows you to opportunely manage this
problem.
For bulk insert, bulk import ad import data operations, the returned
events have empty payloads (i.e. they do not contain the Relations or
the Entities objects).
GetCommittedEventsInRange() This method retrieves the list of events that have been fired between
two known event identifiers. This method can be useful for example for
recovery use cases, if any events are missing in the retrieved sequence
(see Ordering parameter). If in the specified range there are one or
more events that have not been fired yet, the method returns an
exception.
The method accepts three input parameters: the first
two SessionId parameters contain the identifiers of the first and the
last event in the range, and the DataDomain as explained for
the GetCommittedEvent() method.
For bulk insert, bulk import ad import data operations, the returned
events have empty payloads.
If a CommittedEvent has been fired for a bulk operation, this means that for the given transaction there
may have been many submit operations but there must have been at least one bulk operation.
To use these methods from a client application developed through the IUnifiedSdkLean, remember that
the interactive user who will run the application must belong to the SIT_UNIFIED_LOW user group.
Further technical details are provided in the Opcenter Execution Foundation Platform Reference Online
Help.
// How to extract an element from the relation list and all of its properties
var relations = JArray.Parse(committedEvent.Relations);
var selectedRelation = relations[0];
var action = selectedRelation["Action"];
var id1 = selectedRelation["Id1"];
var id2 = selectedRelation["Id2"];
var typeName1 = selectedRelation["TypeName1"];
var typeName2 = selectedRelation["TypeName2"];
The data model of the MasterData domain has been defined as follows:
public partial class CreateLotHandlerShell { /// <summary> /// This is the handler
the MES engineer should write /// This is the ENTRY POINT for the user in VS IDE ///
</summary> /// <param name="command"></param> /// <returns></returns>
[HandlerEntryPoint] private CreateLot.Response CreateLotHandler(CreateLot command)
{ var matdef = Platform.ProjectionQuery<IMaterialDefinition>().SingleOrDefault(x =>
x.Name == command.LotMaterial); var uom =
Platform.ProjectionQuery<IUoM>().SingleOrDefault(x => x.Name == command.UoM); var
mylot = Platform.Create<IOperationalLot>(); mylot.NId = command.LotCode;
mylot.MaterialDefinition.MatDefVT_MatDef = matdef.Id;
mylot.MaterialDefinition.MatDefVT_Name = matdef.Name; mylot.UOM.UoMVT_UoM = uom.Id;
mylot.UOM.UoMVT_Name = uom.Name; Platform.Submit(mylot); return new
CreateLot.Response { CreatedLotGuid = mylot.Id }; } }
The IOperationalLot entity is created in the writing model with the following structure:
Here you can see that the type of the MaterialDefinition property of IOperationalLot is a IMatDefVT type, which is
made up only of the properties of the MatDefVT Value Type:
{
public interface IMatDefVT : IStructure
{
Guid? MatDefVT_MatDef { get; set; }
string MatDefVT_Name { get; set; }
int? MatDefVT_VMajor { get; set; }
int? MatDefVT_VMinor { get; set; }
}
}
In the reading model, the MaterialDefinition property is transformed into an Entity type property
(MaterialDefinition), together with the ValueType name (MaterialDefinition_MatDefVT_MatDef) and the Value Type
Guid (MaterialDefinition_MatDefVT_MatDef_Id), which allows you to directly link your entity with all the
MaterialDefinition entity properties (regardless of what you have included in the Value Type).
Consequently, from the OperationalLot entity you can now navigate to the MaterialDefinition properties through a
standard Include sub-method:
var readinglot =
Platform.ProjectionQuery<IOperationalLot>().Include(
"MaterialDefinition_MatDefVT_MatDef").Single(x => x.NId == command.LotCode);
If you browse the OperationalLot entity and then the MaterialDefinition entity, you will find all the properties you
have assigned to the MaterialDefinition entity (i.e. also Description and MaterialClass which have not been included
in the Value Type):
var e = Platform.Create<IEntityA>();
e.vt = new ValueType();
e.vt.Name = "MyValue";
The Reset method sets all the properties of a value type to null.
A scenario in which this method could be useful is when you have an optional Value Type with one or more
properties set to mandatory. In this situation if all the properties of the value type are set to null the validations
rules are skipped. However, if any of its properties are not null (not only the mandatory property), the validation
checks will be applied. In this case the Reset method can be used to set all properties to null, consequently
switching off the validation rules.
If the value type itself is mandatory, however, validation rules are always applied.
2.1.3.6.16 Using the Query Methods and the Data Model Assemblies
The Opcenter Execution Foundation database is organized, according to the CQRS pattern, into two separate data
models that can be accessed through two different channels.
When you model entities in the Model project in Project Studio and then build the Model project, the system creates
the C# classes (interfaces) that allow you to access the write data model (transactional model) and the read data
model (Projection model).
Method Description
OData standard queries From any consumer application, after the entire solution has been
deployed, you can use OData standard queries on the read data model
Public Object Model read data. See also Invoking Commands from UIs)
Required Assemblies
If you need to manually add references to the required model assemblies inside your project (see also Manually
Adding Model Assemblies) keep in mind the following overview:
// Status and Lifecycle are associated entities. The Include method allows you to
filter also on the related entities.
// You must add a using reference to Siemens.SimaticIT.Unified.Common.Information to
use the Include method.
// The reference to the <FunctionalBlock>Model.ProjectionModel.dll has been added
using Siemens.SimaticIT.ReferenceData.Foundation.DataModel.ProjectionModel;
using Siemens.SimaticIT.Unified.Common.Information;
[…]
var status = Platform.ProjectionQuery<IStatus>().Include("LifeCycle").FirstOrDefault(
m => m.NId.Equals(StatusNId));
child.Parent_Id = parentId;
If you do not have the Id of the parent entity, the following strategy would be still quite fast:
But if you use the Include method as in the following code snippet, the time execution would be extremely slow
because the method actually retrieves all the data from the table of the related entities:
If you want to associate entities that have a many-to-many relationship, you must always use the Include method.
Nevertheless, if you apply this method to the property that contains less elements, the code execution could be
extremely fast anyway. If we consider a relationship between some Users entities and Groups entities, we can
assume that a User entity will belong to few Groups entities while a Groups entity may contain a lot of Users.entities.
Consequently, the following piece of code:
because in the former example the Include method retrieves a few amount of data while in the second example it
retrieves a lot of data.
There are two possible ways for logging messages: either with Trace Viewer or with Application Log.
Traces all actions Traces only application level Trace Viewer logs all the actions carried out by
messages the platform (such as command execution,
authentication, queries on the database), while
Application Log traces only application level
messages.
Is more development Is more end-user oriented Trace Viewer is more suitable for advanced
oriented troubleshooting issues since it is highly verbose
and technical. Moreover it can contain logs
generated by the business logic, in terms of
command/event handlers, if the code uses them.
On the other hand Application Log is more
functional and end-user oriented. Consequently,
its messages are also more readable, and they
can be translated.
Stores logs in a database Stores logs in a database Both applications can store logs in a database,
but database maintenance and database maintenance but while Application Log can apply standard
is custom is standard provided maintenance procedures to clean old messages,
for Trace Viewer the database maintenance is
custom.
Logs can be filtered and Logs can be filtered by level, In Trace Viewer, logs are classified in levels (from
sorted out by level and business command and verbose to critical), and in providers (representing
provider source Functional Block or the "component" which has generated a certain
App log). Levels and providers can be used to filter
messages, both in view mode and in storage
mode (to avoid that logs let the database grow in
uncontrolled way). In Application Log, logs can be
defined as different levels (from verbose to
critical as in Trace Viewer), return the name of the
business command that generated them, as well
as the "owners" of the commands (typically
Functional Blocks, Apps or Extension Apps).
using Siemens.SimaticIT.SDK.Diagnostics.Tracing;
[...]
[...]
Siemens.SimaticIT.SDK.Diagnostics.Common.Category.Informational,
"MatDef. with Code {0} created",
command.Code);
Siemens.SimaticIT.SDK.Diagnostics.Common.Category.Informational,
"Event fired for Mat Def Code {0} created",
command.Code);
The ITracer Interface also exposes WriteEx methods that allow you to add the information of the calling class and
method name.
In the following example, the traced class name will be CommandHandlerExplicit1. You can call it with Generic
parameter <CommandHandlerExplicit1> or call it by the signature that exploits the this keyword:
using Siemens.SimaticIT.SDK.Diagnostics.Tracing;
[...]
[...]
If not set, the method name is automatically resolved by the compiler, because the WriteEx methods signature
relies on the [CallerMemberName] attribute:
2. In the CommandHandler project, refer the defined message using its Message ID and parameter values at the
appropriate context through the Application Log platform API. Refer to the sample code to understand how to
use the API.
IUnifiedSdkApplicationLog
using System.Collections.Generic;
namespace Siemens.SimaticIT.Unified.Common
{
/// <summary>
/// Provides an interface for handling Application Log messages.
/// </summary>
public interface IUnifiedSdkApplicationLog
{
/// <summary>
/// Stores user defined Application Log messages in the
ApplicationLog table in database.
/// </summary>
/// <param name="messageID">Specifies the identifier of
Application Log message.</param>
/// <param name="parameterValues">Specifies the parameters and its
values contained in the Application Log message.</param>
/// <param name="owner">Specifies the name of the Package from
which the message is logged.</param>
void ApplicationLog(int messageID, Dictionary<string, object>
parameterValues, string owner = null);
Sample Code
If you unflag all the rules, the C# Analyzer will be disabled on the current project.
C# Analyzer Rules
UAF0001 - Platform.GetEntity usage
Description If the query you are performing only checks for the ID of the entity,
it is preferable to simply use a Get call instead of a complex query.
Type Warning
Source example
Platform.Query<IMyEntity>().SingleOrDefault(s
=> s.Id == guidVar);
Platform.GetEntity<IMyEntity>(guidVar);
Description If you need to wait for feedback use the CallCommand instead of
the SendCommand.
Type Warning
Source example
Description As Projection queries cannot support more than one condition, problems
may occur at runtime when any of the entities in the query (in the Include
clause or as a parameter in the ProjectionQuery) are in different
databases and the lambda expression contains one or more && or ||
operators.
Type Warning
Source example
// Example 1
Platform.ProjectionQuery<IMyEntity>().Include("p2")
.SingleOrDefault(s => s.p1 == "myType" &&
s.LastUpdatedOn == timeVar);
// Example 2
Platform.ProjectionQuery<IMyEntity>().Include("p2"
).First(s => s.EntityType == "myType" ||
s.LastUpdatedOn == timeVar);
// Example 1
Platform.ProjectionQuery<IMyEntity>().Include("p2"
).Where(s => s.p1 == "myType").SingleOrDefault(s =>
s.LastUpdatedOn == timeVar);
// Example 2
var test1 =
Platform.ProjectionQuery<IMyEntity>().Include("p2"
).FirstOrDefault(s => s.EntityType == "myType") ??
Platform.ProjectionQuery<IMyEntity>().Include("p2"
).First(s => s.LastUpdatedOn == timeVar);
Description Certain properties cannot be hidden for technical reasons, but must
not be modified, as any modifications would then be overwritten.
For example, Last Modified Date or OptimisticVersion in IEntity
Type Warning
Source example
var myEntity =
Platform.Query<IMyEntity>().SingleOrDefault(m =>
true);
myEntity.ConcurrencyToken = 123;
Type Error
Source example
Platform.Query<IMyEntity>().Include(
"NotExistingProperty");
Description BLOB type properties must not be used in queries. This rules checks
that none are present.
Type Warning
Source example
Platform.Query<IMyEntity>().SingleOrDefault(md =>
md.PropertyBlob == blob);
Description The New operator must not be used with Value types.
If you need to reset a Value Type use the reset method, as in the
example.
Type Warning
Source example
matDef.Lot.Reset();
Type Warning
Source example
// Example 1
Platform.ProjectionQuery<MaterialDefinition>().I
nclude(\"produced_material\").SingleOrDefault(s
=> new Guid() == s.Id);
// Example 2
Platform.ProjectionQuery(typeof
(MaterialDefinition)).Include(\"produced_materia
l\").SingleOrDefault(s => new Guid() == s.Id);
// Example 1
Platform.ProjectionQuery<IMaterialDefinition>().
Include(\"produced_material\").SingleOrDefault(s
=> new Guid() == s.Id);
// Example 2
Platform.ProjectionQuery(typeof
(IMaterialDefinition)).Include(\"produced_materi
al\").SingleOrDefault(s => new Guid() == s.Id);
Timers can be easily configured using an ad hoc configuration tool within the Business Process Workflow
(see Configuring Timer Intermediate Events in Process Definition Models of the Opcenter Execution
Foundation User Manual).
Workflow
Available Operations
• You can delete timers from your solution, by using the Platform.DeleteTimer method.
• You can retrieve timers defined in the system by using the GetTimers and GetScheduledTimers
methods.
• You can debug custom event handlers for the TimerEvent.
Procedure
1. Invoke the Platform.CreateTimer method from your command handler to create and configure your timer.
2. Build your solution.
Implementation notes
• Do not insert sensitive information in the Context fields of the TimerContext parameter, as this
information can be retrieved through Get Timer methods from any application, and timers are not
securable.
• When invoking the Platform.CreateTimer method from the command handler, the related behavior is
not transactional. For this reason, timers may be created before the command is completed. If the
command fails after creating the timer and the Retry Manager instantiates a command retry, then the
timer is created a second time. If the TimerUniqueName is the same it will raise an exception that can
be managed by the application to continue the handler execution, in order for the command retry to
complete successfully. We suggest therefore to avoid specifying the TimerUniqueName with logics
that make it different at each command retry (i.e. new Guid() or similar logics), because in the scenario
where the same command is invoked more than once due to the internal retries, this would result in
the successful creation of two timers with the same schedule and context information but different
TimerUniqueNames.
• During runtime operations, timers are created but they are not deleted when they are no longer
used. In this case, the handler can check the timer validity when the TimerEvent event handler is
evoked by using either TimerID or TimerUniqueName properties. If the timer is no longer valid, we
suggest you delete it to avoid the handler being called.
• When you create a periodic timer at runtime, you should take the following limitations into account:
• the start time of the timer must occur at least two minutes after the time when the
CreateTimer is invoked, otherwise the method will fail.
• If the TimeZoneInfo of a timer is not specified, the UTC date is set by default.
• When the TimeZoneInfo of a timer is set, the StartTime, EndTime and SpecificTime will be interpreted
as local to that specific time zone. Moreover, in case of a periodic timer that also has the delay set to 1
or more days all the occurrences will be interpreted with the TimeZone settings, this means that DST
settings will apply and you need to consider the following edge cases:
• during spring forward transition to Daylight Saving Time, timers that are configured to trigger at
a time of the day that does not exist due to the shift will be skipped completely
• during fall back transition, timers that are configured to trigger at a time of the day that exists
twice will be fired only the first time
Code samples
The following is the signature of the CreateTimer method:
IUnifiedSdkTimeScheduler
The following is a code sample that shows a command handler creating One Shot timer. This command creates two
timers:
• one that will fire after 5 hours,
• one that will fire on a specific date and time
//The following schedule will trigger the timer 5 hours after its creation
OneShotTimerSchedule delayTimerSchedule = new OneShotTimerSchedule(new TimeSpan(5,
0, 0));
try
{
Guid oneShotDelayTimerGuid = Platform.CreateTimer("AwakeIn5Hours",
delayTimerSchedule, timerContext);
}
catch (UnifiedTimeSchedulerException ex)
{
switch (ex.PlatformCode)
{
case 9002:
// Timer creation failed due to a duplicated timer unique name.
// Command handler execution can continue...
break;
case 9003:
// Timer creation failed due to input parameters validation.
// In this case it is safe to stop the execution of the command logic by
returning an error response
return new CreateOneShotTimer.Response(new ExecutionError(-1, $"Timer
{timerUniqueName} cannot be created because {ex.Message}"));
break;
default:
// If any other failure should occur, the command execution logic should
be stopped
return new CreateOneShotTimer.Response(new ExecutionError(-1, $"Timer
{timerUniqueName} cannot be created because {ex.Message}"));
break;
}
}
catch (UnifiedException exc)
{
//The following schedule will trigger the timer on 2019-01-01 00:00:00 (UTC)
OneShotTimerSchedule specificTimeTimerSchedule = new OneShotTimerSchedule(new
DateTimeOffset(2019, 1, 1, 0, 0, 0, new TimeSpan(0, 0, 0)));
try
{
Guid oneShotSpecificTimeTimerGuid = Platform.CreateTimer("AwakeOnNewYear",
specificTimeTimerSchedule, timerContext);
}
catch (UnifiedTimeSchedulerException ex)
{
switch (ex.PlatformCode)
{
case 9002:
// Timer creation failed due to a duplicated timer unique name.
// Command handler execution can continue...
break;
case 9003:
// Timer creation failed due to input parameters validation.
// In this case it is safe to stop the execution of the command logic by
returning an error response
return new CreateOneShotTimer.Response(new ExecutionError(-1, $"Timer
{timerUniqueName} cannot be created because {ex.Message}"));
break;
default:
// If any other failure should occur, the command execution logic should
be stopped
return new CreateOneShotTimer.Response(new ExecutionError(-1, $"Timer
{timerUniqueName} cannot be created because {ex.Message}"));
break;
}
}
catch (UnifiedException exc)
{
// Timer creation failed due to infrastructural issues
throw;
}
}
The following is a code sample that shows a command handler creating a periodic timer, which is fired every hour
between two specific dates:
try
{
Guid periodicTimerGuid = Platform.CreateTimer("AwakeEveryHour",
periodicSchedule, timerContext);
}
catch (UnifiedTimeSchedulerException ex)
{
switch (ex.PlatformCode)
{
case 9002:
// Timer creation failed due to a duplicated timer unique name.
// Command handler execution can continue...
break;
case 9003:
// Timer creation failed due to input parameters validation.
// In this case it is safe to stop the execution of the command logic by
returning an error response
return new CreateOneShotTimer.Response(new ExecutionError(-1, $"Timer
{timerUniqueName} cannot be created because {ex.Message}"));
break;
default:
// If any other failure should occur, the command execution logic should
be stopped
return new CreateOneShotTimer.Response(new ExecutionError(-1, $"Timer
{timerUniqueName} cannot be created because {ex.Message}"));
break;
}
}
catch (UnifiedException exc)
{
// Timer creation failed due to infrastructural issues
throw;
}
}
The following is a code sample that shows a command handler creating a periodic timer with daily scheduling,
between two specific dates. The StartTime and EndTime are interpreted as Hawaiian times; each occurrence is also
interpreted as Hawaiian time because the delay parameter is set to 1 day, this means that once a year the timer will
fire after 25 hours and once a year after 23 hours because of DST settings.
private CreatePeriodicTimer.Response
CreatePeriodicDailyFilteredTimerHandler(CreatePeriodicTimer command)
{
TimerContext timerContext = new TimerContext("MaterialExtensionApp");
timerContext.GroupName = "AwakeningTimer";
timerContext.AppContext = new ApplicationContext();
timerContext.AppContext.UserField1 = "MaterialExpiration";
//The following schedule will trigger the timer once a day at 11 A.M. Hawaiian
Standard Time
//From 2019-01-01 11:00:00 to 2019-12-01 11:00:00 (Hawaiian Standard Time)
//Timer execution is restricted to Monday and Wednesday
TimeSpan delay = TimeSpan.Parse("1.00:00:00");
PeriodicTimerSchedule periodicSchedule = new PeriodicTimerSchedule(delay);
periodicSchedule.StartTime = new DateTimeOffset(2019, 1, 1, 11, 0, 0, new
TimeSpan(0, 0, 0));
periodicSchedule.EndTime = new DateTimeOffset(2019, 12, 1, 11, 0, 0, new
TimeSpan(0, 0, 0));
periodicSchedule.ActiveDays = WeekDays.Monday | WeekDays.Wednesday;
periodicSchedule.TimeZoneInfo = "Hawaiian Standard Time";
try
{
Guid periodicTimerGuid = Platform.CreateTimer("AwakeOnceADay",
periodicSchedule, timerContext);
}
catch (UnifiedTimeSchedulerException ex)
{
switch (ex.PlatformCode)
{
case 9002:
// Timer creation failed due to a duplicated timer unique name.
// Command handler execution can continue...
break;
case 9003:
// Timer creation failed due to input parameters validation.
// In this case it is safe to stop the execution of the command logic
by returning an error response
return new CreateOneShotTimer.Response(new ExecutionError(-1, $"Timer
{timerUniqueName} cannot be created because {ex.Message}"));
break;
default:
// If any other failure should occur, the command execution logic
should be stopped
return new CreateOneShotTimer.Response(new ExecutionError(-1, $"Timer
{timerUniqueName} cannot be created because {ex.Message}"));
break;
}
}
catch (UnifiedException exc)
{
// Timer creation failed due to infrastructural issues
}
For further information on the event data structure, see the TimerEvent in the System Reference Guide.
Procedure
1. In the App Management page, click on the arrow icon within the tile of the App that contains your timer
configuration.
2. In the App Configuration page, click on the Event Subscriptions tab.
3. Click Add Event Subscription Here.
4. In the Properties tab enter a name and description that identify the subscription.
5. Click on the Event browse button, select TimerEvent, and click Select.
6. Select from the Event Handler drop down one of the available handlers for the TimerEvent.
7. In the Filter (envelope) tab specify the desired filtering criteria on the envelope fields. The Mapping between
CreateTimer and Timer Event Envelope table shows the mapping between the information specified when
creating the timer and those received in a timer event. This helps you to configure a subscription properly.
8. In the Worker Role tab do either of the following:
• Create a new dedicated Worker Role.
• Select an existing dedicated Worker Role.
We suggest to group all timer event subscriptions in a single and dedicated Worker Role. In this way,
you have a dedicated Worker Role to manage Timer Events.
9. Click Save.
Procedure
1. Invoke the Platform.DeleteTimer method from your command handler to identify and delete the timer.
2. Build your solution.
Code samples
The following is a code sample of the DeleteTimer method:
Try
{
//Delete the timer specifying its GUID
Platform.DeleteTimer(timerGuid);
}
catch (UnifiedException exc)
{
//Timer deletion could fail in case of
//- infrastructural issues
//- wrong input timer GUID
}
Implementation notes
The TimerDefinition objects returned by the GetTimers method contain the timer identifier (GUID) only if
the name of the App to which they belong to (optional parameter) is passed in the input parameters of the
GetTimers call.
Procedure
1. Invoke the Platform.GetTimers and Platform.GetScheduledTimers methods from your command
handler to retrieve the timer.
2. Build your solution.
Code samples
The following is a code sample of the GetTimers and GetScheduledTimers methods:
/////////////////////////////////////////////////////////////////////////
//The following example searches for a specific Timer
//then looks for the scheduled timer events in a given time range
/////////////////////////////////////////////////////////////////////////
Sending Messages
To send messages you can use specific APIs (such as the SendMessage and SendMessageAsynch methods) exposed
by the platform public Sdk interface, available from Command Handlers, Composite Command Handlers and Event
Handlers.
Messages can be sent both synchronously and asynchronously.
By sending a message asynchronously, you do not wait for the reply of the external system, nevertheless, you can
retrieve information about the message, such as its Id, the timestamp etc. Sdk methods accept in input some
parameters such as the message content, the content type (json, xml).
By sending a message synchronously, you wait for the reply of the external system. The reply can be either the
expected response, or a failure due to timeout. As for the asynchronous sending option, the method accepts in
input the message content and the content type (json, xml) and the message timeout. When you are in a Command
or in a Composite Command Handler, the platform respects anyway the maximum timeout defined in the worker
role (see page Creating a New Worker Role).
In case of a synchronous message, the reply contains a flag indicating whether the timeout has been reached or not.
If the flag is true, the reply contains the message Id and the timestamp (and not the reply message content) while if
the flag is false, the reply contains also the message content.
Receiving Messages
Incoming messages are received by the Opcenter EX FN Service Layer. This functionality is achieved by configuring
the external system (i.e the Opcenter CN MOM) by following the related implementation guidelines.
For more information, see the IUnifiedSdkMessaging Interface in the Opcenter Execution
Foundation Platform Reference Online Help.
The implementation details of these methods, such as parameter names and code examples, are provided
in the Opcenter Execution Foundation Platform Reference Online Help.
Also refer to How to Guarantee Consistency between Opcenter Execution Foundation and Automation
Gateway Data Changes for configuration guidelines.
Implementation flow
We suggest you execute the following configuration steps:
1. Check that you have enabled the Automation Gateway Server configuration as described in Configuring the
Engineering Host in a Distributed Environment of the Opcenter Execution Foundation Installation Manual or
modify the existing settings as described in Modifying the Environment Configurations of the Opcenter Execution
Foundation Installation Manual.
2. In Solution Studio, install the Automation Gateway App and deploy the Solution as described in How to Manage
a Manufacturing Solution in Solution Studio.
3. In the Automation Gateway App, go through the configuration flow described in How to Manage Automation
Nodes in the Opcenter Execution Foundation User Manual.
4. To read from or write to the Automation Node parameter values, create either a Functional Block, and/or an
App, which reference the ATN_OP Functional Block (as described in the following sections: How to Develop a
Manufacturing Functionality for the Functional Block, or How to Develop an App for a Manufacturing Use
Case for the App).
5. According to the logic you want to implement, model the required artifacts (Commands or Composite
Commands, Events or Reading Functions) and then write the code in the corresponding C# classes by using
the IUnifiedSdk interface as shown below.
Method Description
AutomationRead The platform exposes two overloads of the AutomationRead method for
executing read operations:
• The first method accepts in input a list of IAutomationEntity, and reads
all values defined for the Automation Parameters of the specified
entities.
• The second method accepts in input a list of strings corresponding to
the Ids of the Automation Nodes (i.e. the Ids specified when Creating
Automation Node Instances) and reads all values defined for
the Automation Parameters of these entities.
Example
Suppose that you have an entity, for example Order, with the Status property, which can assume the
Started value.
When Order starts, the Order Id and some set points must be written on the Automation Parameter values.
If you want to guarantee consistency between relational and automation data, the business logic should ensure
that the status of Order can be set to Started only after the write operation has been acknowledged by the
automation driver.
To implement this use case, the Order entity could assume an intermediate status, for example Starting, before the
acknowledge message arrives from the Automation Gateway Server.
Consequently, you should implement a Composite Command, which will execute the following operations: first it
will call the Command that writes the Order Id and the set points on the Automation Gateway Server, then it will
call the Command that changes the Order status to Starting.
Then you should configure a Signal Rule that triggers the Command that sets the Order status to Started when the
Automation Gateway Server (e.g. the OPC Server) notifies, for example, the change of the value of a certain
Automation Parameter, which acts as an acknowledge notification.
In this way, the Order status is updated only when the Automation Gateway Server receives the new Order Id, and
the MES business logic, which is based on that status, can rely on the correct value.
Configuration guideline
This logic should implement a handshake with the Automation Gateway Server as follows:
1. Model the Automation Node as described in How to Manage Automation Nodes of the Opcenter Execution
Foundation User Manual.
2. Within a custom Functional Block, which references the ATN_OP Functional Block, link the Automation Node
entity to the required MES entity.
3. Configure the Automation Node Parameters written by MES, and the Automation Parameters notified by the
Automation Gateway Server.
4. Model the entity with a Status property, which can be used to store values that indicate both a final and
transient status.
5. Model and implement the code of the Commands that write the data on the Automation Gateway Server and
that set the transient status of the entity.
6. Configure a Signal Rule in the Signal App, which is triggered when a certain Automation Parameter value
changes and wire it to a Command that sets the entity to a final status.
3. Implement or modify the create, update, delete commands for your custom entity and develop any other
required business logic.
Runtime workflow
To use the Electronic Signature functionalities:
1. Install the Audit Trail App in Solution Studio, any other required system Apps or custom Apps, and deploy the
Manufacturing Solution as documented in How to Manage the Solution.
If the Audit Trail App is not installed, the Electronic Signature widgets are not visible in the UIs.
2. Create the Electronic Signature Scenarios and add the Electronic Signatures as described at Creating an
Electronic Signature Scenario in the Opcenter Execution Foundation User Manual.
At this point, operations that require the collection of the Electronic Signatures are ready to be started.
This use case will be shown with snippet examples at the following pages:
• Configuring the Data Model for Electronic Signature Scenario Integration
• Implementing the Business Logic for Electronic Signature Scenario Integration
This additional entity is required because the value type property cannot be used as a list of value types
(List<ScenarioConfigurationValueType>).
The entity that is involved by the validation (e.g. EquipmentInstance), could also foresee modifications to its life
cycle in order to have a custom step for collecting and checking the signatures belonging to one Scenario
Configuration before passing to any other steps and collecting the signatures belonging to another Scenario
Configuration.
Moreover, be aware that compared to the single scenario use case where the ActionLabel property acts only as a
descriptive string, for this use case the ActionLabel property becomes highly important as it allows you to
determine the correct ScenarioInstance that is being used at runtime.
The following examples refer to concepts and procedures already described Functional Block and App
development (e.g. data model with entities and value types, business logic and UI development) and are
not mentioned to be a step-by-step description from scratch.
In this example, the custom engineering entity contains a logical link to the ScenarioConfiguration entity via
ScenarioConfigurationValueType value type property:
Once the model project is completed, you can build the model project of the Functional Block and proceed with the
business logic implementation.
Examples
The following command code snippet creates an instance of the custom engineering entity (in the example
CustomLotTemplate) and sets the added properties to the ScenarioConfiguration NId and ActionLabel.
//to be implemented
return new CreateLotTemplate.Response() { CreatedLotTemplateId =
lotTemplate.Id };
}
}
}
The following command code snippet creates an instance of the custom runtime entity (e.g. CustomLot).
According to the business logic needs, you may need to create the ScenarioInstance entity either during
the custom entity creation or during the custom entity update. The current example creates the
ScenarioInstance entity in update and consequently both examples, for create and update, are provided
here below, together with the Composite command.
using [...]
namespace [...]
{
/// <summary>
/// Partial class init
/// </summary>
[Handler(HandlerCategory.BasicMethod)]
public partial class CreateCustomLotHandlerShell
{
[HandlerEntryPoint]
private CreateCustomLot.Response CreateCustomLotHandler(CreateCustomLot
command)
{
platform.Submit(customLot);
The following command code snippet updates the custom entity instance and sets the logical link to
the ScenarionInstance Id. Moreover, it retrieves the Scenario Configuration NId from the engineering entity.
using [...]
namespace [...]
{
/// <summary>
/// Partial class init
/// </summary>
[Handler(HandlerCategory.BasicMethod)]
public partial class UpdateCustomLotHandlerShell
{
/// <summary>
/// This is the handler the MES engineer should write
/// This is the ENTRY POINT for the user in VS IDE
/// </summary>
/// <param name="command"></param>
/// <returns></returns>
[HandlerEntryPoint]
private UpdateCustomLot.Response UpdateCustomLotHandler(UpdateCustomLot
command)
{
// Put your code here
// return new UpdateCustomLot.Response() { ... };
platform.Submit(customLot);
return new UpdateCustomLot.Response() { };
}
}
}
The following Composite Command code snippet creates an instance of the ScenarioInstance system entity by
retrieving the ScenarioConfiguration NId and Action Label from the parent Lot Template. Then it assigns the Id of
the created instance to the Custom Lot.
To do this, the command invokes the CreateScenarioInstance command and then the UpdateCustomLot
command which is documented above.
using [...]
namespace [...]
{
/// <summary>
/// Partial class init
/// </summary>
[Handler(HandlerCategory.BasicMethod)]
public partial class CompositeCreateScenarioInstanceHandlerShell
{
/// <summary>
/// This is the handler the MES engineer should write
/// This is the ENTRY POINT for the user in VS IDE
/// </summary>
/// <param name="command"></param>
/// <returns></returns>
/// <remarks>This is a Composite Command Handler</remarks>
[HandlerEntryPoint]
private CompositeCreateScenarioInstance.Response
CompositeCreateScenarioInstanceHandler(CompositeCreateScenarioInstance command)
{
//Retrieves the related Custom Lot Template entity starting from the Id
of the Custom Lot (POM Model app entity) selected in the UI Screen
var lot = platform.ProjectionQuery<CustomLot>().Include("LotTemplate").Fi
rstOrDefault(x => x.Id == command.CustomLotId);
var returnedScenarioInstance =
platform.CallCommand<CreateScenarioInstance,
CreateScenarioInstance.Response>(scenarioInstance);
mylotTobeAssigned.ESScenarioInstanceId =
returnedScenarioInstance.ScenarioInstanceId.Value;
mylotTobeAssigned.Id = command.CustomLotId;
For more information on the code snippets and the mentioned concepts, see also:
• Creating and Updating Entity Instances via Submit method
• Adding and Removing Navigation Properties
• Creating Value Types
• Using Reference Value Type Properties
These widgets will provide full functionalities at runtime only if the Audit Trail App is installed and
deployed.
If you want to test a custom UI page embedding the Electronic Signature widgets, see note at page How To
Debug UI Modules and Screens.
<sit-es-scenario-picker
sit-config="vm.configESPicker" sit-filter="vm.filter"></sit-es-scenario-picker >
For more information on the widget, see also the sit-es-scenario-picker widget in the UI Framework
Reference.
<sit-rt-signatures sit-scenario-instance="vm.ScenarioInstance"></sit-rt-signatures>
The vm.ScenarioInstance widget configuration object contains a structure with an input parameter as follows:
vm.ScenarioInstance =
{
ScenarioInstanceId: '<the scenario instance guid>',
}
• a counter indicating the number of the collected signatures compared to the number of the required signatures
(e.g. 0/3, 1/3, 2/3, 3/3).
After clicking the Sign/View Signature button, the widget shows an accordion that contains the status of the
collected signatures (with the accordion body in read-only mode and the information related to the signers) as well
as the list of the signatures that still need to be collected (with the accordion body containing the signature form).
According to the value set for the ValidationMode property of the ScenarioInstance entity (see the example of
CreateScenarioInstance invocation used in the Composite command described at page Implementing the
Business Logic for Electronic Signature Scenario Integration), the widget shows (or hides), the validation buttons as
follows:
• if the ValidationMode value is ApproveOrReject, the Accept and Reject option buttons are available and you
must choose the proper validation option before inserting the Electronic Signature,
• if the value is Approve, no validation option buttons are shown and you can only enter Electronic Signatures
without approving/rejecting the action.
Each time the ScenarioInstance object is refreshed, the OnCloseSignatures(obj) event is fired and the object
status information is propagated to the hosting UI module.
The ScenarioInstance object is refreshed in the following cases:
• if the ScenarioInstance entity Id is associated to the widget for the first time,
• if the ScenarioInstance entity Id which is already associated to the widget, is modified,
• if a new signature is collected,
• if you close the widget (i.e. either by clicking on the Close button, or by clicking the X button on the top-right bar
of the dialog box).
According to the actions performed, the ScenarioInstance object status (corresponding exactly to the
ScenarioInstance entity status), may change and custom actions can be triggered. For the list of possible statuses
to which you can subscribe logic, see Handling the Electronic Signature Scenario Instance Status.
When the scenario instance is in Completed or Rejected status, the back-end OnCompleteScenarioInstance event
is also fired (see Handling the Electronic Signature Scenario Instance Status).
For more information on the widget, see also the sit-rt-signatures widget in the UI Framework Reference.
The Scenario Instance is updated each time a new signature is collected, and assumes the following statuses:
• Initial
• InProgress
• Rejected (the scenario is completed)
• Approved (the scenario is completed)
The following UI container snippet provides an example of how to subscribe to the OnCloseSignatures(obj) event:
$rootScope.$on('OnCloseSignatures', vm.ChangeUIStatus);
function ChangeUIStatus(event,data)
{
vm.Id = data.Id;
vm.Status = data.Status; //Contains the Status of the last Scenario Instance that
changed status.
}
[...]
namespace [...]
{
/// <summary>
/// Partial class init
/// </summary>
[Handler(HandlerCategory.BasicMethod)]
public partial class CheckScenarioStatusHandlerShell
{
[HandlerEntryPoint]
private CheckScenarioStatus.Response
CheckScenarioStatusHandler(CheckScenarioStatus command)
{
//Retrieves the custom entity Id from the item selected on the UI screen
and uses the navigation property to retrieve the related Scenario Instance.
//ESScenarioInstance is the name assigned to the ScenarioInstanceValueType
in Project Studio and ESScenarioInstance_Id is the corresponding navigation property.
var customLot =
platform.ProjectionQuery<CustomLot>().Include("ESScenarioInstance_Id"
).FirstOrDefault(e => e.Id == command.CustomLotId);
[HandlerEntryPoint]
private void AutoNextStepOnCompleteScenarioInstance (OnCompleteScenarioInstance evt,
EventEnvelope envelope)
{
if (envelope.module != "MyCustomApplication")
{
return;
}
var command = new AutoNextStep() { Id = evt.SignedEntityId };
var response = Platform.CallCommand<AutoNextStep,
AutoNextStep.Response>(command);
}
The OnCompleteScenarioInstance event is fired when the Scenario Instance has been completed and it is
in Approved or Rejected status.
The event has the following envelope data structure:
Category OnCompleteScenarioInstance
Module The name of application that uses the Electronic Signature functionality.
Implementation workflow
1. For each Work Instruction runtime instance (see also Creating Work Instructions in the Opcenter Execution
Foundation User Manual), you have to set the acquisition behavior of each Section Step Item.
2. When the Work Instruction is opened at runtime, the system automatically displays the acquisition button (if
there is at least one Step Item which is set as semi-automatic).
3. When you click the acquisition button, the system invokes the Post-Action containing the custom reading logic.
Implementation details
Implementation phase Description
Setting the Step Item acquisition mode From a custom application, implement the custom code to
invoke the following public commands exposed by the Work
Instruction App:
• invoke the RetrieveDCItems command to retrieve the Ids
of the Step Items of a Work Instruction runtime instance,
• invoke the SetAcquisitionBehavior command and pass
the list of Step Item Ids you want to define as semi-
automatic. The SetAcquisitionBehavior accepts in input
a list of <AcquisitionParameterType> Parameter Type,
containing Id (Guid, the Id of the Work Instruction Step
Items) and AcquisitionBehavior (Value Type, containing
the following enumeratives: Manual or SemiAutomatic).
Implementing the reading logic in the Post- Within a custom Functional Block, which extends the WI_OP
Action Functional Block, model a Post-Action to extend the platform
logic of the AcquireDCValues public command (exposed by
the Work Instruction App and contained in the WI_OP
Functional Block). The Post-Action handler must contain the
code to perform the following operations:
• retrieve the data source for each Step Item passed in the
input (a separate anagraphic for each Step Item and the
related data source should be available)
• retrieve the values for each Step Item from its data source
• invoke the SetDCItemValues command to persist the
acquired values (list of values) on the database. This step
allows the Work Instruction runtime instance to read and
display the retrieved values in the Work Instruction form.
Runtime workflow
1. Open the required Work Instruction runtime instance (see also Executing Work Instructions in the Opcenter
Execution Foundation User Manual).
2. When the Work Instruction is opened at runtime, the Acquire button is automatically displayed to permit the
semi-automatic acquisition of the required values. The button is displayed if there is at least one Step Item that
has been defined as semi-automatic.
3. Click the Acquire button: when you click this button, the system invokes the AcquireDCValues public command
together with the related custom Post-Action. The value retrieved from the Post-Action code is displayed in the
semi-automatic Step Item. You can either confirm the value as it is or modify it.
4. To actually store the collected value in the Work Instruction, confirm the Data Collection form.
Workflow
1. Manage the Application Log File, used to generate the log messages.
2. Associate Business Logic with Application Log Messages.
3. Retrieve Application Messages without Logging.
4. Localize Application Log Messages, if required to view log messages in multilanguage.
In both cases, the default language of the xml file is English and the file name must be in the
format <prefix>.<functional block / app / extension app name>.ApplicationLog.en-US.xml.
You must not modify this file name pattern.
The system manages all the xml files and stores the catalog of messages in the database. By means of the
Application Log App, installed in Solution Studio, you can log the defined messages and view them in your UI
Application at runtime.
This section describes the structure of the xml file and its restrictions.
File Structure
ID is a mandatory attribute.
Level The type of message. The system accepts only Critical, Error,
Warning, Informational or Verbose value.
Parameter Key The primary key that stores the name of the parameter that repeats
multiple times for a message.
Parameter Type The type of the parameter that repeats multiple times for a message.
Example values for the Application Log File:
-00001 Unable to start the operation Unable to start the operation Error
%op_name% because the work order
%wo_name% is on hold.
-00001 Unable to start the operation Unable to start the operation %op_id% Error
because the work order %wo_id% is on
hold and material lot %m_lot% is mark
to be cleaned.
The Application Log xml file requires certain restrictions that you must respect to avoid any errors during the
database update in Solution Studio:
2. Expand the Installer project, right-click Config folder and select Add > New Item.
3. Select Application Log class and click Add. This will add a new xml file to the Installer project that gets the
system-defined name and structure.
Do not modify the file name, even though the system allows you to. If you rename, the system does not
take into account the custom name and returns an error while building the Installer project.
Prerequisites
In Project Studio, application log messages are defined and packaged for every model project such as Functional
Block / App / Extension App, for which you wish to log.
Procedure
This API allows you to store user defined application log messages to the runtime database and retrieve those
messages for displaying in runtime environment.
1. In Project Studio, open the solution of a model project for which you want to log and retrieve messages.
2. In the CommandHandler project, refer the defined message using its Message ID and parameter values at the
appropriate context through the Application Log platform API. Refer to the sample code to understand how to
use the API.
IUnifiedSdkApplicationLog
using System.Collections.Generic;
namespace Siemens.SimaticIT.Unified.Common
{
/// <summary>
/// Provides an interface for handling Application Log messages.
/// </summary>
public interface IUnifiedSdkApplicationLog
{
/// <summary>
/// Stores user defined Application Log messages in the ApplicationLog
table in database.
/// </summary>
/// <param name="messageID">Specifies the identifier of Application Log
message.</param>
/// <param name="parameterValues">Specifies the parameters and its values
contained in the Application Log message.</param>
/// <param name="owner">Specifies the name of the Package from which the
message is logged.</param>
void ApplicationLog(int messageID, Dictionary<string, object>
parameterValues, string owner = null);
Sample Code
What to do next
To properly log messages you need to deploy your custom solution, in which you have also installed the
Application Log App.
At this point the application log messages will be logged to the runtime repository and retrieved upon command
execution. However, if you wish to retrieve application log messages without logging to the runtime repository,
see Retrieving Application Messages without Logging
If the ApplicationLog platform API is invoked from Pre-Check / Post-Action handlers, ensure you provide
the value of the owner parameter to log the message in the runtime database with the correct owner. If
the owner parameter is not provided, you may not be able to see the short and the long messages at
runtime because the logged message will not be assigned with a correct Functional Block / App / Extension
App name.
Prerequisites
In Project Studio, application log messages are defined and packaged for every project such as a Functional Block /
App / Extension App.
Procedure
These APIs allow you to retrieve a localized message text from the ID and the value of the parameters.
1. In Project Studio, open the solution of a Functional Block / App / Extension App for which you want to log and
retrieve messages.
2. In the CommandHandler project, refer the defined message using its Message ID and appropriate parameter
values through the Application Log platform API. See the sample code below to understand how to use the API.
IUnifiedSdkApplicationLog
/// <summary>
/// Retrieves the short message content of Application Log message for a
given Message ID.
/// </summary>
/// <param name="messageID">Specifies the identifier of Application Log
message.</param>
/// <param name="parameterValues">Specifies the parameters and its values
contained in the Application Log message.</param>
/// <param name="languageCode">Specifies the language of Application Log
message.</param>
/// <param name="owner">Specifies the name of the Package from where the
message is to be retrieved.</param>
/// <returns>short message content</returns>
string GetApplicationLogShortMessage(int messageID, Dictionary<string, object>
parameterValues, string languageCode = null, string owner = null);
/// <summary>
/// Retrieves the long message content of Application Log message for a given
Message ID.
/// </summary>
/// <param name="messageID">Specifies the identifier of Application Log
message.</param>
/// <param name="parameterValues">Specifies the parameters and its values
contained in the Application Log message.</param>
/// <param name="languageCode">Specifies the language of Application Log
message.</param>
/// <param name="owner">Specifies the name of the Package from where the
message is to be retrieved.</param>
/// <returns>long message content</returns>
string GetApplicationLogLongMessage(int messageID, Dictionary<string, object>
parameterValues, string languageCode = null, string owner = null);
Sample Code
When the Application Log platform APIs are invoked from Pre-check / Post-action Handlers, be sure to
provide the value to the parameter owner to retrieve an appropriate message. If the parameter owner is
not provided, the retrieved message may not be received from the intended Functional Block / App /
Extension App.
You must have consistency between the message ID in the default message definition file (en_US) and the
localized files. For both, the IDs must match.
Prerequisites
To localize application log messages, the messages in English must be specified in the default file for application
log.
If a resource package zip for the UI localization already exists, then copy the config folder to the
existing zip.
Parameter Description
prefix Specify the prefix of the Functional Block / App/ Extension App. For
example, Siemens.OpcenterEX.FN or Siemens.SimaticIT
functional block / app/ Specify the Functional Block / App / Extension App name. For example, Defect
extension app name or ALG_MS
language code The language code must be a four-letter code based on ISO 639 (e.g. ko-KR for
Korean)
major version.minor Specify the major and the minor version of the Functional Block. For example,
version 01.01
The major and the minor version must be separated with a period.
patch version for the Specify the version for the resource package. If multiple patch versions for the
resource package same functional block are available, then the highest patch version of the
resource package will be used.
The resource package name must correspond to the functional block for which you want to publish log
messages. For example, if the functional block zip is Siemens.OpcenterEX.FN.DefectV01.00.00.zip,
the related resource zip file must be Siemens.OpcenterEX.FN.Defect.Resources.zh-
CN.V01.00.00 and if the functional block zip is Siemens.SimaticIT.ALG_MSV01.00.00.zip then
the resource zip file must be Siemens.SimaticIT.ALG_MS.Resources.zh-CN.V01.00.00.
File Structure
The table describes the message attributes. The following attributes have to be specified in the language the
message has to be localized.
Long A long description of the message that provides further verbosity than a short message.
The length of Long message must be less than 400 characters.
If multiple messages have to be localized for the same language, then the above attributes have to be
replicated in the same format.
Related documentation
Reference documentation is available as HTML files or within the Documentation Center after the you have
completed the Opcenter EX FN environment configuration (see Configuring the Documentation Center in the
Opcenter Execution Foundation Installation Guide).
Starting from How to Extend Referenced Functional Blocks and then How to Model a Functional Block, you can find
guidelines on how to extend Functional Blocks, create custom Apps and UIs and reference other Functional Blocks.
Opcenter Execution Foundation reference documentation comes provided for each Foundation Functional Block
with the description of all model artifacts (e.g. entities, commands, events and so on).
Entities
The ALG_MS Functional Block contains the following entities:
Rule Defines a Rule for the ApplicationLog A Rule entity can be related to a
maintenance configuration. single CleaningCondition entity
and / or a single Schedule entity.
Schedule Defines a Schedule for the ApplicationLog A Schedule entity can be related
maintenance configuration. to a single Rule entity.
For further information, refer to the Entities section of the ALG_MS Reference Guide.
Commands
The ALG_MS Functional Block contains the following commands:
Command Function
For further information, refer to the Commands section of the ALG_MS Reference Guide.
Entities
The ALG_OP Functional Block contains the following entities:
Entity Function
Commands
The ALG_OP Functional Block contains the following commands:
Command Function
Events
The following events are fired each with a specific envelope, on which you can filter while configuring the
subscription.
• When a Run Now button is clicked , the event RunNowEvent will be fired.
The RunNowEvent event has the following envelope data structure:
Topic ApplicationLog
For further information, refer to the Commands section of the ALG_OP Reference Guide.
Its Functional Block artifacts are defined to be used in the management of Automation Nodes.
It references the UDM_RF Functional Block.
Entities
The ATN_MS Functional Block provides the following entities:
Automation Node Type Sets of data that can be connected to control An Automation Node Type
systems. These data structures can represent entity:
abstract equipment types, machines, tools, or
• can be related to one or
any other automation data grouping. They
more Automation Node
contain automation parameters, which contain
Type Parameters.
the connection information required to execute
• can be related to one or
read and write operations on automation data.
more Automation Node
Instances.
Commands
The ATN_MS Functional Block contains the generic basic commands and the following functional block specific
commands for automation node management:
Command Function
Command Function
RevertAutomationNodeType To revert the selected Automation Node Type and its instances
to the activated version.
Events
The Automation Gateway App fires the following system events:
• ActivateFinished, after the activation of either Automation Node Types, or Automation Node Instances or
Automation Channels (see Activate and ActivateAutomationChannel commands) and it is associated to the
ActivateFinishedSignal signal;
• ImportFinished, after the import of a configuration file (see ImportAutomationConfig command) and it is
associated to the ImportFinishedSignal signal.
• ResetFinished, after the reset of the Automation Gateway Server configuration (see ResetEnvironment
command) and it is associated to the ResetFinishedSignal signal.
The ActivateFinished event has the following envelope data structure:
Category Activation
Module AutomationGatewayManagement
Tag ActivateFinished
Category Import
Module AutomationGatewayManagement
Tag ImportFinished
Topic ImportAutomationConfig
The ResetFinished event has the following envelope data structure:
Category ResetEnvironment
Module AutomationGatewayManagement
Tag ResetFinished
Topic ResetEnvironmentDone
For further information, refer to the Events section of the ATN_MS Reference Guide.
Entities
The ATN_OP Functional Block contains the following entity:
Automation Node The entity (of IAutomationEntity type) An Automation Node entity must
representing the operational copy of the be related to only one
configuration activated into the Automation Automation Node Instance and
Gateway Server. to only one Automation Node
Type.
For further information, refer to the Entities section of the ATN_OP Reference Guide.
Commands
The ATN_OP Functional Block contains only the generic basic commands.
For further information, refer to the Commands section of the ATN_OP Reference Guide.
Its Functional Block artifacts allow you to manage Business Processes, specifically in the Business Process Flow
App.
It references the following Functional Blocks:
• UDM_RF
• TSK_MS
Entities
The BPF_MS Functional Block contains the following entities:
Process Context Definition Defines the User Field that makes up a A Process Context Definition can
User Field Work Process Context. be related to many Process Context
Definition User Fields. Backward
navigation is possible between these
two entities through the
ProcessContextDefinition
property.
Process Definition Defines the structure of a set of Work Many Process Context Definitions
Processes, including its execution can be related to many Process
model. Definitions. Backward navigation is
possible between these two entities
through the
ProcessContextDefinitions
property.
Process Definition Defines the structure of an input/ A Process Definition can be related
Parameter output parameter for a set of Work to many Process Definition
Processes. Parameters. Backward navigation is
possible between these two entities
through the ProcessDefinition
property.
Process Template Parameter The template used to create the A Process Template can be related
Process Definition Parameter. to many Process Template
Parameters. Backward navigation is
possible between these two entities
through the ProcessTemplate
property.
For further information, refer to the Entities section of the BPF_MS Reference Guide.
Commands
The BPF_MS Functional Block contains the generic basic commands and the following functional block specific
commands for business process management:
Commands Function
Entities
The BPF_OP Functional Block contains the following entities:
Work Process A runtime Work Process instance. One WorkProcess entity can be related to
many WorkProcess entities. Backward
navigation is possible between these two
entities through the ParentWorkProcess
property.
Work Process Context A base context for a Work Process. A Work Process Context can be related
to one or more Work Process Context
User Fields.
Work Process Context User The User Field for the Work Process A Work Process Context can be related
Field Context. to many Work Process Context User
Fields. Backward navigation is possible
between these two entities through the
Context property.
Work Process Element For internal use only. A Work Process Model can be related to
many Work Process Elements.
A private Work Process Flow
Backward navigation is possible between
Element.
these two entities through the Model
property.
Work Process Element For internal use only. A Work Process Element can be related
Data Association to many Work Process Element Data
A private Work Process Flow
Associations. Backward navigation is
Element Data binding variables,
possible between these two entities
expressions and constant values.
through the Element property.
Work Process Flow For internal use only. A Work Process can be related to many
Element Token Work Process Flow Element Tokens.
A private Work Process Flow
Element Token.
Work Process Link For internal use only. • A Work Process Element can be
related to many Work Process Links.
A private Work Process Link
Backward navigation is possible
between Flow Elements.
between these two entities through
the FromElement property.
• A Work Process Element can be
related to many Work Process Links.
Backward navigation is possible
between these two entities through
the ToElement property.
Work Process Sequence For internal use only. A Work Process can be related to many
Flow Token Work Process Sequence Flow Tokens.
A private Work Process Sequence
Flow Token.
Work Process Variable For internal use only. A Work Process can be related to many
Work Process Variables. Backward
A private Work Process Variable.
navigation is possible between these two
entities through the WorkProcess
property.
For further information, refer to the Entities section of the BPF_OP Reference Guide.
Commands
The BPF_OP Functional Block contains the generic basic commands and the following functional block specific
commands for business process management:
Commands Function
Events
The WorkProcessTokenStatusChanged event is fired by the Business Process Flow App when the status of a Work
Process Flow Element token changes and the Work Process proceeds.
The StatusChanged of WorkProcess event has the following envelope data structure:
Category WorkProcessStatusChanged
Module BPFlow
Tag StatusChanged
Topic WorkProcess
UserField6 True, if target status is meant as a final status (the outcome of the
status is not 0), false otherwise.
LastUpdatedOn DateTimeOffset The last date time of the Work Process update.
For further information, refer to the Events section of the BPF_OP Reference Guide.
Entities
The BRC_MS Functional Block contains the following entities:
Entity Description
Commands
The BRC_MS Functional Block contains the following commands:
Command Function
Command Function
Entities
The BRC_OP Functional Block contains the following entities:
Entity Description
Commands
The BRC_OP Functional Block contains the following commands:
Command Function
Entities
The CHR_MS Functional Block contains the following entities:
Entity Description
Commands
The CHR_MS Functional Block contains the following commands:
Command Function
Command Function
Entities
The CHR_OP Functional Block contains the following entities:
Entity Description
Commands
The CHR_OP Functional Block contains the following commands:
Command Function
Command Function
Entities
The DEF_MS Functional Block contains the following entities:
Entity Description
Failure Contains information on Failures, which are potential problems which can
occur during the life cycle of a product or process.
Commands
The DEF_MS Functional Block contains the following commands:
Command Function
Command Function
Command Function
Entities
The SegregationTag entity is part of the Foundation Functional Block. See the Foundation Model Reference
Guide for details on this entity.
Commands
The DSG_SD Functional Block contains the following commands:
Command Function
Command Function
Events
The DSG_SD Functional Block contains the following events:
Event Function
For further information, refer to the Events section of the DSG_SD Reference Guide.
Entities
The EQU_MS Functional Block contains the following entities:
Entity Description
Entity Description
Commands
The EQU_MS Functional Block contains the following commands:
Command Function
Command Function
Command Function
Command Function
SetEquipmentTypeAsDefault To set the specified Equipment Type as default template for the
creation of the Equipment Configuration.
Command Function
Events
Event Function
Entities
The EQU_OP Functional Block contains the following entities:
Entity Description
Entity Description
Commands
The EQU_OP Functional Block contains the following commands:
Command Function
ForceEquipmentStatus To set the status of the Equipment, without checking the validity
of the transition.
Command Function
SetEquipmentStatus To set the status of the Equipment, checking the validity of the
transition.
UpdateEquipmentGraph To synchronize the Equipment Graph links and nodes with the
Equipment Graph Configuration links and nodes.
Entities
In particular, the provided commands are aimed at creating, updating, deleting, freezing/unfreezing the following
entities:
Events
The ScenarioConfigurationDeleted event is fired with a specific envelope when a Electronic Signature Scenario
Configuration is deleted.
The ScenarioConfigurationDeleted event has the following envelope data structure:
Category ScenarioConfigurationDeleted
Module ScenarioConfiguration
Tag ScenarioConfigurationDeleted
Topic ScenarioConfiguration
For further information, see the ScenarioConfiguration Entity section of the ES_MS Reference Guide.
For an overview of the artifacts related to the runtime functionalities, see ES_SD Functional Block and
ScenarioInstance Entity section of the ES_SD Reference Guide.
Entities
The ScenarioInstance entity and the SignatureInstance entity are part of the Foundation model and can be used
in custom code to implement custom logic. The ESTicketInformation is for internal use. See the SignatureInstance
Entity in the ES_SD Reference Guide for details on the system data domain entities.
Commands
The ES_SD Functional Block contains a set of public commands that are internally used by the sit-rt-
signatures widget in order to handle signatures. These commands are PrepareSignature, AbortSignature
and AddSignature.
The Functional Block also contains:
• CreateScenarioInstance command which must be used in custom composite commands to create instances of
the ScenarioInstance and SignatureInstance entities, based on the ScenarioConfiguration and its
SignatureConfiguration entity.
• CreateScenarioInstanceWithSignatures command allows the user to create a ScenarioInstance using directly
a list of users/roles and reason to sign, bypassing the Engineering phase (i.e. not using ScenarioConfiguration).
For further information, refer to the Commands section of the ES_SD Reference Guide and to
the Implementing the Business Logic for Electronic Signature Scenario Integration topic of the current
manual.
Events
The OnCompleteScenarioInstance event is fired when the Scenario Instance has been completed and it is
in Approved or Rejected status.
The event has the following envelope data structure:
Category OnCompleteScenarioInstance
Module The name of application that uses the Electronic Signature functionality.
Entities
The LBM_MS Functional Block contains the following entities:
Entity Description
Commands
The LBM_MS Functional Block contains the following commands:
Command Function
Command Function
Commands
Command Function
Events
Event Function
Entities
The MAT_MS Functional Block contains the following entities:
Entity Description
Commands
The MAT_MS Functional Block contains the following commands:
Command Function
Command Function
Command Function
Entities
The MAT_OP Functional Block contains the following entities:
Entity Description
Entity Description
Commands
The MAT_OP Functional Block contains the following commands:
Command Function
Command Function
Command Function
Command Function
Command Function
Entities
The OPCUAConnect_MS Functional Block contains the following entities:
Entity Description
For further information, refer to the Entities section of the OPCUAConnect_MS Reference Guide.
Commands
The OPCUAConnect_MS Functional Block contains the following commands:
Command Function
Events
The OPCUAConnect_MS Functional Block contains the following events:
Event Function
Entities
The OPCUAConnect_OP Functional Block contains the following entities:
Entity Description
For further information, refer to the Entities section of the OPCUAConnect_OP Reference Guide.
Commands
The OPCUAConnect_OP Functional Block contains the following commands:
Command Description
Entities
The PRM_MS Functional Block contains the following entities:
Entity Description
For further information, refer to the Entities section of the PRM_MS Reference Guide.
Commands
The PRM_MS Functional Block contains the following commands:
Command Function
Command Function
ImportUsersByGroup To create a new Person from each User provided by the specified
UMC Group.
ManageSegregationTagsToPersonsAss To manage the association between one or more tags and a list of
ociation Persons.
ManageSegregationTagsToPersonGrou To manage the association between one or more tags and a list of
psAssociation Person Groups.
Events
The PRM_MS Functional Block contains the following events:
Event Function
UserImportCompleted This event is fired when the User Import has been completed.
For further information, refer to the Events section of the PRM_MS Reference Guide.
Commands
The QEMigration_MS Functional Block contains the following command:
Command Function
For further information, refer to the Commands section of the QEMigration_MS Reference Guide.
Entities
The SGN_MS Functional Block contains the following entities:
Entity Description
SignalRule Contains information on each single signal rule, such as its name,
description and revision number.
Commands
The SGN_MS Functional Block contains the following commands:
Command Function
Entities
The TSK_MS Functional Block contains the following entities:
Task Defines a task. Task Definition entities have standard Revision behavior. Task Definitions :
Definition
• must be related
to a Task Type
• can be related
to one or more
Task
Definition Para
meters
• can be
associated to
one or more
Task Context
Definitions
Task Defines a base relational context for the Task Definition entity. Task Context
Context Definitions are
Definition related to:
• one or more
Task Context
Definition User
Fields
Task Defines the User Field related to a Task Context Definition entity.
Context
Definition
User Field
For further information, refer to the Entities section of the TSK_MS Reference Guide.
Commands
The TSK_MS Functional Block contains the generic basic commands and the following functional block specific
commands for task management:
Command Function
For further information, refer to the Commands section of the TSK_MS Reference Guide.
Entities
The TSK_OP Functional Block contains the following entities:
Task Defines a runtime task. Runtime tasks can be A Task can be related to one or
created either: more Task Parameters.
• manually (using a web page)
• automatically when creating a Work Order. In
this case Tasks directly inherit the Task
Definition properties (the user fields, in
particular) and represent Task Definition
instances, with additional runtime-specific
properties, such as equipment, location and
order data.
Task Context Defines a base relational context for the Task entity. A Task Context can be related
to one or more Task Context
Task Context User Defines a user field related to a Task Context entity. User Fields.
Field
For further information, refer to the Entities section of the TSK_OP Reference Guide.
Commands
In order to use some of the following commands you must subscribe to certain events, which are specified in the
following table.
Events
The following events are fired each with a specific envelope, on which you can filter while configuring the
subscription.
• When an action on the task is requested by means of the pre-defined commands provided by Task Management
(such as ActivateTask, PauseTask, CompleteTask), the event ActionOnTaskRequest will be fired.
• When a status is successfully changed, through the commands SetTaskStatus and ForceTaskStatus, the
events StatusChanged, and StatusForced will be fired.
• When a status of a task has changed, through the command SetTaskStatus, the event TaskStatusChanged will
be fired. It also contains information on the Equipment to which the Task belongs to.
• When an entire sequence step has completed, regardless whether successfully or not, the
event SequenceStepCompleted will be fired.
• When the Complete action on the Task of Work Instruction Task type is requested, the event
ActionOnCompleteWITask will be fired.
Category ActionRequested
Module TaskManagement
Tag ActionRequested
Topic Task
If WITask App is installed in your Solution and you want to subscribe ActionOnTaskRequest event for the
execution of the Tasks, other than WI Task type, filter the event with the appropriate value of UserField4.
Example:
• For Standard Task, UserField4 = TSKType
If WITask App is installed in your Solution and you want to execute the standard tasks subscribe
to ActionOnTaskRequest event by filtering using UserField4 envelope parameter. To execute WI task
types an additional subscription is not required.
Example:
• For Standard Task, UserField4 = TSKType
ActionName String The name of the verb applied and the name of the user
requesting the operation. Maximum length: 255
Category StatusChanged
Module TaskManagement
Tag StatusChanged
Topic Task
UserField6 True, if target status is meant as a final status (the outcome of the
status is not 0), false otherwise.
Category StageCompleted
Module TaskManagement
Tag StageCompleted
Topic Task
UserField3 True, if at least one of the tasks within the sequence step did not
match the exit policy, false otherwise.
UserField4 True, if all the tasks within the sequence step matched the exit
policy, false otherwise.
UserField5 True, if the completed sequence step is the last sequence step in the
Task Flow.
UserField6 True, if the completed sequence step is not the last sequence step
in the Task Flow.
and the following event SequenceStepCompletedEventArgs Parameter Type applies:
SequenceStepSuccess Bool True, if all the tasks within the sequence step matched
the exit policy, or false if at least one of the tasks within
the sequence step did not match.
Category CompleteWorkInstructionTask
Module TaskManagement
Tag ActionRequested
Topic WorkInstructionTask
The event ActionOnCompleteWITask has pre-defined subscription whenever the extension app of the
Work Instruction, i.e. WITask app, is installed in the Solution Studio.
For further information, refer to the Events section of the TSK_OP Reference Guide.
Entities
The UDM_RF Functional Block contains the following entities for autonumbering:
Counter A progressive numeric value, which can A Counter can be referenced by one
be used within the Numbering or more Numbering Pattern Parts
Pattern.
Numbering Pattern The complete pattern to be used in the A Numbering Pattern is associated to
autogeneration of a string. only one entity type,
which is associated to one or more
specific parameters.
Numbering Pattern Part One of the parts which make up the A NumberingPatternPart:
Numbering Pattern.
• is related to the Numbering
Pattern it belongs to.
• can be related to one of the
following:
• Counter
• Constant
• Parameter
• Timestamp
Commands
The UDM_RF Functional Block contains the generic basic commands and the following functional block specific
commands for autonumbering:
Commands Function
Entities
The UDM_RF Functional Block contains the following entities for state machine management:
Status Transition A transition, or change of status between two A Status Transition must be
different statues that belong to the the same related to:
State Machine.
• a target Status
A Status Transition is defined by the source • a source Status
status and by the verb (i.e. the action), which
represents the specific transition
The Status Transition is created from the
Status Transition Definition template.
Commands
The UDM_RF Functional Block contains the generic basic commands and the following functional block specific
commands for state machine management:
Command Function
Entities
The UDM_RF Functional Block provides the following entities for unit of measure management:
Unit of Measure (UoM) The base unit for measuring a physical quantity. A base UoM must:
Units of measure belonging to same physical • be related to a UoM
category are related to the same Dimension.
UoM dimension. • belong to a defined
physical category.
A multiple/submultiple
UoM must be related to its
base UoM.
Unit of Measure The conversion factor between a target UoM and A UoM Factor must be related
Factor (UoM Factor) a source UoM, belonging to the same category. to:
• a target UoM (base or
multiple/submultiple) and
• a base source UoM.
Commands
The UDM_RF Functional Block contains the generic basic commands and the following functional block specific
commands for unit of measure management:
Commands Function
ConvertQuantity To convert a given quantity, expressed in the source UoM, into the
corresponding quantity, expressed in the target UoM.
UoM Conversion
Multiples and submultiples of a base UoM are defined through conversion factors (UoM Factor).
Base UoMs of different systems, belonging to the same UoM dimension, are related by proper conversion factors.
For these reasons, the only admitted conversions are between two UoMs belonging to the same system (for
example cm to meter) or between two UoMs belonging to different systems with base UoM belonging to the same
UoM dimension (for example cm to inches).
The UoM conversion is calculated according to the following formula:
For example, to convert m in km, as 1 km = 103 m, the parameters of the conversion formula will be:
• TargetUoM = km
• SourceUoM = m
• K0 = 103
• K1 = 1
• n=1
• A=0
The following data, as instances of UoM management entities, are provided by the system.
Yard (yd)
Pound (lb)
Hectare (ha)
Acre (ac)
Gallon (gal)
Predefined data, such as UoMs, UoM Dimensions, and UoM factors, cannot be deleted and cannot be
modified except for their name and description, in order to maintain universally known symbols and ratio
among UoMs.
Entities
The WI_MS Functional Block contains the following entities:
Commands
The WI_MS Functional Block contains the generic basic commands and the following functional block specific
commands for work instruction management:
Commands Function
Entities
The WI_OP Functional Block contains the following entities:
Commands
The WI_OP Functional Block contains the generic basic commands and the following functional block specific
commands for work instruction management:
Commands Function
AcquireDCValues This command offers a way of persisting the Work Instruction Step Item values coming
from external systems, if configured correctly using a Post Action (For example, reading
values from the field using the Automation Gateway).
RetrieveDCItems To retrieve the values of Section NId, Step NId, Step Item Id, and Step Item NId for the
given Work Instruction.
SetAcquisitionBe To set the value of Acquisition Behavior property of Work Instruction Step Items. This
havior command receives a list of Work Instruction Step Item Ids and their corresponding
Acquisition Behavior.
SetDCItemValues To set values of the Work Instruction Step Items. This command receives a list of Work
Instruction Step Item Ids and values.
Commands Function
UpdateStepItem To update the existing Work Instruction Step Item Limits. The command receives in input
Limits an Id, related to the item to be updated, and the LimitValues parameter.
The LimitValues StepItemLimitValueType Parameter Type values are handled as follows,
according to the type of the object identified by the Id parameter:
UpdateWorkInstr To update the value of an existing Work Instruction Parameter. The command receives in
uction input the Id and ParameterValue to be updated.
ParameterValue
For the complete list of commands and the related information, refer to the Commands section of the WI_OP
Reference Guide.
Events
The following events are fired each with a specific envelope, on which you can filter while configuring the
subscription.
• When a Work Instruction Section is completed, the event WorkInstructionSectionCompleted will be fired.
• When a Work Instruction Step is acknowledged/confirmed, the event WorkInstructionStepCompleted will be
fired.
• When a Work Instruction Step is acknowledged/confirmed and is associated with an Electronic Signature
Scenario, the event OnWorkInstructionStepInPending will be fired.
The WorkInstructionSectionCompleted event has the following envelope data structure:
Category WorkInstructionSectionCompleted
Module WorkInstruction
Tag SectionCompleted
Topic WorkInstruction
Category WorkInstructionStepCompleted
Module WorkInstruction
Tag StepCompleted
Topic WorkInstruction
Category OnWorkInstructionStepInPending
Module WorkInstruction
Tag StepWithPendingSignature
Topic WorkInstruction
For further information, refer to the Events section of the WI_OP Reference Guide.
Commands
The WI_TASK_MS Functional Block contains the following specific commands for Work Instruction Task
Management:
Commands Function
Its artifacts allow you to manage Tasks of Work Instruction Task Type.
It references the following Functional Blocks:
• UDM_RF
• WI_MS
• WI_OP
• TSK_MS
• TSK_OP
• WI_TASK_MS
Entities
The WI_TASK_OP Functional Block contains the following entities:
WIReference Defines a Work Instruction during the A Task entity can be related to many
runtime phase. WIReference entities.
For further information, refer to the Entities section of the WI_TASK_OP Reference Guide.
Commands
The WI_TASK_OP Functional Block contains the following specific commands and post commands for Work
Instruction Task Management:
Commands Function
Crud operations
The following commands are provided in order to manage CRUD operations on entity instances:
• Create<Entity>
• Update<Entity>
• Delete<Entity>.
Revision behavior
Specific commands are provided, only for Master Data domain entities, to manage the revision behavior of each
entity instance, such as creating, copying, setting a revision or locking an entity instance.
For more information on the revision behavior, refer to Managing Revisions of Entity Instances.
• Copy<Entity>Revision
• CreateNew<Entity>Revision
• Lock<Entity> or Unlock<Entity>
• Set<Entity>RevisionCurrent or Unset<Entity>RevisionCurrent
Workflow
1. Add Third-Party Files to the Functional Block Installer Project, if needed.
2. Compile the database initialization file (Dbinit.xml) if you want to initialize the database with default values.
3. Manage the Application Log file, if you need to provide any application log messages.
4. Generate reference documentation, if required.
5. Define the build order (recommended).
6. Add automatic update function for referenced Functional Blocks, if required.
7. Generate the Functional Block package
Limitations
• Subfolders are not supported
• There must not be two files with the same name.
Procedure
1. From the Installer project, right-click the ExternalDependenices folder and select Add > ExistingFile.
2. Browse to the files you want to include in the Functional Block package and click OK.
Result
These files will be included in the External Dependencies folder of the Functional Block package zip.
Both if you are in a Functional Block and if you are in App, the tool generates an .xml representation of the
data model present in your model project and in the referenced Functional Blocks.
To initialize the Automation App data, you cannot use the dbinit.xml file because it does not perform data
checks but you must follow the configuration workflow documented at How to Manage Automation
Nodes in the Opcenter Execution Foundation User Manual
Prerequisites
• The model project has been compiled and any required referenced Functional Blocks have been included.
• The entity types you want to initialize with default values must contain a logical key, otherwise they cannot be
imported inside the initialization file.
• You have used Reference Manager to manage relationships between Functional Blocks. If you have manually
added references to other Functional Blocks, the template will not be generated.
You cannot update an entity instance whose logical key has the same value in the database as the one you
are specifying in the initialization file.
Entity type, which describes the type of the entity It can contain multiple
(corresponding to the Fullname displayed Property elements.
Used to describe an entity.
in the Properties pane of the entity in
Project Studio).
Property • name, which describes the name of the • If the described property
property. specifies a reference to a
Used to describe a property
• kind, which specifies if the property is a parent (i.e. the kind is
of an entity.
plain property, a value type property SingleReferenceToParent)
or a reference property (see notes) the element has one inner
• value, which contains the value of the LogicalKey element
property if the property defined for indicating the referenced
kind is plain. The value representation parent entity.
follows the C# • If the described property
System.Globalization.CultureInfo.Invari specifies a many-to-many
antCulture format, except for Guid relationship (i.e. the kind is
values, which are represented in the ManyToManyReference)
following example format: the element contains
"0b0e9810-096f-4864- multiple LogicalKey
b8e0-0dca91f6ff0f". If the property is elements indicating the
enumeration type the value to be linked entities.
specified must be the enumerator • If the described
name and not its numerical value. If the property specifies a
property defined for kind is not plain, value type (i.e. the
this attribute is not present. kind is Complex),
the element should
contain the inner
properties of the
value type, which
can be either Plain
or
SingleReferenceTo
Parent.
LogicalKey entityType, which specifies the type of the It contains a Property element
Specifies the key used to link linked entity. for each property that is part of
an entity to a referenced the logical key of the referenced
entity. entity.
Notes
• The kind attribute can assume the following
values: Plain, SingleReferenceToParent, ManyToManyReference, Complex.
• Relationships among entities are always specified by the forward navigation property.
• You cannot add part entities to a composite entity when it is Frozen, Locked or Marked for Cleaning.
• Null values are indicated by specifying the NULL reserved string (upper case).
• The LogicalKey elements can be nested if the logical key of an entity type includes a navigation property.
• Blob and FileType property types cannot be initialized and should not be present in the .xml.
In both cases, the default language of the xml file is English and the file name must be in the
format <prefix>.<functional block / app / extension app name>.ApplicationLog.en-US.xml.
You must not modify this file name pattern.
The system manages all the xml files and stores the catalog of messages in the database. By means of the
Application Log App, installed in Solution Studio, you can log the defined messages and view them in your UI
Application at runtime.
This section describes the structure of the xml file and its restrictions.
File Structure
ID is a mandatory attribute.
Level The type of message. The system accepts only Critical, Error,
Warning, Informational or Verbose value.
Parameter Key The primary key that stores the name of the parameter that repeats
multiple times for a message.
Parameter Type The type of the parameter that repeats multiple times for a message.
Example values for the Application Log File:
-00001 Unable to start the operation Unable to start the operation Error
%op_name% because the work order
%wo_name% is on hold.
-00001 Unable to start the operation Unable to start the operation %op_id% Error
because the work order %wo_id% is on
hold and material lot %m_lot% is mark
to be cleaned.
The Application Log xml file requires certain restrictions that you must respect to avoid any errors during the
database update in Solution Studio:
Do not modify the file name, even though the system allows you to. If you rename, the system does not
take into account the custom name and returns an error while building the Installer project.
For the whole configuration procedure, see How To Manage Application Logs.
This udoc file can then be imported into the Documentation Center via the Documentation Center Administrator
Tool consequently providing reference documentation for each Functional Block.
Output files should be always generated by default when compiling the project.
Sensitive data
• Access to the documentation service layer is anonymous. Consequently the documentation center
store must not include sensitive data. If this is strictly necessary, suitable security measures must be
implemented (e.g. restrict access to the network where the documentation service layer is deployed).
• HTTPS communication is recommended.
Inserting comments
1. In Project Studio, in the Object Model (or Public Object Model for Apps), double-click the artifact for which you
want to enter comments.
2. In the Model Details pane, in the General tab, type the required description in the Description edit box.
3. In the Properties window, enter the required descriptions for each artifact parameter or property.
The custom documentation .udoc file should be generated by default when you compile your project. If this does
not happen perform the following steps to check your configuration options, which are valid both for Functional
Blocks, Apps or Extension Apps:
1. In Solution Explorer right-click the Model project (or POMModel project) and select the Properties command.
2. Click the Compiler tab.
3. Make sure the Enable Documentation Compiler check box is enabled.
4. If you want to optimize the compilation process, select the Enable Parallel Compiler check box.
5. Build the Model project.
6. Check that the <Prefix>.<DomainName>.<FunctionalBlockName>.<DomainAcronym>.Model.udoc file (or
<Prefix>.<DomainName>.<AppName>.<Acronym>.POMModel.udoc) is saved under the
currently configured output folder (by default, the bin folder) of the Model (or POMModel) project. If you are
compiling the Installer project, the file will be placed under the output folder which is currently set for the
solution configuration you are using (e.g. bin\Debug or bin\Release or any other output folder).
Procedure
1. In the Solution Explorer pane, right-click your Command Handler project and select Build
Dependencies > Project Dependencies.
2. Click on the Dependencies tab.
3. Select your Command Handler project from the Projects drop down list.
4. In the Depends on pane select your model project and click OK.
5. Select your Event Handler project from the Projects drop down list.
6. In the Depends on pane select your model project and click OK.
If build errors persist when building from the command line, open .sln file from the solution folder, and
make sure the model project (.umproj) is the first project in the list.
Alternative Procedure
To set the build order perform the following procedure, first for the command handler project, then for the event
handler and then for the installer project:
1. Create a reference to the model project from the command handler project by right-clicking
the CommandHandler project node in Solution Explorer and clicking Add > Reference.
2. In the Reference Manager window (of Visual Studio) select Projects > Solution in the left hand pane, select the
model project and click OK.
3. Right-click the CommandHandler project and select Build.
4. Right-click the CommandHandler project node in Solution Explorer and select Open Folder in File Explorer.
5. Open the file <FunctionalBlockName>.CommandHandler.csproj with a text editor.
6. In the <ProjectReference> node including the model project reference you have added at step 2,
type <ReferenceOutputAssembly>false</ReferenceOutputAssembly>.
7. Click Save.
8. Repeat the whole procedure for the Event handler project and then for the Installer project, according to the
following:
Source Project Referenced Project
Prerequisites
The build order must have been defined.
Procedure
The RestoreSimaticITUAFPackage target can be added to your solution as follows:
1. Right-click the model project node in Solution Explorer and select Open Folder in File Explorer.
2. Open the file <FunctionalBlockName>_<Acronym>Model.umproj with a text editor.
3. At the end of the file add the following nodes:
<Import Project="$(SITUnifiedVSToolingPlatformBin)
\Siemens.SimaticIt.ReferenceManager.targets" />
<Target Name="BeforeBuild">
<CallTarget Targets="RestoreSimaticITUAFPackage"/>
</Target>
Prerequisites
• If the Functional Block contains the definition of commands or events, you must also have imported the related
command or event C# classes (these classes must not necessarily contain implemented code, but they must be
present in the Functional Block).
• If you want to enter default values for the initialization of the Opcenter EX FN database, the Dbinit.xml file has
been compiled.
• If you want to add/edit the application log messages for the Functional Block, Application Log file has been
managed.
• If you want to use the Copy to Engineering Target Folder (see explanation below), the user that is currently
running MS Visual Studio must have write permissions on the target folder (either the user himself or by means
of a dedicated Windows group).
If your Functional Block contains references to other Functional Blocks, Reference Manager will ensure
that this Functional Block will also be included in the Functional Block Package. However, if you added a
reference manually, without using Reference Manager, you must have
modified the <Prefix>.<FunctionalBlockName>.References.xml file contained in the Installer
project > Config folder.
Procedure
1. Right-click the Installer project and select Properties.
2. Select the Copy to Engineering Target Folder check box to automatically copy the generated zip file to the
Engineering target folder (%ProgramData%
\Siemens\SimaticIT\Unified\Engineering\Packages\FunctionalBlocks).
3. Build the Installer Project in either of the following ways:
• by building the entire Solution
• by building the Installer project.
The output files are saved by default in the bin\Debug folder of the Installer project (for example,
MyFBLibrary\MyFBLibrary.Installer\bin\Debug). You can define the location of the project as
its Location when you create the solution in MS Visual Studio.
If you do not select the Copy to Engineering Target folder check box, you must manually copy the
generated output zip file to the Engineering target folder.
• bin, .dlls for entities, types and the definition of commands, post-actions, pre-checks and events
• manifacturingmodel, with the .um and .umd files
• manifest.xml, which includes:
• the metadata created in the Functional Block (relative to the model and the business logic)
• any referenced library Functional Blocks.
• udoc file, present if custom documentation has been generated from descriptions provided in the Functional
Block.
Workflow
The App is developed in four main steps:
1. Create the App.
2. Model the Public Object Model (POM) and define the Data Model
3. Implement the business logic.
4. Develop the user interface.
5. Create the App package to be loaded in Solution Studio.
Selected artifacts are then imported into the Public Object Model, which will be exposed on the Service Layer.
Workflow
The creation phase involves the following steps:
1. Create a new App.
2. Create references to existing Functional Blocks.
3. (Optional) Import entities from an external data source, such as SQL or Oracle.
Procedure
1. In Project Studio select the File > New > Project command.
2. In the left pane, click Installed and then expand the Simatic IT node.
3. Select FunctionalBlock.App.
4. Enter a name for the App, which will then be used in the solution. The name can contain only alphanumeric
characters (20 characters maximum), and it cannot be modified once inserted.
The name of the App must not be identical to the name of any referenced Functional Blocks or artifact
types (e.g. "event", "commands" etc) and must not contain C# reserved keywords.
5. Enter the location where the App will be created. The location name cannot contain the following special
characters: < (less than), > (greater than), : (colon), " (double quote), / (forward slash), \ (backslash), | (vertical
bar or pipe), ? (question mark), * (asterisk), & (ampersand), # (hashtag), % (percentage), , (comma).
6. Click OK: the creation process is simplified by an integrated wizard which guides you through the necessary
steps.
7. Click Next.
8. Enter a prefix for the App (see constraints below). The prefix is then appended to the App name in order to easily
identify it within the development and configuration process.
9. Modify the App version if the default value (01.00.00) does not correspond to your requirements.
10. Insert a description providing other users with additional and exhaustive information on the functionality
provided by the App.
Note During the modeling phase, it will be possible to modify the description of the App at any time, right-
clicking the Installer project and selecting the Properties command.
11. Enter a two digit acronym for the Public Object Model (POM) which must be different from the acronyms
assigned to the standard domains (i.e. not RF, OP, MS). The acronym must not start with a number.
12. Click Next.
13. Select which elements (called projects in the Solution Explorer in Project Studio) your App will contain:
• Public Object Model (POM) Project (always selected by default) which contains the public reading data
model.
• Reading Function Project: from which you can implement the query expression for reading functions.
• Command Handler Project: from which you can implement the business logic for composite
commands.
• Event Handler Project: from which you can implement the business logic for referenced events.
• UI Project: from which you can develop a user interface for your App.
• Installer Project (always selected by default): where the files required to create the App package are
contained.
Once you have created your App solution, you can subsequently remove or add projects from Visual
Studio.
Bear in mind that you cannot add any projects (such as Functional Block solutions) which are not
supported by the App wizard.
Result
If you have selected all available projects the structure displayed in the Solution Explorer pane is the following:
The <Prefix>_<Acronym>_<AppName>.dm file, which will contain the graphical representation of the data model
(in the Diagrams sub-folder), is created within the model project folder.
Additional operations
Version Types Add Element Remove Element Change Element Change Handlers
Patch
Minor
Major
Elements may be composite commands, signals, value types, type aliases, enumeration types and roles, and their
related arguments.
UI elements may be:
• UI Module definitions and metadata
• UI Screen definitions and metadata
• UI Component definitions, metadata, and public interfaces such as events and functions and their related
parameters.
Elements that are already part of the model cannot be modified or deleted in Patch and Minor versions.
Patch
When you create a new patch no changes can be made to the model, manifest or public APIs.
A Patch version is basically intended for bug fixing. Only the business logic at C# level in the command and event
handlers and the UI source files can be modified.
All options that allow additions and changes to the data model will be disabled in Project Studio.
No constraints are applied to UI files in Project Studio, but you must not change the manifest or Public APIs to
ensure compatibility.
Minor Version
When you create a new minor version you can add elements:
• to your model, such as entities imported from external data source views, composite commands, parameter
types, enumeration types or roles, and related arguments;
• to your UI, such as UI Modules, UI Components, APIs, DPCs, events, functions and relative parameters.
You cannot delete or modify any elements present in the model in the previously released minor version.
None of the added elements can be set as mandatory, as this would break compatibility with the existing version.
All options that allow changes to and deletion of elements in the data model will be disabled in Project Studio. You
can however modify and delete elements that have been added in the minor version itself.
No constraints are applied to UI files in Project Studio, but you must not modify or delete elements that would
change the manifest or Public APIs to ensure compatibility.
A new minor version will reset the patch number to 00 (e.g. a new minor version 02 could be for example 01.02.00).
Major Version
A new Major version leaves you with complete freedom to delete and modify elements and destroy compatibility.
A new Major version will reset the patch and minor version numbers to 00 (e.g. a new major version 02 would be
02.00.00).
Procedure
1. Right-click the Installer project in the Solution Explorer pane and select Properties.
2. Click the Version Information button and enter the new version, noting that:
• If you enter a new Major version the Minor and Patch versions will be set to 00.
• If you enter a new Minor version the Patch version will be set to 00.
Referenced artifacts cannot be modified or deleted, however, a number of operations can be performed from the
Public Object Model on imported artifacts:
• Imported entities:
• Import and rename referenced entities
• Hide properties and relationships of imported entities
• Unpublish entities, removing them from the Public Object Model
• Create relationships from imported entities to referenced entities
• Imported protected commands:
• Import and rename a referenced protected command, consequently exposing them on the Service Layer.
• Unpublish protected commands, removing them from the Public Object Model
Although events cannot be modified, you can create new handlers for referenced events.
Reference Manager
Functional Blocks should be always referenced with Reference Manager, because it automatically performs a series
of useful operations including:
• copying the selected Functional Block package in the Solution Folder of the current project;
• unzipping the folder of the referenced Functional Block and saving its files locally;
• adding the model assembly .dll files to the command and event handlers;
• ensuring that the referenced Functional Block is included in the Functional Block package.
Information on the referenced Functional Blocks is then saved in the packages.reference file:
packages.reference content
<functionalblocks>
<functionalblock>
<name>RefMan.FBLibRM</name>
<version>01.00.00</version>
<type>Library</type>
</functionalblock>
</functionalblocks>
Although not recommended, you can alternatively manually manage solution references by using the
standard Visual Studio Add Reference command. This procedure has the following drawbacks:
• you will have to manually add the model assembly .dll files of the Functional Block to the command
and event handler project.
• you will have to add the details of the referenced Functional Block to the installer project so that it will
be included in the Functional Block package.
• Project Studio will not disable operations according to the type of version you are working on, with the
consequent risk of incompatibilities.
Available operations
The operations you can perform in Reference Manager depend on the current version of the Functional Block you
are working on.
For more information on versions see Creating a New Version of Functional Block or App.
The possible operations inside Reference Manager are:
Patch
Minor
Major
If two referenced Functional Blocks themselves reference the same Functional Block (i.e. A and B both
reference C) Reference Manager checks to see whether they reference the same version.
If they differ by patch or minor version the highest version is loaded.
For example:
• A references version 01.00.01 of Functional Block C
• B references version 01.00.02 of Functional Block C
Reference Manager will load version 01.00.02 as this should not cause compatibility issues.
If they differ by major version an error is returned and the operation will not be possible.
Procedure
1. In the Solution Explorer pane, double-click the packages.reference file in the Solution Items folder.
2. If enabled, click Restore packages, in order to be sure to correctly update all solution references.
3. Click on the Browse tab and select the Functional Block you want to reference. If it can be installed, its details
will be displayed in the pane on the right, otherwise an error message will be displayed.
4. Click Install. If the Functional Block contains references to other Functional Blocks, these will be displayed
under Dependencies and will automatically be installed if their .zip files are available in the folder, otherwise
you will receive an error message.
Result
• The packages you have installed will be displayed in the Installed tab and will have a green tick icon next to
them.
• According to the projects contained in the referenced Functional Block, the Solution Explorer tree view will
contain, under the References folder of each project, the .um, .umd and .dlls of the referenced projects. The
folder SimaticITPackages, if it does not already exist, will be created in the folder where your project files are
saved. A subfolder will be created for each referenced Functional Block, its name is comprised of the name and
version of the referenced Functional Block. The files contained in the .zip file are saved in this folder, with the
following structure:
• config folder, with the Dbinit.xml file for initializing the database
• handlers folder, with the command and event handlers
• model folder, with the data model files and assemblies
• ExternalDependencies folder, with third-party files required by the Functional Block you are referencing
• Manifest.xml file
• The .um file of the original Functional Block displays all the referenced artifacts in the Model Explorer.
Prerequisite
The output zip file of the original version we want to upgrade from, together with the zip of the new version we
want to upgrade to must be already present in the folder %ProgramData%
\Siemens\SimaticIT\Unified\Engineering\Packages\FunctionalBlocks.
If a referenced Functional Block is missing in the file system repository (i.e. %ProgramData%
\Siemens\SimaticIT\Unified\Engineering\Packages\FunctionalBlocks), and the system prevents you from
building the solution, we suggest that you perform the procedure described in the
document Troubleshooting: How to fix a Project Studio Solution if a referenced Functional Block is missing
available on GTAC site. The article will help you to manually remove the missing references from the
project and be able to install or restore the packages you need.
Procedure
1. In the Solution Explorer pane, double-click the packages.reference file in the Solution Items folder.
2. Click Restore packages, in order to be sure to correctly update all solution references.
3. Click on the Installed tab and select the Functional Block you want to update. If it can be updated, its details
will be displayed in the pane on the right, otherwise an error message will be displayed.
4. Click Update. If the Functional Block contains references to other Functional Blocks, they will be automatically
installed if their .zip files are available in the folder, otherwise you will receive an error message.
If two referenced Functional Blocks themselves reference the same Functional Block (i.e. A and B both
reference C) Reference Manager checks to see whether they reference the same version.
If they differ by patch or minor version the highest version is loaded.
For example:
• A references version 01.00.01 of Functional Block C
• B references version 01.00.02 of Functional Block C
Reference Manager will load version 01.00.02 as this should not cause compatibility issues.
If they differ by major version an error is returned and the operation will not be possible.
Prerequisites
The new output zip file of the Functional Block you want to restore, created during the Functional Block generation,
must be saved in the folder %ProgramData%
\Siemens\SimaticIT\Unified\Engineering\Packages\FunctionalBlocks.
If a referenced Functional Block is missing in the file system repository (i.e. %ProgramData%
\Siemens\SimaticIT\Unified\Engineering\Packages\FunctionalBlocks), and the system prevents you from
building the solution, we suggest that you perform the procedure described in the
document Troubleshooting: How to fix a Project Studio Solution if a referenced Functional Block is missing
available on GTAC site. The article will help you to manually remove the missing references from the
project and be able to install or restore the packages you need.
Procedure
1. Double-click the packages.reference file in the Solution Items folder of the Solution Explorer.
2. Click Restore packages. If the zips of the referenced Functional Blocks have been saved in the correct folder the
referenced Functional Blocks will be restored on the user's machine, otherwise an error message will be
displayed.
Workflow
To correctly import entities from external databases you must perform the following steps
1. Follow guidelines on how to create a view that will allow you to correctly import entities in your App.
2. Import views from the external database into your App.
During the deployment phase, the system automatically creates a set of views on top of the newly created
database. You cannot use these views to import entities into the POM, but only custom created views
Prerequisites
• If you are creating views on SQL Server/Oracle database, all newly created views must be granted with reading
permissions through an appropriate script (in particular for the Project Studio user). This script must be run
after all views have been created. See Configuring a Third-Party MSSQL Database and Configuring a Third-Party
Oracle Database in the Opcenter Execution Foundation Installation Guide.
• You must have deployed your App and created an Opcenter EX FN database before importing complex views.
• Views must be custom views (created by the user) and not system views (i.e. views created by the deploy
operation).
• Views must be imported from Opcenter EX FN databases only.
Third-party types
Views can contain only Opcenter Execution Foundation supported types and the conversion from third-party to
supported types is performed as follows:
Oracle
Considered as a number
(38,19)
Microsoft SQL Server Is Supported Project Studio System .NET Corresponding Type
Type
Microsoft SQL Server Is Supported Project Studio System .NET Corresponding Type
Type
The person in charge of creating the views must know both the logic and the semantic of the source tables,
in order to correctly use the C# types while implementing the handlers that use as reading model the
corresponding entities. The TimeSpan C# type is not supported into the Public Object Model.
Limitations
• Views can be imported from different databases, as long as they belong to the same data source provider, but
these views must then be present on the same database which will be used when you deploy the project.
• Once you drag and drop or import a view from a particular data source provider (e.g. SQL) you cannot at that
point add views from other data source providers (e.g. Oracle).
• To switch data source provider you must delete all the entities from the previous provider in the model, and
then import new views from the new provider.
Procedure
1. Open the POMModel project within the App and then double-click the .um or .dm project file.
2. In the Model Explorer click the Public Object Model Configuration tab.
3. Right-click the required data source provider (either SQL or Oracle) and then select Add Oracle/MSSQL Server.
4. Set the following parameters:
Parameter Description
Server The name of the server. Only for MSSQL, click on the drop-down list box to automatically
Name populate it with the available servers.
Authentica The authentication mode of the user. The available options are:
tion
• Windows Authentication: in this case the database connection is made using the
credentials of the interactive user who is running Visual Studio (and consequently
Project Studio) and who must also have the necessary grants to access the SQL/
Oracle views.
• (Only for MSSQL) Sql Authentication: in this case the database connection is
made using the credentials of the user who must have the necessary grants to
access the SQL views.
• (Only for Oracle) Oracle Authentication: in this case the database connection is
made using the credentials of the user who must have the necessary grants to
access the Oracle views.
For more information, see How To Configure Third-Party Databases in the Opcenter Execution
Foundation Installation Guide.
User Name (Only in case of database authentication) The name of the user who must have the necessary
grants to access the SQL/Oracle views.
Password (Only in case of database authentication) The password associated with the user who must
have the necessary grants to access the SQL/Oracle views.
5. Click Test Connection to make sure the data external source is viable.
6. Click OK.
7. Check if there is a green plug icon below the connection node which indicates you are correctly connected to
the data provider.
8. You can now import your required entities in the POM.
Editing a connection
You can edit your database connection, as long as it uses the same data source provider, by right-clicking the
connection node in the External Data Source view and selecting Edit.
The system connects to the target repository and loads its views.
• If the name of a new database view corresponds to a previously imported entity, and differences are found, the
corresponding view is marked with an asterisk and an exclamation mark. The view can then be updated.
• Any views that were previously imported and that are not present in the new database connection will still be
displayed as artifacts in the central work pane, but a warning message will be displayed.
Refreshing a connection
If you know changes have been made to the MSSQL/Oracle database views, you can incorporate these changes into
your imported views by refreshing the connection.
This is simply done by right-clicking the connection node in the External Data Source view and selecting Refresh.
Any inconsistencies between the source database views and imported views will be marked by an asterisk and an
exclamation mark. At this point you can update the corresponding database views.
Changing provider
If you want to change provider you must first remove any views you imported from the initial provider.
Imported views can be deleted either by right-clicking any entities that have been dragged and dropped into the
central pane and selecting Delete, or by deleting the corresponding entities from the Object Model view.
You then add the new connector following the standard procedure.
Functionalities
The POM offers the following functionalities:
• Projection, whereby you can select which public entity properties you want to include in the POM.
• Aggregation, where you can define additional relationships between entities.
Workflow
1. Modeling entities.
2. Modeling parameter types.
3. Modeling enumeration types.
4. Modeling commands.
5. Modeling Pre-Checks (as described for the Functional Blocks).
6. Modeling Post-Actions (as described for the Functional Blocks).
7. Modeling signals.
8. Creating event handlers.
9. Configuring event subscriptions.
10. Building the Public Object Model project.
The Public Object Model pane contains a set of artifacts that are directly referenced from Functional Blocks (if any
have been referenced) and a set of artifacts that have been explicitly imported or created inside the Public Object
Model.
The tab contains the following nodes:
• Data Model node:
• entities (belonging to the referenced Functional Blocks) only if they have been imported from the Public
Object Model Configuration tab.
• Reading Functions node:
• newly created reading functions
• Commands node:
• public commands (belonging to the referenced Functional Blocks) only if they have been imported from
the Public Object Model Configuration tab.
• newly created composite commands
• Events node:
• all the events that either newly created in the Public Object Model or that belong to the referenced
Functional Blocks
• Types node:
• all the types that are either newly created in the Public Object Model or that belong to the referenced Functional
Blocks (value types, parameter types, type aliases and enumeration types)
• Roles node:
• newly created roles, that can be associated to entities, commands, events and signals.
All Apps contain a reference to an internal functional block, which exposes two events,
the CommittedEvent and the DebugStartupEvent, which are visible in the POM Project of your App as
referenced events.
Model Designer
The central model designer pane graphically displays the artifacts you have imported into the POM, along with
their corresponding relations and extensions, so you can easily see and check the relationships that exist between
different elements.
The graphical representation is saved as a DM file, which can be versioned in source control systems, but not
merged. A default DM file with the name of the App is created, which you can modify as required, but you cannot
rename or delete it.
You can also create additional model diagrams by right-clicking the Diagram folder in your model, selecting Add
New Item > Add New Diagram and providing a name for the new Model Diagram Class you will create. These
additional files will be saved in the Diagrams folder, together with the default DM file. They can be deleted but not
renamed.
Each DM model can display a different part of the data model, which may be particularly useful if the data model
contains many artifacts, or if you want to display only a particular part of the model. DM files are graphical
representations of the same underlying data model, so if, for example, you delete an artifact from the model it will
be removed from all the DM files where it was present. In this case each DM file will display the dirty asterisk in its
title bar, indicating that the file must be saved as the underlying model has changed.
Right-clicking in any empty area within the model designer pane allows you to perform a series of useful operations
involving the model artifacts, such as:
• adding new composite commands, parameter types, enumeration types, roles and reading functions,
• deleting artifacts,
• collapsing and expanding the view,
• exporting the view as an image,
• hiding specific artifacts,
• increasing/decreasing the size of the tiles (zooming in/out).
Write a description for an entity and for each single property of an entity
Delete an entity
Rename an entity
Create a facet
Extend an entity
Create indexes
Workflow
• Import the entities you want to include in the Public Object Model
• Hide entity properties or relationships
• Create relationships between entities in the Public Object Model
From this list you must decide which entities you want to import into your Public Object Model.
Importing entities
1. In the tree list expand the SQL/Oracle or Functional Block node, select the entity you want to import and either:
• drag and drop the view into the central working area,
• right-click the required entity and select Import.
2. If you select an entity that has the same name as an entity that has already been imported into the Public Object
Model (but belonging to a different referenced Functional Block), an error message is displayed prompting you
to define an alternative name to uniquely identify it within the POM. You can subsequently modify the entity
name by right-clicking the entity in the Public Object Model pane and selecting Rename. Certain reserved
keywords should not be used in the entity name.
You cannot change the system properties of referenced Functional Blocks (you can only change the
description).
Result
The imported entities are displayed in the Public Object Model tab, from where relationships can be created with
other entities and some basic modifications can be made.
You can also chose if you want to hide or publish all the entity properties and its related entities.
Deleting entities
To delete an entity, you must simply right-click and select Delete.
However, it may be necessary to enable the Delete On Cascade option in order to perform this operation:
Entities in a ManyToMany
relationship
Procedure
1. Select the entity in the central working pane of the Public Object Model.
2. In the Model Details pane select one of the following:
• the entity property in the Properties tab.
• the simple relationship in the Relationships tab
• the composite relationship in the Composition tab.
3. Select Hidden as the Visibility option in the Properties pane of Visual Studio.
Constraints
• Relationships are created between a property of the first entity and the ID of the second entity.
• Relationships can be created between properties of type Guid, Int, String, however, the data types used for the
relationship must be identical.
• The GUID is always used as an ID for entities from referenced Functional Blocks that belong to the Opcenter EX
FN data model domain (OP, RF, MS), so to create a relationship with these entities you must also select the GUID
of the first entity.
• The ID of entities that have been imported from Opcenter EX FN databases or user domain Functional Blocks
could be GUID, Int or String, so to create a relationship with these entities you must select a property that has
this same data type in the first entity.
• You cannot create a relationship from an entity that has been hidden and you cannot hide relationships that
have been created directly in the POM.
Procedure
1. Open the POMModel project and double-click the .um or .dm project file.
2. In the Public Object Model tab, select the entity whose property you want to use to create the relationship.
3. In the Model Designer pane, right-click the property (of type Guid, Int or String) that will be used for the
relationship, and select Create Relationship.
4. In the Parent Artifact Name edit box browse to the entity to which you want to create the relationship.
5. Optionally insert in the Navigation Property edit box a name which will be included in the parent entity, so that
a list of child entities will be available from the parent entity.
6. Click OK: the relationship is displayed in the central pane and the property used to create the relationship is no
longer displayed in the list of properties.
7. To remove an relationship:
Characteristics of relationship
The characteristics of the relationship, which are visible in the tab in the Model Details pane, cannot be
modified and are:
Characteristic Value
cardinality ManyToOne
The Description edit box supports markdown formatting, thus allowing you to correctly format the
information to be included in the reference documentation file.
Type Description
System Types Possible simple properties are: int, bigint, smallint, tinyint, decimal,
bool, datetime, Guid
Entity Properties You can use the type of an entity property (not the property itself) by
browsing to the entity object and then to one of its properties.
The Description edit box supports markdown formatting, thus allowing you to correctly format the
information to be included in the reference documentation file.
3. You can now add enumerators to the enumeration types in the same way as properties are added to entities in a
Functional Block.
Pre-Checks
Pre-Checks can be used to implement conditions that determine the execution, or the non execution, of a
command.
When you import a referenced command, the related Pre-Checks are imported as well. Pre-Checks can be also
modeled and implemented inside the Apps. For more information, see Modeling Pre-Checks (as described for the
Functional Blocks).
Post-Actions
Post-Actions can be implemented to extend the business logic of Commands belonging to Functional Blocks (both
Referenced and not Referenced), as well as the business logic of Composite Commands belonging to Base Apps/
Extension Apps.
Post-Actions represent additional code that will be executed at the end of the Handler of the Command/Composite
Command.
When you import a referenced command, the related Post-Actions are imported as well. Post-Actions can be also
modeled and implemented inside the Base Apps/Extension Apps. For more information, see Modeling Post-Actions
(as described for the Functional Blocks).
Composite
Command handler
Let's assume you want to create many entities, for example orders, using an XML file and then implement business
logic that reads the entity details from the file and saves them in a database.
If you create a Composite Command, you can develop logic where:
• the input is an XML file as a blob type
• you identify the n entities that must be created
• you then pass each entity instance to the subcommands with an asynchronous call.
In this scenario the subcommands are called in parallel. Each subcommand opens and closes a single transaction
and if one subcommand fails it does not determine the failure of the other subcommands. The execution time of
this code is reduced because each transaction does not wait for the end of the other transactions. This scenario
would be appropriate when you must insert a large amount of data in a database and possible errors on single
entities are not a priority.
If you develop the same logic in a standard Command, all the submit operations are serialized within a unique
transaction. The execution time of this type of logic would be longer and the risk of generating an optimistic
concurrency error would also be higher.
Consequently, Composite Commands are much faster in terms of execution time, and thus they should be used
when you do not need to stop and rollback the entire call chain for a single error.
Example
In the following example the composite command creates a Product Production Rule (PPR) and its logically linked
associated Product Segment (PS).
In order to carry out this operation two protected commands are invoked:
• one to create the PPR
• one to create the PS.
If the PS creation fails for any reason, the previously created PPR is deleted with an appropriate command.
private CompositeCommandCreatePPR.Response
CompositeCommandCreatePPRHandler(CompositeCommandCreatePPR command)
{
string pprName = null;
try
{
// Creation of PPR
var result = Platform.CallCommand<CreatePPR, CreatePPR.Response>(new
CreatePPR()); // first transaction
if (result.Succeeded)
{
pprName = result.PPRName;
// Creation of PS associated to PPR
Platform.CallCommand<CreatePS, CreatePS.Response>(new
CreatePS(pprName)); // second transaction
}
}
catch (UnifiedException exception)
{
if(pprName != null )
{
Platform.CallCommand<DeletePPR, DeletePPR.Response>(new
DeletePPR(pprName));
}
throw;
}
}
Copying Commands
Once you have imported a protected Command, if you copy it, the copied artifact will be a Composite
Command and not a public Command. This is required because inside the POM Model, only Composite
Commands that can be created from scratch.
Procedure
1. Open the POMModel project and then double-click the .um or .dm project file.
2. In the Public Object Model Configuration tab select the required commands and then do either of the
following:
• drag and drop them to the central working area (multi-selection is allowed).
• right-click and then select Import.
Naming conventions
If you select a command that has the same name as a command that has already been imported into the
Public Object Model (but belonging to a different referenced Functional Block), you are prompted
to define an alternative name to uniquely identify it within the POM.
In case of commands imported to Extension Apps, the name of the Extension App is automatically added
to the command name and cannot be removed.
For all commands, you can subsequently modify the command public name in the command properties.
Procedure
Composite commands can be either created from scratch or as a copy of existing ones.
1. Right-click the Commands node in the Public Object Model tab and select New Composite Command.
2. Enter a name for the new command, which cannot be successively modified. Certain reserved keywords should
not be used in the composite command name.
3. Enter a description for the command. The Description edit box supports markdown formatting, thus allowing
you to correctly format the information to be included in the reference documentation file.
4. Clear Securable if you want to allow all authorized users to execute the composite command, instead of
assigning it to a role.
5. Click OK: the new composite command is displayed in the central Designer Model pane and in the Public
Object Model tab with a specific icon.
6. Right-click the name or the icon of the command in the central Designer Model pane and select either of the
following:
• Add new Input Parameter
• Add new Output Parameter.
7. In the Properties
tab of the Model Details pane enter a user-friendly name for the property.
8. Click on the browse button and select the property from the Property Browser, which can be either a System
Type property or a Parameter Type (both referenced and created within the App).
9. Click OK.
10. In the Properties pane enter the attributes for your selected parameters (see table below).
11. If necessary, in the General tab of the Model Details pane add tags to the command to facilitate search
operations (by clicking Add and either entering a new tag or selecting one from the list).
12. Build the POMModel project, by right-clicking it and selecting Build.
String
Integer
(int, tinyint,
smallint, bigint)
DateTime
Guid
Bool
Decimal
ParameterType
TimeSpan
Blob
The Allow Empty String annotation (which accepts True or False) allows you to pass an empty string as parameter
value. It can only be used with String types and if Optional is set to False.
1. Right-click the Reading Function node in the Public Object Model tree and select New Reading Function.
2. Enter a name for the new Reading Function. This name cannot successively be modified. Certain reserved
keywords should not be used in the role name.
3. (Optional) Enter a description for the Reading Function. The Description edit box supports markdown
formatting, thus allowing you to correctly format the information to be included in the reference
documentation file.
4. Clear Securable if you do not want to assign the Reading Function invocation to any roles.
5. Click OK: Reading Functions are displayed in the central Designer Model pane.
6. Add input and output parameters to the Reading Function.
7. If necessary, in the General tab of the Model Details pane add tags to the Reading Function to facilitate search
operations (by clicking Add and either entering a new tag or selecting one from the list).
Adding parameters
1. Right-click the name or the icon of the artifact in the central Designer Model pane and select either Add new
Input Parameter or Add new Output Parameter.
2. In the Properties tab of the Model Details pane, enter a user-friendly name. Certain reserved keywords
should not be used in parameter names.
3. Click on the browse button and select the property from the Property Browser dialog box, which can belong to
three distinct categories:
• properties of other entities (from Data Model node),
• System Types: simple types, such as string, bool, int etc..,
• Types: Parameter Types, Type Aliases, Enumeration Types.
You can define parameter attributes to set validation criteria or data dimension.
If you set validation attributes on output parameters, these attributes are used for data structure validation at the
end of the handler execution (see Implementing Command and Event Handlers or Importing and Implementing
Reading Function Handlers).
You can also assign a description to the parameters in this pane. The Description edit box supports markdown
formatting, thus allowing you to correctly format the information to be included in the reference documentation
file.
1. Select the parameter of your artifact in the Parameters tab of the Model Details pane.
2. In the Properties pane enter the attributes for your selected properties:
String
Integer
(int, tinyint,
smallint, bigint)
DateTime
Guid
Bool
Decimal
ParameterType
TimeSpan
EnumerationTy
pe
• The Reading Function output parameters for which the Optional attribute has been set to False, are
mandatory at runtime only if the Response does not contain an error code.
• If, for any artifact type, the MaxLength attribute for String and Blob types is not specified (i.e. empty
value) the maximum length possible for the type will be automatically applied (i.e. 2GB (-1 byte)),
regardless of whether your underlying system is x32 or x64. If specified, the value must be between 1,0
and 2GB (-1 byte).
• The Allow Emtpy String annotation (which accepts True or False) allows you to pass an empty string
as parameter value. It can only be used with String types and if Optional is set to False.
Constraints
Artifact Description
Entity In order to be published as a signal, an entity must have been imported into
POM and must be contained in a Functional Block defined in Reference
Data, Master Data, or Operational Data domains (i.e. user-defined domains
and Opcenter Execution Foundation internal views cannot be used).
Entities that have been imported via SQL/Oracle from Opcenter EX FN views
repositories cannot be published as signals.
Procedure
1. In the Public Object Model tab, right-click the entity or the event for which you want to create a signal and
select New Signal.
Enter a name and description for the signal. The name can subsequently be modified using
the Rename operation. Certain reserved keywords should not be used in the signal name.
The Description edit box supports markdown formatting, thus allowing you to correctly format the
information to be included in the reference documentation file.
2. Clear Securable if you want to make this signal visible to all authorized users, without assigning it to any
specific roles.
Source Description
IsNullable Defines whether the property can have a null value in the signal.
• Local entity properties can be null.
• System properties cannot be null.
• Mandatory event parameters cannot be null.
Source Defines whether the property was created in the entity/event (local) or is a
system property.
System properties are read-only, cannot be null and cannot be renamed.
If one of the properties corresponds to a signal system property, a prefix is
automatically added to the property name to render it unique
(e.g. <EntityName>_<PropertyName>).
Visibility Defines whether an entity property has been hidden in the POM or not.
• Signal properties based on entities inherit their visibility from the
underlying entity property.
• Signal properties based on events are always visible.
Hidden properties cannot be renamed.
To rename properties:
1. Select the signal in the Model Designer pane.
2. Select the property in the Model Details pane and enter a new name.
The details of the data structure transformations are displayed in the following sections.
Event transformation details
The table below compares the parameters of the source event with the members of the signal. It also indicates how
the Mandatory property, which is used for validation criteria in the generated class of the event, is used in the
Signal.
List of simple type properties The same properties are returned. • Event: e1 with
• Name (type
string),
• Groups (type
List Of strings)
• Signal s1:
• Name (type
string)
• Groups (type
List Of strings)
Parameter type containing simple Each simple type of the parameter • Event: e1 with
type properties type is returned. • Prop1 (type
pt1)
• Parameter Type: pt1,
with
• Name (type
string),
• Count (type int)
• Signal s1:
• Prop1 (type
pt1) with
• Name
(type
string)
• Count
(type
string)
Parameter type containing The simple type of the parameter type • Parameter Type: pt1
parameter types is returned. with
• Name (type
The nested parameter types are string),
ignored. • Count (type int)
• Parameter Type: pt2
with
• Description
(type string),
• Param1 (type
pt1)
• Event: e1,
• with Prop1
(type pt2)
• Signal s1:
• Prop1 (type
pt2) with
• Descript
ion (type
string)
Parameter type with list of simple The simple type of the parameter type • Parameter Type: pt1
type properties is returned. with
• Groups (type
The nested list of simple types is List Of strings),
returned. • Count (type int)
• Event e1 with
• Prop1 (type
pt1)
• Signal s1:
• Prop1 (type
pt1) with
• Groups
(type List
Of
strings)
• Count
(type
string)
Value Type containing simple types Value type simple properties • Value Type: vt1, with
are returned with the format • Name (type string),
expressed in the following example. • Count (type int)
• Entity: e1 with
• Prop1 (type vt1)
• Signal s1:
• Prop1 (type vt1) with
• Name (type
string)
• Count (type
int)
Value Type containing reference to The signal will contain only • Entity: e2 with
another entity those entity properties that have • Description (type
been explicitly mapped inside the string),
value type • Quantity (decimal)
• Value Type: vt1 with
An entity property which has • Name (type e2.Id)
been not included in the value type (corresponding to the
is not returned by the signal (e.g. entity in brackets in
Quantity in the example). the Property Browser
dialog box in Project
Studio),
• Description (type
e2.Description)
• Entity: e1, with
• Prop1 (type vt1)
• Signal s1 (referring to e1):
• Prop1 (type vt1) with
• Name (type
Guid)
• Description
(type string)
Entity with relationships towards If the cardinality of an entity • Entity: Order with
other entities: one-to-many or involved in a One-To-Many • Description (type
many-to-many (see the screenshot relationship is Many (for example, string),
below with project model the Entry entity in the example), • Quantity (type
configuration example) and you have subscribed to this decimal)
entity, the signal returns the Id • Entity: Entry with
(Guid) of the related entity (Order, • Name (type string),
in the example). • Order navigation
property towards
Entry and Cardinality
Many-To-One
If the cardinality of an entity
• Signal for Entry:
involved in a One-To-Many
• Name (type string)
relationship is One (for example,
• Order_Id (type Guid)
the Order entity in the example),
• Signal for Order:
and you have subscribed to this
• Description (type
entity, the signal does not return
string)
the relationship towards the Many
• Quantity (type
relationship (Entry).
decimal)
If two entities are involved in a
Many-To-Many relationship, the
related signals do not return any
information about the referenced
entities.
In case of Delete and Bulk operations (Action = Deleted, or Operation = Bulk) the returned data is
different. See the CommittedEvent description for all the parameter descriptions.
Order
Relationship configuration
Example of event
An example of signal data structure for an event is the following.
Event example
Workflow
You can create roles and assign rights to roles in either of the following ways:
• by creating pre-defined roles in the App / Extension App (these roles will be imported into Solution Studio in
read-only mode)
• or by creating roles directly in Solution Studio
Prerequisites
• Artifacts have been configured as securable objects.
• Artifacts are present in the POM Model (i.e. they have been imported to the POM Model or they have been
directly created inside it).
Assigning permissions
Once created, roles can be assigned to permissions.
1. From the Public Object Model pane, double click the role you want to configure.
2. In the Model Designer, click Permissions to open the security details.
3. Right-click in the security details area and select one of the following commands according to the permissions
you want to assign:
• Associate Entity to Role
• Associate Command to Role
• Associate Event to Role
• Associate Signal to Role
4. In the displayed dialog box, after filtering either by source domain or searching by artifact name, select the
artifact/s you want to secure and the required actions. Note: If you choose a Functional Block source domain,
the system returns all the POM commands or entities that have been imported from the specified Functional
Block domain. If you choose an App source domain, the system returns all the Composite commands created in
the specified App or the entities imported from external views.
5. If you are assigning permissions to a published command (i.e. a command imported into an App from a
Functional Block), you can specify whether permissions will be propagated also to the original Functional Block
command or whether they will be assigned only to the selected published command.
6. Click OK to save changes.
You can also assign UI screens to roles, but you must perform this operation in the UI Module manifest.
System Events
All Apps contain a reference to an internal Functional Block. This Functional Block exposes a set of events, which
are visible in the Model Project of your App as referenced events:
• AuditTrailRecordCreated (see How to Retrieve Audit Trail Information and Apply Custom Logic in the Opcenter
Execution Foundation User Manual)
• CommittedEvent
• DebugStartupEvent
• SessionAligned, SessionAlignment, SessionCreated, SessionDeleted, SessionPopulated and
SessionUpdated.
• TimerEvent
• SignalRuleStatusChangedEvent (an internal event, to which handlers cannot be added, used only by
the Signals App, see Signals App in the Opcenter Execution Foundation User Manual).
Procedure
1. Right-click the referenced Event (identified by a lock icon) in the Public Object Model tab of
the POMModel project and select Open.
2. Click on the Handlers
Result
The event handlers are displayed in the Handlers tab, together with the following information:
Column Description
Source Domain The name of the Functional Block or App where the event
handler was defined.
Predefined Subscription True if the event handler has been associated to a subscription,
otherwise false.
• a handler is no longer available, after reloading a Functional Block, installing a new version, or simply removing
an App Event Handler.
Version constraints on event subscriptions are as follows:
• the subscription name can be renamed either within the version in which it was created, or in a new major
version.
• envelope parameters can be modified either within the version in which they was specified, or in a new minor or
major version.
Procedure
If required, you can define subscriptions between events and event handlers, to be imported by default into
Solution Studio together with the App as follows:
1. With the referenced Event opened in the Public Object Model tab of the POMModel project, click on
the Handlers
If you have previously deleted the AssemblyInfo.cs file, the build will return a blocking error: manually
restore the file to solve the error.
If you have performed one of the following operations, you must use the Rebuild command (instead of
the Build command) to correctly regenerate the model output assemblies (otherwise a compilation error is
returned):
• you have deleted all POMModel entities (imported from Opcenter EX FN views and/or referenced from
Functional Blocks),
• you have deleted all Composite Commands,
• you have deleted all Types.
Result
All the compiled files are saved by default in the bin\Debug folder of the Model project (for example
Projects\<AppName>\<AppName>\<Acronym>POMModel\bin\Debug). These are the assemblies that contain the
namespaces for POM Model artifacts. Note that, unlike the model project of the Functional Block, in this model
project there are not any assemblies for the writing model.
Reference Management
Inside your Composite Command handler or Custom Event handler code you may want to perform reading
operations on entities that have been modeled either inside the App (by using [...]POMModel.PublicModel.dll) or
inside a referenced Functional Block (by using [...].Model.ProjectionModel.dll).
These references are automatically managed in Project Studio by Reference Manager. Reference Manager
automatically adds assemblies both for referenced Functional Blocks as well as for POMModel assemblies.
However, you can manually perform this operation. This is essential, for example, if you have referenced Functional
Blocks without using Reference Manager.
You can perform several operations during the implementation phase of an App, such as:
• Implement Composite Command Handlers
• Implement Event Handlers
• Implement Reading Function Handlers
• Implement Pre-Checks (as described for the Functional Blocks)
• Implement remote calls.
• Debug the code for
• Commands and Reading Functions (via Debugging Tool)
• Commands and Event Handlers (via a debug system Event)
using System;
using Siemens.SimaticIT.Unified.Common;
using Siemens.SimaticIT.Unified;
namespace Siemens.FBApp.FBApp.BVPOMModel.Commands
{
/// <summary>
/// Class initialize
/// </summary>
public partial class MyCommandHandlerShell : ICompositeCommandHandler
{
private IUnifiedSdkComposite Platform;
/// <summary>
/// Execute
/// </summary>
/// <param name="unifiedSdkcomposite"></param>
/// <param name="command"></param>
/// <returns></returns>
public Response Execute(IUnifiedSdkComposite unifiedSdkcomposite, ICommand
command)
{
this.Platform = unifiedSdkcomposite;
return MyCommandHandler((MyCommand)command);
}
/// <summary>
/// Retrieve the type of the command
/// </summary>
public System.Type GetCommandType()
{
return typeof(MyCommand);
}
}
}
{
/// <summary>
/// Partial class init
/// </summary>
[Handler(HandlerCategory.BasicMethod)]
public partial class MyCommandHandlerShell
{
/// <summary>
/// This is the handler the MES engineer should write
/// This is the ENTRY POINT for the user in VS IDE
/// </summary>
/// <param name="command"></param>
/// <returns></returns>
/// <remarks>This is a Composite Command Handler</remarks>
[HandlerEntryPoint]
private MyCommand.Response MyCommandHandler(MyCommand command)
{
// Put your code here
// return new MyCommand.Response() { ... };
throw new NotImplementedException();
}
}
}
If an event handler is removed from the model, you must manually delete the corresponding C# class,
otherwise it will be included in the App manifest.
Workflow
1. Define the Custom Event Handler
2. Import the Event Handler
1. Right-click the EventHandler project and select Import from the Model.
2. Select the event handler you just created and click OK.
3. Expand the folder structure of the EventHandler project and open the <EventNameHandler>.cs file.
When you import commands in the relative handler project from Project Studio, only the modifiable file
(<Command>Handler.cs) is displayed for each command.
At runtime the worker invokes the code of the handler by calling the Execute method of
the <Command>HandlerExecution.cs class. When this method is invoked, the worker executes the handler logic
with the input from the received command request and then it prepares the reply to be returned.
Read data from entities of the POM reading model via Query
method
Trigger events
Subscribe to events
Automation Gateway functionalities, exposed by the platform IUnifiedSdk interface, can be accessed only
if you compile the Command Handler by choosing the 64-bit compilation option.
• the Platform variable, on which an instance of an object that implements the IUnifiedSdkEvent
interface is injected.
When you import the events in the relative handler project from Project Studio, only the modifiable file
(<EventName>Handler.cs) is displayed for each event.
At runtime the worker invokes the code of the handler by calling the Execute method of
the <EventName>HandlerExecution.cs class. When this method is invoked, the worker executes the handler logic
with the input of the fired event.
Read data from entities of the POM reading model (Query method)
Trigger events
Subscribe to events
Automation Gateway functionalities, exposed by the platform IUnifiedSdk interface, can be accessed only
if you compile the Event Handler by choosing the 64-bit compilation option.
Reading Function Handlers can be only compiled by choosing the 64-bit compilation option.
The reading function can be invoked from a Lean application as well as from a web application.
When the invocation is performed from a Lean application, the function can be called by adding filtering criteria to
the returned values (see page Developing Third-Party Applications Integrated with Opcenter EX FN via
IUnifiedSdkLean interface).
When the invocation is performed from a web application, the Function can be called by adding OData filtering
criteria (see page Invoking Reading Functions).
Read data from the writing model, if the entity is inside the same
domain
Read data from the writing model, if the entity is inside another
domain
Read data from the reading model, if the entity is inside the same
domain (IUnifiedSdkDataReading interface)
Read data from the reading model, if the entity is inside another
domain (IUnifiedSdkDataReading interface)
Read data from the reading model, if the entity is inside a user
domain, i.e. legacy system data (IUnifiedSdkDataReading
interface)
Get the properties and the content of the file as a data stream by
specifying the file GUID (IUnifiedSdkContentReading interface)
Trigger events
Subscribe to events
Automation Gateway functionalities, exposed by the Automation Sdk interface, can be accessed only if you
compile the Command Handler, or the Event Handler, or Reading Function by choosing the 64-bit
compilation option.
This debugging mode does not allow you to debug Reading Function Handlers.
For Command Handlers we suggest that you follow Debugging Commands and Reading Functions via App
Debugging Tool, which uses the Opcenter Execution Foundation App Debugging Tool.
For Event Handlers, you can only use this debugging mode.
• Handlers of all types of Commands: Protected Commands of Functional Blocks, Commands imported into the
POM Model of an App, and Composite Commands,
• Event Handlers.
The following Visual Studio debugging functionalities are available within Project Studio:
• Call Stack - to display the list of functions currently called.
• Immediate Window - to execute program statements separately from the running program.
• Breakpoint - to stop the execution of a program at a defined point either in all instances or according to a
specific set of criteria.
• Watch Window - to watch the contents of a variable or series of variables.
• Output Window - to write out a series of text messages during the execution of the program so that users can
monitor what happens during the program lifecycle
• Attaching to Process - to attach to a process running somewhere on the computer.
Limitation
If you have an environment configured in HTTPS, debugging functionalities on Business Logic and UI Modules are
not available.
Workflow
To correctly execute debugging operations, you must go through the following steps:
2. Create an App.
3. Reference the Functional Block from the App.
4. Create and release the App package.
5. Create a solution in Solution Studio loading the previously created App.
6. Deploy the Solution without restarting the runtime services.
It is necessary to repeat the procedure above only if you modify the Functional Block by adding new
entities, but not if you model additional commands and events.
If the code you want to debug is contained in the App, you can repeat the above procedure starting from
step 4.
/debugPath The absolute path of the assemblies generated when the solution is
compiled. If not specified, the system will use the following:
• C:\ProgramData\Siemens\SimaticIT\Unified\Deploy\bin
• C:\Program Files\Siemens\SimaticIT\Unified\bin
Environment variables can be used.
Argument Description
Example
If you copy and paste this example configuration, you must properly modify the project names and then
remove the end of line breaks.
You can debug the code of a handler subscribed to the TimerEvent as long as you fire the TimerEvent
only for debug purposes from a debug event handler. If the event is fired in a handler at runtime an error
will be returned.
1. In the EventHandler project, create a custom event handler for the DebugStartupEvent event and then import
the relative .cs files (Siemens.SimaticIT.SystemData.Foundation.EventsDebugStartupEvent).
2. Open the <CustomDebugStartupEventHandlerName>.cs file and implement a call to the command whose
handler you want to debug, or fire the event whose handler you want to debug.
Note Alternatively you can debug your code by sending an HTTP request through the self-hosted Service Layer,
for example using a custom UI. The base address is http://localhost:9000/runtime/odata/.
3. If the code you want to debug contains a call to a method of a referenced Functional Block, extract the .pdb files
from the relative output package located in %ProgramData%
\Siemens\SimaticIT\Unified\Engineering\Packages\FunctionalBlocks.
4. Compile the solution.
5. Insert a break point where required in the code.
6. Right-click the project you want to debug and select Set as StartUp Project.
7. Build the Installer project: if the active configuration is set to Debug (and not to Release), the
DebugRegistryGenerator process that synchronizes the debug environment is started. This operation must be
executed the first time you prepare the debugging environment since you must publish all your artifacts to the
debug governance.
8. Press F5 to start debugging. If the handler execution stops (for example, at a break point or for an exception),
ensure that you complete the execution of the current handler before starting another debug operation.
Alternatively, you can directly clean the RabbitMQ queues as described in the Stopping the debug
operation section below, if you then want to execute another debug operation.
9. If required, modify the code of the handler. If the corresponding command or event has been already published
to the debug governance, you can either recompile the entire solution (or the Installer project) as usual (but
this operation is rather time consuming) or you can configure a build post-action in the handler project as
described in the Modifying the code without recompiling the entire solution section below.
Troubleshooting
During debug, Trace Viewer traces the path of the project assemblies:
• that have been successfully loaded.
• whose loading failed.
This debugging mode, which does not include the possibility to debug Event Handlers, represents an
alternative to Debugging Command and Event Handlers via DebugStartupEvent, for which additional code
must be implemented.
Limitation
If you have an environment configured in HTTPS, debugging functionalities on Business Logic and UI Modules are
not available.
If Project Studio has been installed after the system was already configured with the Opcenter Execution
Foundation Configuration tool, or via scripts, the debug certificate is not installed on the Engineering host
and must be manually created (see note below).
• Runtime Services have been stopped from the Host Management page of Solution Studio.
• The SIT_UNIFIED_MEDIUM_H group must have reading access rights to the folders and subfolders containing
the project you are developing in Project Studio.
• The user running Visual Studio, which can be either a Windows local user or a Windows domain user (and not
a pure UMC user as this user cannot launch Visual Studio), must be imported in User Management Component
(see Import Windows Local Users or Import Active Directory Users inside the UMC UMX User Manual), and
associated via UMC UI Interface with the following UMC artifacts: the SIT_UAF_SYSADMIN group and the UMC
Viewer role. If you have not used the Opcenter Execution Foundation Configuration tool to configure your
environment, you must assign the Opcenter EX FN SysAdmin role to the SIT_UAF_SYSADMIN group as
described in the Opcenter Execution Foundation Installation Manual.
• The user running Visual Studio must also be assigned both to the SIT_UNIFIED_MEDIUM_L and to the
SIT_UNIFIED_LOW Windows group. Remember that if you add a user to a group you must logoff and logon
again in Windows to make the configurations active.
• If you need to debug handlers that access Opcenter EX FN databases on Oracle, the user running Visual Studio
must exist on the Oracle database machine and the following conditions must be satisfied:
• if you want to use Windows authentication, the user must be specified as high_profile_user on the
Oracle databases by launching the ConfigureORACLE.ps1 script (low_profile_user can be left blank) .
• if you want to use Database authentication, the user must exist on the Oracle databases and must be
properly configured as described in How to Configure an Oracle Database for Database Authentication of
the Opcenter Execution Foundation Installation Guide).
4. Only if you are in release configuration, you need to perform the following extra steps, otherwise the debugging
cannot run:
a. Right-click the Installer project and select Unload project.
b. With the Installer project selected, right-click it again, select Edit <FunctionalBlock>.Installer.proj and
then add <RunDebugRegistry>true</RunDebugRegistry> to the first available<PropertyGroup>
section (for example, the one that contains information such as the Functional Block name and so on,
without conditions).
If you want to choose a Public Command instead of a Composite Command, clear the Show only
composite commands check box, which is selected by default. If you are debugging a Functional Block
Command whose name is the same as an App Command name, the Functional Block command will be
identified in the artifact list by the _debug suffix (e.g. CreateOrder_debug for the Functional Block
Command name and CreateOrder for the App Command Name).
6. The system opens the Handler project and stops at the required breakpoints: here you can directly insert the
required changes and continue debugging.
• If the Handler execution stops (for example, at a break point or for an exception), ensure that you
complete the execution of the current Handler before starting another debug operation. Alternatively,
you can directly clean the RabbitMQ queues as described in the Stopping the debug operation section
below, if you then want to execute another debug operation.
• If required, modify the code of the inspected Handler. If the corresponding Command / Reading
Function has already been deployed, you can either recompile the entire solution (or
the Installer project) as usual (but this operation is rather time consuming) or you can configure a
build post-action in the Handler project as described in the Modifying the code without recompiling
the entire solution section below.
• Should the debug process not correctly start, see section Handler project configuration below.
If you copy and paste these example configurations, you must properly modify the project names and
paths.
Troubleshooting
During debug, Trace Viewer traces the path of the project assemblies:
• that have been successfully loaded.
• whose loading failed.
If the worker crashes, you can check the dump files.
• Mashup Editor
• Model-Driven UI Module Editor
The choice between them does not depend only on developer preferences, but it is conditioned by the
characteristics of the UI Module itself.
If, for example, you want to create a set of pages with a similar layout and behavior, such as master data
engineering pages, it would be preferable to work in Project Studio, creating the first page and then using it as a
template to develop the others. If you want to create a page, such as an operator page or a dashboard, with a
simple one-shot layout, it would be better to use the Mashup Editor. This tool, which is based on graphical and user
friendly working environment, can be used by less skilled users, thus allowing you to postpone the page
configuration phase (for example before the deployment phase after collecting specific feedback from the final
users).
If you choose to create Mashup Modules in the Mashup Editor, you must combine UI Components and/or UI
Components and third-party SWAC Components developed in Project Studio.
If you choose to develop the UI Modules and UI Screens directly in Project Studio, you do not need to develop UI
Components, but you can simply associate the widgets with the business logic directly within the page. It may also
be useful in some circumstances to create a UI Component to be used with different pages in Project Studio (for
example a grid displaying orders to be processed that can be used both in the order management page and in the
entry management page).
As an alternative to the Project Studio code-based choice, you can use the Model-Driven UI Module Editor, which
allows you to create UI Modules and UI Screens without writing code.
• The OData protocol, which lets a client make requests to and get responses from an OData service. The OData
protocol is a set of REST interactions based on HTTP. Representational State Transfer (REST) is a software
architecture style consisting of guidelines and best practices for creating scalable web services. REST
interactions include CRUD operations (such as create/read/update/delete operations), along with an OData-
defined query language.
• myComponent1/
• myComponent2/
• config/
• fonts/
• images/
• modules/
• myModule1/
• resources/
• scripts/
• ThirdPartyScript1/
• services/
• styles/
• CompanyX.FunctionalBlockY-light.css
• CompanyX.FunctionalBlockY-dark.css
• widgets/
• myWidget1/
• myWidget2/
Additionally:
• Create at least one main custom stylesheet per theme (in this case two, one for the light and one for the dark
theme), and name the CSS files according to the following naming convention: <Prefix><AppName>-
<Theme>.css
• The functionalBlock.js file must contain the definition of the main AngularJS module used by the App.
1 (function(){
2 'use strict';
3 angular.module('Siemens.Core', [
4 'Siemens.Core.UoM',
5 'Siemens.Core.MyComponent1',
6 'Siemens.Core.SomethingElse',
7 'Siemens.Core.myWidget1',
8 'Siemens.Core.myWidget2',
9 // ... other feature modules
10 ]);
11 }())
In this case:
• The main AngularJS Module representing the App (Siemens.Core) is defined.
• All other AngularJS Modules defined in other files are specified as injected dependencies for this module. These
"logical submodules" should be called <AppName>.<ModuleName>.
Note that the dot character (".") within a module name has no special meaning in AngularJS and it is not
used by AngularJS for namespacing. The example above "simulates" namespacing using dependency
injection, but injected modules may have completely different names from the name of the "parent"
module.
SVG icons
The set of SVG icons, which is currently in use, is available at %ProgramData%
\Siemens\SimaticIT\Unified\Engineering\UIFramework\common\icons.
To have a preview of the icons available in this folder you must autonomously proceed by installing any third-party
software which provides you with the SVG preview. For example, you could install https://github.com/maphew/svg-
explorer-extension/releases extension from the Windows 10 shell. But bear in mind that this software is mentioned
only as an example and does not represent a product prerequisite.
SVG icons are semantically classified in the following types:
Data typ Represents a type of object. It is Main icon identifying an object in Ric 48 * 48
type e not selectable, does not a list of cells, a row in a table or a h
perform any action. home title.
Indic indi Indicates the status of the main Secondary icons in a cell or a Ou 16 * 16
ator cato object. table row. tlin
r e
fill
ed
The icon to be inserted can be specified by removing the prefix, the dimension and the extension from its
name. For instance, if the SVG icon name is cmdAppInstall24.svg, it can be inserted as AppInstall.
When icons are used for screens and modules, the following rule must be followed:
• svg cmd icons must be used for any Module,
• svg type icons must be used for any Screen.
If this rule is not followed, the Runtime app will display a default icon indicating the error, in the navigation
bar.
FontAwesome (deprecated)
FontAwesome is a third-party software, which provides icons that can be used in UIs.
See http://fontawesome.github.io/Font-Awesome/cheatsheet/ for the full list of icons that are currently supported
(currently only the icons included in the currently supported release of FontAwesome, see Using Third-Party
Components).
sit sit-active
Area Where
FontAwesome 4.7.0 FontAwesome is a font that defines all icons that can
be used inside UIs.
If you want to know how to use FontAwesome go to
http://fortawesome.github.io/Font-Awesome/.
Beneficial technology
It may be beneficial for you to know about this technology, as it could be useful for more fine-grained
customization:
Angular Translate 2.17.0 Angular Translate may be useful for localizing UIs.
@natural-blue-light: #55a0b9;
@natural-blue-dark: #006487;
@natural-blue-2: #004664;
@natural-blue-5: #2882a0;
@natural-blue-7: #73b4c8;
@natural-blue-8: #8cc3d2;
@natural-blue-9: #afd7e1;
@natural-blue-10: #cde6eb;
@pure-white: #ffffff;
@pure-black: #000000;
@pure-black-1: #1e1e1e;
@pure-black-2: #323232;
@pure-black-3: #464646;
@pure-black-4: #5a5a5a;
@pure-black-6: #828282;
@pure-black-8: #AAAAAA;
@pure-black-9: #bebebe;
@pure-black-10: #dcdcdc;
@pure-black-11: #f0f0f0;
Light Theme
These are the LESS variables that can be used for the light theme.
@main-background: @pure-white;
@chromeless-toolbar-background: @pure-white;
@toolbar-background: @pure-black-11;
@appbar-background: @pure-black-11;
@card-background: @pure-black-11;
@dialog-background: @pure-black-11;
@panel-background: @pure-black-11;
@low-contrast-toolbar-background: @pure-black-11;
@dialog-header-background: @natural-blue-light;
@panel-header-background: @natural-blue-light;
@dialog-header-text-foreground: @pure-white;
@panel-header-text-foreground: @pure-white;
@high-contrast-toolbar-background: @pure-black-10;
@chromeless-selected-tab-text-foreground: @natural-blue-5;
@chromeless-unselected-tab-text-foreground: @natural-blue-light;
@line-foreground-1: @pure-black-8;
@line-foreground-2: @pure-black-6;
@line-foreground-3: @pure-black-4;
@line-foreground-4: @pure-black-2;
@high-contrast-table-header-background: @main-background;
@high-contrast-table-primary-row-background: @pure-white;
@high-contrast-table-alternate-row-background: @pure-black-11;
@high-contrast-table-divider-line-foreground: @pure-black-8;
@high-contrast-table-header-divider-line-foreground: @pure-black-8;
@low-contrast-table-header-background: @main-background;
@low-contrast-table-primary-row-background: @pure-white;
@low-contrast-table-alternate-row-background: #fafafa;
@low-contrast-table-divider-line-foreground: @pure-black-8;
@low-contrast-table-header-divider-line-foreground: @pure-black-8;
@drop-shadow-background: @pure-black;
@page-title-text-foreground: @natural-blue-2;
@group-title-read-only-text-foreground: @pure-black-4;
@group-title-clickable-text-foreground: @natural-blue-dark;
@clickable-text-foreground: @natural-blue-dark;
@body-text-foreground: @pure-black-1;
@read-only-text-foreground: @pure-black-4;
@disabled-text-foreground: @pure-black-8;
@pressed-selection-background: @natural-blue-10;
@hover-selection-background: @natural-blue-9;
@secondary-selection-background: @natural-blue-8;
@primary-selection-background: @natural-blue-7;
@primary-selection-text-foreground: @pure-black-1;
@focus-selection-background: @natural-blue-7;
@button-inactive-background: @pure-black-10;
@button-inactive-text-foreground: @pure-black-8;
@button-inactive-border-foreground: @pure-black-8;
@button-default-background: transparent;
@button-default-text-foreground: @pure-black-1;
@button-default-border-foreground: @pure-black-8;
@button-primary-background: @natural-blue-light;
@button-primary-text-foreground: @pure-white;
@button-primary-border-foreground: @pure-black-8;
@button-hover-background: @hover-selection-background;
@button-hover-text-foreground: @pure-black-1;
@button-hover-border-foreground: @pure-black-8;
@button-pressed-background: @pressed-selection-background;
@button-pressed-text-foreground: @pure-black-1;
@button-pressed-border-foreground: @pure-black-8;
@link-text-foreground: @natural-blue-dark;
@link-text-hover-foreground: @natural-blue-light;
@link-text-active-foreground: @natural-blue-9;
@input-default-text-foreground: @pure-black;
@input-default-background: @main-background;
@input-default-border-foreground: #e6e6e6;
@input-hover-border-foreground: @natural-blue-9;
@input-focus-border-foreground: @natural-blue-7;
@input-invalid-border-foreground: @status-error;
@input-dirty-background: #fff7bd;
@input-readonly-background: @pure-black-10;
@warning-background: @status-caution;
@warning-text-foreground: @pure-black-1;
@title-text-foreground: @natural-blue-dark;
@logo-text-foreground: #009999;
@admonition-color: @functional_gray_dark;
@admonition-warning-background: #FFDCD7;
@admonition-warning-border: #C55D3F;
@admonition-note-background: #FFF1D7;
@admonition-note-border: #EC9415;
@admonition-info-background: #D7E3FF;
@admonition-info-border: #659AF7;
@admonition-tip-background: #D7FFD9;
@admonition-tip-border: #54BD51;
Dark Theme
These are the LESS variables that can be used for the dark theme.
@main-background: @pure-black-4;
@chromeless-toolbar-background: @pure-black-4;
@toolbar-background: @pure-black-3;
@appbar-background: @pure-black-3;
@card-background: @pure-black-6;
@dialog-background: @pure-black-3;
@panel-background: @pure-black-3;
@low-contrast-toolbar-background: @pure-black-3;
@dialog-header-background: @pure-black-2;
@panel-header-background: @pure-black-2;
@dialog-header-text-foreground: @pure-white;
@panel-header-text-foreground: @pure-white;
@hight-contrast-toolbar-background: @pure-black-2;
@chromeless-selected-tab-text-foreground: @natural-blue-9;
@chromeless-unselected-tab-text-foreground: @pure-black-9;
@line-foreground-1: @pure-black-10;
@line-foreground-2: @pure-black-8;
@line-foreground-3: @pure-black-6;
@line-foreground-4: @pure-black-4;
@high-contrast-table-header-background: @pure-black-2;
@high-contrast-table-primary-row-background: @pure-black-4;
@high-contrast-table-alternate-row-background: @pure-black-3;
@high-contrast-table-divider-line-foreground: @pure-black-2;
@high-contrast-table-header-divider-line-foreground: @pure-black-2;
@low-contrast-table-header-background: @pure-black-3;
@low-contrast-table-primary-row-background: @pure-black-4;
@low-contrast-table-alternate-row-background: #555555;
@low-contrast-table-divider-line-foreground: @pure-black-3;
@low-contrast-table-header-divider-line-foreground: @pure-black-4;
@drop-shadow-background: @pure-black;
@page-title-text-foreground: @pure-white;
@group-title-read-only-text-foreground: @pure-black-8;
@group-title-clickable-text-foreground: @pure-black-9;
@clickable-text-foreground: @pure-black-9;
@body-text-foreground: @pure-white;
@read-only-text-foreground: @pure-black-8;
@disabled-text-foreground: @pure-black-6;
@pressed-selection-background: @natural-blue-5;
@hover-selection-background: @natural-blue-light;
@secondary-selection-background: @natural-blue-8;
@primary-selection-background: @natural-blue-10;
@primary-selection-text-foreground: @pure-black-1;
@focus-selection-background: @natural-blue-10;
@button-inactive-background: @pure-black-8;
@button-inactive-text-foreground: @pure-black-6;
@button-inactive-border-foreground: @pure-black-6;
@button-default-background: transparent;
@button-default-text-foreground: @pure-white;
@button-default-border-foreground: @pure-black-6;
@button-primary-background: @natural-blue-dark;
@button-primary-text-foreground: @pure-white;
@button-primary-border-foreground: @pure-black-6;
@button-hover-background: @hover-selection-background;
@button-hover-text-foreground: @pure-black-1;
@button-hover-border-foreground: @pure-black-6;
@button-pressed-background: @pressed-selection-background;
@button-pressed-text-foreground: @pure-black-1;
@button-pressed-border-foreground: @pure-black-6;
@link-text-foreground: @natural-blue-8;
@link-text-hover-foreground: @natural-blue-light;
@link-text-active-foreground: @natural-blue-7;
@input-default-text-foreground: @pure-white;
@input-default-background: @pure-black-2;
@input-default-border-foreground: #7e7e7e;
@input-hover-border-foreground: @natural-blue-8;
@input-focus-border-foreground: @natural-blue-10;
@input-invalid-border-foreground: @status-error;
@input-dirty-background: #00374b;
@input-readonly-background: @pure-black-4;
@warning-background: @status-caution;
@warning-text-foreground: @pure-black-1;
@title-text-foreground: @pure-white;
@logo-text-foreground: @pure-white;
@admonition-color: @functional_gray_dark;
@admonition-warning-background: #FFDCD7;
@admonition-warning-border: #C55D3F;
@admonition-note-background: #FFF1D7;
@admonition-note-border: #EC9415;
@admonition-info-background: #D7E3FF;
@admonition-info-border: #659AF7;
@admonition-tip-background: #D7FFD9;
@admonition-tip-border: #54BD51;
@button_active: @button-pressed-background;
@button_active_alternate: @button-primary-background;
@button_highlight_alternate: @button-hover-background;
@button_pressed_alternate: @button-pressed-background;
@button_face: @button-default-text-foreground;
@button_disabled: @button-inactive-background;
@button_disabled_text: @button-inactive-text-foreground;
@button_highlight: @button-hover-background;
@button_highlight_text: @button-hover-text-foreground;
@button_inactive: @button-inactive-background;
@button_inactive_text: @button-inactive-text-foreground;
@button_pressed: @button-pressed-background;
@button_pressed_text: @button-pressed-text-foreground;
@button_selected: @button-pressed-background;
@button_selected_text: @button-pressed-text-foreground;
@button_text: @button-default-text-foreground;
@control: @dialog-background;
@control_active: @dialog-header-background;
@control_background: @dialog-background;
@control_dark: @dialog-background;
@control_light: @dialog-background;
@control_text: @body-text-foreground;
@control_text_active: @body-text-foreground;
@control_text_dark: @body-text-foreground;
@control_text_light: @body-text-foreground;
@control_text_read_only: @button-inactive-text-foreground;
@dialog_background: @dialog-background;
@dialog_background_light: @dialog-background;
@dialog_border: @dialog-background;
@dialog_text: @body-text-foreground;
@login_dialog_background: @dialog-background;
@login_dialog_background_light: @dialog-background;
@login_dialog_heading_text: @body-text-foreground;
@login_dialog_information_text: @body-text-foreground;
@login_dialog_text: @body-text-foreground;
@item-tile-background: @card-background;
@tile_background: @card-background;
@tile_foreground: @body-text-foreground;
@tile_highlight: @hover-selection-background;
@toolbar_background: @toolbar-background;
@toolbar_foreground: @body-text-foreground;
@window_background: @main-background;
@window_text: @body-text-foreground;
@menu_background: @panel-background;
@menu_border: @panel-background;
@menu_foreground: @body-text-foreground;
@menu_highlight: @hover-selection-background;
@menu_highlight_text: @button-hover-text-foreground;
@menu_pressed: @pressed-selection-background;
@menu_pressed_text: @button-pressed-text-foreground;
@menu_selected: @pressed-selection-background;
@menu_selected_text: @button-pressed-text-foreground;
@menu_text: @body-text-foreground;
@notificationtile_shadow: @drop-shadow-background;
@sidebar_background: @toolbar-background;
@sidebar_border: @toolbar-background;
@sidebar_checked: @toolbar-background;
@sidebar_check_mark: @primary-selection-background;
@sidebar_checked_text: @body-text-foreground;
@sidebar_foreground: @body-text-foreground;
@sidebar_highlight: @button-hover-background;
@sidebar_highlight_text: @button-hover-text-foreground;
@sidebar_pressed: @pressed-selection-background;
@sidebar_pressed_text: @button-pressed-text-foreground;
@sidebar_selected: @pressed-selection-background;
@sidebar_selected_text: @button-pressed-text-foreground;
@sidebar_text: @body-text-foreground;
@grid_aggregate_text: @body-text-foreground;
@page-hyperlink: @link-text-foreground;
@page-text-highlight: @link-text-hover-foreground;
@header-border-bottom: @panel-header-background;
@code-background: @panel-background;
@code-color: @body-text-foreground;
@page-title-color: @title-text-foreground;
@common-layout-border : @main-background;
Engineering commands that allow you to associate users and groups with roles are also exposed on the Service
Layer and can be retrieved by a dedicated service (see common.services.runtime.backendService in the Opcenter
Execution Foundation UI Framework Reference) in order to develop UI pages that must display and handle
information related to users, groups and roles.
For more information on engineering commands and entities, start with navigating to the PublicGroup Entity in the
Engineering Model Reference Guide.
To be able to invoke these commands, a user must belong to a specific system role, and be assigned with the proper
permissions.
Example
Consider a CreateContainer command, with the following parameters:
Name Type
Name string
Location string
Product string
To execute this command based on user input, define a new state (with its own controller and template) within an
existing UI Module. Typically this state would be triggered by a button in another state (for example a state
displaying a list of containers) and opened in a side panel. In this case, the template should contain a Property Grid
and the buttons to save data or cancel:
1 <div>
2 <button ng-click="vm.cancel()" class="btn side-panel-button">Cancel</
button>
3 <button ng-click="vm.save()" class="btn side-panel-button" ng-
show="vm.validInputs">Save</button>
4 <div style="clear:both"></div>
5 <sit-property-grid sit-layout="Vertical"
6 sit-type="Fluid"
7 sit-mode="edit"
8 sit-columns="1">
9 <sit-property sit-widget="sit-text"
10 sit-value="vm.currentItem.Name"
11 sit-validation="{required: true}">Name:</sit-
property>
12 <sit-property sit-widget="sit-text"
13 sit-value="vm.currentItem.Product"
14 sit-validation="{required: true, pattern: '^P-\
\d{4}$'}">Product:</sit-property>
15 <sit-property sit-widget="sit-text"
16 sit-value="vm.currentItem.Location"
17 sit-validation="{required: true}">Location:</sit-
property>
18 </sit-property-grid>
19 </div>
In the controller, the save() method is used to execute the command and:
1 (function () {
2 'use strict';
3 angular.module('Siemens.DemoApp.MasterData')
4 .controller('ContainerMgtaddCtrl',
5 [ '$state',
6 '$scope',
7 'common.services.sidePanel.service',
8 'common.services.runtime.backendService',
9 function ( $state,
10 $scope,
11 sidePanelManager,
12 backendService) {
13 var self = this;
14 self.currentItem = {};
15 self.validInputs = false;
16 self.save = function () {
17 var commandModel = {};
18 commandModel.appName = "myApp";
19 commandModel.commandName = "CreateContainer";
20 commandModel.params = self.currentItem;
21 backendService.invoke(commandModel).then(function
(data) {
22 $state.go('^', {}, { reload: true });
23 }, backendService.backendError);
24 };
25 self.cancel = function () {
26 sidePanelManager.close();
27 $state.go('^');
28 };
29 $scope.$on('sit-property-grid.validity-changed', function (event,
params) {
30 self.validInputs = params.validity;
31 });
32
33 self.init = function () {
34 sidePanelManager.setTitle('Add');
35 sidePanelManager.open('e');
36 };
37 init();
38 }])
39
40 }());
• The Save button is only displayed if valid data is entered in the form.
• The parameters on the command are collected from the view in the currentItem object.
Before implementing queries on entities, verify that the required permissions have been given in the role
configurations. Here you can assign permissions on entities specifying artifacts that belong either to the
reading model of Functional Block domains or to the POM Models of Apps. Consequently, you must be
careful when assigning permissions to entities you want to query, since reading operations will only be
allowed on the explicitly specified data models. Keep in mind that from web applications you can only
access the POM Model entities, exposed on the Service Layer.
Troubleshooting
For errors returned by the Service Layer see page Service Layer HTTP Return Code Statuses.
If while executing queries, the system returns an error related either to the maximum number of allowed nodes or
expand expressions, see section Applying Custom Configurations to the Opcenter EX FN Service Layer.
Example
Consider a simple entity called Container with the following properties:
Name Type
Name string
Location string
Product string
Quantity decimal
To query this entity and display data in a grid, define a new state (with its own controller and template) within an
existing UI Module. The template in this case can simply contain an Item Collection Viewer widget:
In the controller, the code in the init() method is used to retrieve data from the Service Layer and populate the grid
using the viewerData collection:
1 (function () {
2 'use strict';
3 angular.module('Siemens.DemoApp.MasterData')
4 .controller('ContainerMgtCtrl',
5 ['$state',
6 '$rootScope',
7 'common.services.runtime.backendService',
8 function ($state,
9 $rootScope,
10 backendService) {
11 var self = this;
12
13 self.viewerOptions = {
14 selectionMode: 'single',
15 containerID: 'itemlist',
16 viewOptions: 'gml',
17 viewMode: 'g',
18 quickSearchOptions: { enabled: true, field: 'Name' },
19 sortInfo: {
20 field: 'Name',
21 direction: 'asc',
22 fields: ['Name', 'Product', 'Quantity']
23 },
24 groupFields: ['Product'],
25 gridConfig: {
26 columnDefs: [
27 { field: 'Name' },
28 { field: 'Product' },
29 { field: 'Quantity' }
30 ]
31 },
32 image: 'fa-cube',
33 tileConfig: {
34 titleField: 'Name'
35 }
36 };
37
38 self.init = function () {
39 var options =
"$select=Name,Product,Quantity&$filter=Quantity gt 0"
40 var queryModel = {};
41 queryModel.appName = "myApp";
42 queryModel.entityName = "Container";
43 queryModel.options = options;
44 backendService.findAll(queryModel).then(function (data) {
45 if ((data) && (data.succeeded)) {
46 self.viewerData = data.value;
47 } else {
48 self.viewerData = [];
49 }
50 }, backendService.backendError);
51 };
52 self.init();
53 }])
54 }());
In this case, the findAll() method of the common.services.runtime.backendService is used to retrieve all
containers (only their Name, Product, and Quantity fields) whose Quantity is greater than 0.
Troubleshooting
For errors returned by the Service Layer see Opcenter EX FN Service Layer HTTP Return Code Statuses.
If while executing queries, the system returns an error related either to the maximum number of allowed nodes or
expand expressions, see Applying Custom Configurations to the Opcenter EX FN Service Layer.
Example
Consider a simple entity called Container with the following properties:
Name Type
Name string
Name Type
Location string
Product string
Quantity decimal
To query this entity and display data in a grid, define a new state (with its own controller and template) within an
existing UI Module. The template in this case can simply contain an Item Collection Viewer widget:
In the controller, the code in the init() method is used to retrieve data from the Application Archiving Service
Layer and populate the grid using the viewerData collection:
1 (function () {
2 'use strict';
3 angular.module('Siemens.DemoApp.MasterData')
4 .controller('ContainerMgtCtrl',
5 ['$state',
6 '$rootScope',
7 'common.services.runtime.backendService',
8 function ($state,
9 $rootScope,
10 backendService) {
11 var self = this;
12
13 self.viewerOptions = {
14 selectionMode: 'single',
15 containerID: 'itemlist',
16 viewOptions: 'gml',
17 viewMode: 'g',
18 quickSearchOptions: { enabled: true, field: 'Name' },
19 sortInfo: {
20 field: 'Name',
21 direction: 'asc',
22 fields: ['Name', 'Product', 'Quantity']
23 },
24 groupFields: ['Product'],
25 gridConfig: {
26 columnDefs: [
27 { field: 'Name' },
28 { field: 'Product' },
29 { field: 'Quantity' }
30 ]
31 },
32 image: 'fa-cube',
33 tileConfig: {
34 titleField: 'Name'
35 }
36 };
37
38 self.init = function () {
39 var options =
"$select=Name,Product,Quantity&$filter=Quantity gt 0"
40 var queryModel = {};
41 queryModel.appName = "myApp";
42 queryModel.entityName = "Container";
43 queryModel.options = options;
44 backendService.findAllArchiving(queryModel).then(function
(data) {
45 if ((data) && (data.succeeded)) {
46 self.viewerData = data.value;
47 } else {
48 self.viewerData = [];
49 }
50 }, backendService.backendError);
51 };
52 self.init();
53 }])
54 }());
In this case, the findAllArchiving method of the common.services.runtime.backendService is used to retrieve all
archived containers (actually, only the Name, Product, and Quantity fields of these containers) whose Quantity is
greater than 0.
Example
Consider a getItems reading function, belonging to the ReadFunApp App, with the following parameter:
Name Type
Category string
(function () {
'use strict';
var myapp = angular.module('siemens.simaticit.common').controller('businessDataSv
cExampleController', businessDataController);;
businessDataController.$inject = ['common.services.runtime.backendService',
'$translate', 'common.widgets.busyIndicator.service',
'common.widgets.messageOverlay.service'];
function businessDataController(businessData, $translate, busyIndicatorService,
messageOverlayService) {
var bd = this;
bd.functionName = 'getItems';
bd.params = {category : "cate1"};
bd.appName = 'ReadFunApp';
bd.options = '$top1';
bd.result = '';
bd.read = function () {
busyIndicatorService.show();
bd.result = null;
var object = {
"appName": bd.appName,
"functionName": bd.functionName,
"params": bd.params,
"options": bd.options,
};
businessData.read(object).then(function (data) {
bd.result = data;
busyIndicatorService.hide();
}, function (error) {
busyIndicatorService.hide();
messageOverlayService.set({
buttons: [{
id: 'ok',
displayName: 'OK',
onClickCallback: function () {
messageOverlayService.hide();
}
}],
title: "Backend Data Error",
text: error.data.error.errorCode + ' - ' +
error.data.error.errorMessage
});
messageOverlayService.show();
});
}
// Invoke the reading function;
bd.read();
}
})();
Example
Model project example
The POM of an App, called "MyApp" contains an entity (MyEntity), a signal (MySignal) and a command
(PopulateMyEntity):
• Entity: MyEntity contains
• Property1
• Property2
• Property3
• Signal: MyEntity has been promoted to MySignal. This means that each time MyEntity is modified and
a CommittedEvent is fired, the information related to the entity changes will be sent to the client.
UI project example
The UI screen contains:
• a button for connecting to the app
• a button for subscribing to the signal
• a grid which displays the entity data
• a button for unsubscribing from the signal
• a button for reconnecting to the app
• a button for disconnecting from the app
Connect button
This button handler calls the connectSignals method of the common.services.runtime.backendService, which
opens the web socket connection for the App.
Subscribe button
This button handler calls the subscribe method of the common.services.runtime.backendService and subscribes
to the specified signal. If the web socket connection to the app doesn't exist then a new web socket connection is
established and then subscription to the specified signal is obtained, returning the Connection Id of the
subscription. This connection Id is used for unsubscribing the Signal.
In this example the onMessage callback receives a piece of data for each row added to the entity instance and
populates the grid accordingly. The grid must be bound to an array on which you will push the data using
this callback.
If the signal stops sending messages, the onComplete callback will be called:
In case of errors on the connection, the onConnectionError is called. One can use reconnectSignals in case of web
socket connection failures (for example due to network disconnection).
Unsubscribe button
This button handler calls the unsubscribe method of the common.services.runtime.backendService, which
removes the subscription to the specified signal.
The Parameter subscriptionId is the Id of the signal to be unsubscribed. closeWebSocket is a Boolean value to
indicate if the web socket connection has to be closed as well.
Reconnect button
This button handler calls the reconnectSignals method of the common.services.runtime.backendService, which
re-establishes web socket connection to the App and returns a hash mapping of the old subscription Ids to new
signal subscription Ids, and an error response object if there is one.
Disconnect button
This button handler calls the disconnectSignals method of the common.services.runtime.backendService,
which closes the web socket connection for the App.
Troubleshooting notes
If the RabbitMQ service stops for any reason on the Opcenter EX FN host, Signal Manager closes all currently active
connections, it returns an error ("503 Service Unavailable") and it does not allow you to open any new connections
until the service is restarted. When the RabbitMQ service is unavailable, the involved Opcenter Execution
Foundation host is marked as running with errors in the Host Management page of Solution Studio.
For restarting the RabbitMQ service, see Troubleshooting RabbitMQ Start-Up Errors in the Opcenter Execution
Foundation Installation Guide.
UI project example
In order to add a defectImg to a partNumber from the user interface you can use a sit-file-uploader widget to
select the image and serialize the contents. This widget can be used within a sit-property-grid widget containing
also a sit-text widget to display the selected pnCode.
<div>
<button ng-click="vm.cancel()" class="btn side-panel-button">Cancel</button>
<button ng-click="vm.upload()" class="btn side-panel-button" ng-show="vm.validInp
uts">Save</button>
<div style="clear:both"></div>
<sit-property-grid sit-layout="Vertical"
sit-type="Fluid"
sit-mode="edit"
sit-columns="1">
<sit-property sit-id="Code" sit-widget="sit-textarea"
sit-value="vm.currentItem.code"
sit-validation="{ required: true }"
sit-read-only=" true">Code:</sit-property>
<sit-property sit-id="File" sit-widget="sit-file-uploader"
sit-value="vm.currentItem.file"
sit-validation="{ required: true }"
accept=vm.fileTypes>Image:</sit-property>
</sit-property-grid>
</div>
Note that:
• vm.currentItem.code will be set to the pnCode of the selected part number.
• vm.currentItem.file will be set to an object containing metadata and contents of the uploaded file.
• vm.fileTypes is set to comma-separated list of accepted content types, for example: 'image/jpeg,image/png'.
Once the file has been selected, the sit-value attribute of the sit-file-uploader widget will be bound to an object
with the following properties:
Property Description
self.upload = function () {
var obj = {
'pnCode': self.currentItem.code,
'createdBy': 'Author',
'imgBlob': self.currentItem.file.contents,
'imgId': self.currentItem.file.name,
'mimeType': self.currentItem.file.type
};
backendService.execute("AssignDefectImg", obj).then(function (data) {
$state.go('^', {}, { reload: true });
}, backendService.backendError);
}
In this case, the AssignDefectImg command is executed using the execute method of
the base.services.runtime.backendService service provided by the Opcenter Execution Foundation UI
Framework.
SWAC Container A SWAC Container is made up of a single web page whose SWAC
"contents" (components, services and wires) can be integrated and
collaborate with the "native" content of the hosting application.
Concept Description
SWAC Service The service provided by a SWAC Container for each of its
components.
SWAC Component Interface The public part of a SWAC Component that provides additional
functionalities that can be loaded inside a container if a container
wants to use them.
Example
(function(){
myTestController.$inject = ['common.services.component.swacComponentManager'];
function myTestController(swacManager){
/* ... */
In addition, you must manually configure the SWAC descriptor, creating a .json file and then copying it into
the swac folder of the <AppName>.UserInterface project.
{
"mver": "1.2.0",
"swac": {
"identity": {
"name": "Component",
"version": "1.0.0",
"displayname": "Component 1.0.0",
"type": "http://CompanyName.intranet/
SWACComponent/MyComponent_1.2.0",
"flavor": "ui",
"source": "http://localhost:4000/chat"
},
"contracts": {
"api": {
"methods": {
"sendMessage": {
"description":
"helpstring",
"return": {
"text": {
"method": {
"description": "helpstring",
"return": {
"parameters": {
"text": {
}
}
}
},
"events": {
"onEvent": {}
}
}
},
"dpc": {
"message": {
"type": "data type",
"description":
"helpstring",
"permission": "rw",
"node": "data"
},
"statistics": {
"children": {
"incoming": {
"description": "helpstring",
"permission": "rw",
"node": "data"
},
"outgoing": {
"description": "helpstring",
"permission": "rw",
"node": "data"
}
},
"node": "structure"
}
}
}
}
}
<sit-property-grid sit-layout="Vertical"
sit-type="Fluid"
sit-mode="edit"
sit-columns="1">
<sit-property sit-widget="sit-text"
sit-value="vm.currentItem.Name"
sit-read-only="true">Name:</sit-property>
<sit-property sit-widget="sit-select-qty"
sit-value="vm.currentItem.pallets"
sit-widget-attributes="vm.selectQtyAttrs"
sit-validation="vm.palletValidation">Pallets:</sit-property>
</sit-property-grid>
In this case, the sit-select-qty is a custom widget that is not part of the Opcenter Execution Foundation UI
Framework.
Although virtually any directive can be rendered within a Property Grid, it is necessary to actually implement a
simple contract to make sure that data binding and input validation works as expected.
This widget can be created by combining an input value, displayed in a drop-down list, and a numeric input value to
enter a numeric quantity.
<style>
.select-qty input {
max-width: 99%;
margin-left: 4px;
}
.select-qty input, .select-qty select {
border: none;
}
</style>
<div class="label label-property-grid-control-readonly" ng-if="vm.readOnly ||
vm.ngReadonly">
{{vm.displayValue()}}
</div>
<ng-form class="form-group"
ng-if="!(vm.readOnly || vm.ngReadonly)"
name='selectQtyForm'>
As a best practice, the widget should be displayed as a simple textual label if set as read-only, so the first part of the
template is necessary to implement this behavior. The rest of the template is used to display the active graphic
control as the combination of a select and a numeric input.
To implement proper input validation, note that:
• The part of the template corresponding to the active control is wrapped in an ng-form directive.
• The two input elements are wrapped in a div element, and its class is set to validator-control or validator-
control-invalid depending on the validity of the data.
• A hidden input field is used solely to host the sitFormInputValidator directive, which is used to display a
warning icon that displays a validation error message when clicked. The reason why this directive is not used as
an attribute for either of the two input elements is because validation messages must be related to the widget
as a whole, rather than each separate input element. Also note that the ng-model value specified for this hidden
input field corresponds to the value of the whole widget.
(function () {
'use strict';
var app = angular.module('Siemens.DemoApp');
function selectQtyController() {
var self = this;
self.init = function () {
self.quantityValue = self.value && self.value[self.quantity] ||
self.default || 0;
self.selectionValue = self.value;
self.value = {};
self.value[self.toKeep] = self.selectionValue[self.toKeep];
self.value[self.toDisplay] = self.selectionValue[self.toDisplay];
self.value[self.quantity] = self.quantityValue;
}
self.displayValue = function(){
if (self.value[self.toDisplay] && self.value[self.quantity]){
return self.value[self.toDisplay] + " - " +
self.value[self.quantity];
} else {
return "n/a";
}
}
}
app.controller('selectQtyController', selectQtyController);
app.directive('sitSelectQty', [function () {
return {
scope: {},
restrict: 'E',
bindToController: {
'readOnly': '=sitReadOnly',
'value': '=sitValue',
'validation': '=sitValidation',
'options': '=sitOptions',
'toDisplay': '=sitToDisplay',
'toKeep': '=sitToKeep',
'default': '=sitDefault',
'quantity': '=sitQuantity'
},
controller: 'selectQtyController',
controllerAs: 'vm',
templateUrl: 'Siemens.DemoApp/widgets/selectQty/selectQty.html',
link: function (scope, el, attrs, ctrl) {
scope.$watch("vm.selectionValue[vm.toKeep] + vm.quantityValue",
function () {
var value = {};
if (ctrl.selectionValue) {
value[ctrl.toKeep] = ctrl.selectionValue[ctrl.toKeep];
}
if (ctrl.quantityValue) {
value[ctrl.quantity] = ctrl.quantityValue;
}
ctrl.value = value;
}, true)
ctrl.init();
}
};
}]);
})();
Basically, the controller of the directive provides an initmethod to initialize the widget, and a displayValue method
to provide a textual representation of the value. In the directive, the following attributes at least must be specified
in the bindToController property to ensure proper integration with the property grid:
• sitValue, which stores the value of the widget and is used as an ng-model internally within the widget.
• sitValidation, an object containing all the validation rules defined within a sitProperty widget (documented in
the Opcenter Execution Foundation UI Framework Reference) .
Prerequisites
You must have built the UserInterface project at least once.
Localizing UI Applications
1. In Solution Explorer right-click the user interface project of your App and select Open Folder in File Explorer.
2. Double-click the resources folder.
3. In this folder add a JSON file with the English language code for each group of translations in your App. Name
the file according to the naming convention <Prefix>.<AppName>.<ModuleName>.en-US.json.
4. In each JSON file enter a translation table with all the elements to be translated. Each row must consist of a key,
which acts as a translation ID, and value, which is the text which will then be translated. These elements can be
nested in nodes if required, according to the hierarchy used in your application and according to Angular
Translate settings. Name the key according to the naming convention <Prefix>_<AppName>_<ModuleName>.
The following is an example of JSON file.
{
"Siemens_SimaticIT_Personnel_PersonnelGroupManagement": {
"assign": "Assign",
"title": "Assign Persons to Person Group"
}
{
"Siemens_SimaticIT_Personnel_PersonnelGroupManagement" :
"Siemens.SimaticIT.Personnel.PersonnelGroupManagement",
"Siemens_SimaticIT_Material_MaterialLot" :
"Siemens.SimaticIT.Material.MaterialLot"
}
If the resource file name contains a special character (for example, umcIntégration.en-US.json), the special
character must be replaced by the corresponding unicode escape code (which you can find documented on
internet, for example at page https://en.wikipedia.org/wiki/List_of_Unicode_characters) preceded by a
backslash as shown in the following example:
{
"umcIntegration": "umcInt\u00E9gration"
}
7. Create a copy of each JSON file, with the corresponding language code, for each language translation you
require. Name each file according to the naming
convention <Prefix>.<AppName>.<ModuleName>.<Language>.json (e.g.<Prefix>.<AppName
>.<ModuleName>.it-IT.json).
8. Translate each element in the corresponding JSON files into the corresponding language.
9. If your module is model-driven, for all the translations you provided in the resource file, enter the translation
key corresponding to the provided translations, within the screen, content, action and field labels you need to
translate inside Model-driven editor (see Create a Model-Driven UI Module).
Missing Translations
• If a translation is missing in an additional .json file, the system displays the relative English label in the localized
UI Application.
• If an additional .json file is missing, the UI Application displays the relative string keys, instead of the proper
translations.
Any modifications made to locale setting files will be applied for that locale in the entire UI Application
which uses any UI Module or UI Component of the App containing the modifications.
{
"it-IT": "it-IT",
"it": "it"
}
{
"ja-JP": "ja-JP",
"ja": "jp"
"it-IT": "it-IT",
"it": "it"
}
If the same locale is present in the locales folder of the App and in the common/scripts/i18n folder, the
locale file in the locales folder has precedence)
404 Page Not The server could not find what was requested.
Found
The same status code is returned also if the HTTP request exceeds the request
limit.
500 Internal The message is returned if the internal infrastructure cannot manage the error.
Server Error
For more information on possible corrective actions, you can refer to Applying Custom Configurations to
the Opcenter EX FN Service Layer in the Opcenter EX FN Installation Guide.
<configuration>
...
<appSettings>
...
<add key="ServiceLayerMaxNodeCount" value="150" />
<add key="ServiceLayerMaxExpansionDepth" value="5" />
...
</appSettings>
...
</configuration>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="104857600" maxQueryString="50000" />
</requestFiltering>
</security>
To be able to set and retrieve the user preferences (and, more in general, to update the Opcenter EX FN
database), you must make sure that the Opcenter EX FN System App is installed in your Manufacturing
Solution.
If this App is not installed, the user preferences configuration button will not be visible in the UI.
• Tile properties
Example of grid customization:
Configuring Procedure
1. Add commands.
2. Update the Counter.
Adding Commands
A service called common.services.swac.SwacUiModuleManager by UI Framework provides a way to
communicate between your custom UI Application with Siemens Web Framework.
1. Inject common.services.swac.SwacUiModuleManager service in to your angular service/component to add
the commands.
2. Register the command bar context in the Siemens Web Framework as below:
1 if (this.swacManager.enabled) {
2 this.swacManager.contextServicePromise.promise.then(function
(contextSvc) {
3 contextSvc.registerCtx( 'notesByState', { editing: 8, locked:
2, obsolete: 0, total: 10 } );
4 });
5 }
1 var cmds = {
2 commands: {},
3 commandHandlers: {},
4 commandPlacements: {},
5 actions: {}
6 };
7 var statuses = ['editing', 'locked', 'obsolete'];
8 var icons = {
9 editing: 'cmdEdit',
10 locked: 'cmdLock',
11 obsolete: 'cmdObsolete'
12 };
13 var priority = 0;
14 statuses.forEach(function (status) {
15 var label = status;//_.capitalize( status );
16 var id = 'notepad' + label + 'NotesNotificationCommand';
17 cmds.commands[id] = {
18 iconId: icons[status],
19 title: 'Notes in ' + label + ' state',
20 isToggle: true,
21 template: '<div>{{ctx.notesByState.' + status + '}}</div>'
22 };
23 cmds.commandHandlers[id] = {
24 id: id,
25 action: 'load' + label + 'Notes',
26 activeWhen: { condition: 'conditions.true' },
27 enableWhen: { condition: 'conditions.true' },
28 visibleWhen: { condition: 'conditions.true' }
29 };
30 cmds.commandPlacements[id] = {
31 id: id,
32 uiAnchor: 'mom_headerBar',
33 priority: priority + 100
34 };
35 cmds.actions['load' + label + 'Notes'] = {
36 actionType: 'JSFunction',
37 method: 'navigateTo',
38 inputData: {
39 state: 'notes',
40 params: { status: status },
41 options: { reload: true }
42 },
43 deps: 'js/mom.swac.compatibility.service'
44 };
45 });
46 var allNotes = 'notepadAllNotesNotificationCommand';
47 cmds.commands[allNotes] = {
48 iconId: 'cmdNoteProperties',
49 title: 'All notes',
50 isToggle: true,
51 template: '<div>{{ctx.notesByState.total}}</div>'
52 };
53 cmds.commandHandlers[allNotes] = {
54 id: allNotes,
55 action: 'loadAllNotes',
56 activeWhen: { condition: 'conditions.true' },
57 visibleWhen: { condition: 'conditions.true' }
58 };
59 cmds.commandPlacements[allNotes] = {
60 id: allNotes,
61 uiAnchor: 'mom_headerBar',
62 priority: 10
63 };
64 cmds.actions.loadAllNotes = {
65 actionType: 'JSFunction',
66 method: 'navigateTo',
67 inputData: {
68 state: 'notes',
69 params: { status: null },
70 options: { reload: true }
71 },
72 deps: 'js/mom.swac.compatibility.service'
73 };
1 that.swacManager.eventBusServicePromise.promise.then(function
(eventBusSvc) {
2 eventBusSvc.publish( 'mom.commands.update', cmds );
3 });
1 if (this.swacManager.enabled) {
2 var that = this;
3 this.swacManager.eventBusServicePromise.promise.then(function
(eventBusSvc) {
4 eventBusSvc.event.subscribe(function (event) {
5 if (event.data.topic === 'appCtx.update' &&
event.data.data.name === 'updateCounters') {
6 _this.logger.logInfo("New context registered",
event.data.data);
7
that.swacManager.contextServicePromise.promise.then(function (contextSvc)
{
8 contextSvc.updateCtx('notesByState', { editing: 100,
locked: 2, obsolete: 0, total: 102 });
9 });
10 }
11 });
12 });
13 }
Example
The below code dynamically inserts commands into the Commands View Model of the Siemens Web Framework.
1 StudioService.prototype.subscribeApolloContainerEvents = function () {
2 var _this = this;
3 if (this.swacManager.enabled) {
4 var that = this;
5 this.swacManager.eventBusServicePromise.promise.then(function
(eventBusSvc) {
6
7 eventBusSvc.event.subscribe(function (event) {
8 if (event.data.topic === 'appCtx.update' &&
event.data.data.name === 'updateCounters') {
9 _this.logger.logInfo("New context registered",
event.data.data);
10
that.swacManager.contextServicePromise.promise.then(function (contextSvc)
{
11 contextSvc.updateCtx('notesByState', { editing:
100, locked: 2, obsolete: 0, total: 102 });
12 });
13 }
14 });
15 });
16 this.swacManager.contextServicePromise.promise.then(function
(contextSvc) {
17 contextSvc.registerCtx('notesByState', { editing: 8, locked:
2, obsolete: 0, total: 10 });
18 var cmds = {
19 commands: {},
20 commandHandlers: {},
21 commandPlacements: {},
22 actions: {}
23 };
24 var statuses = ['editing', 'locked', 'obsolete'];
25 var icons = {
26 editing: 'cmdEdit',
27 locked: 'cmdLock',
28 obsolete: 'cmdObsolete'
29 };
30 var priority = 0;
31 statuses.forEach(function (status) {
32 var label = status;//_.capitalize( status );
33 var id = 'notepad' + label + 'NotesNotificationCommand';
34 cmds.commands[id] = {
35 iconId: icons[status],
36 title: 'Notes in ' + label + ' state',
37 isToggle: true,
38 template: '<div>{{ctx.notesByState.' + status + '}}</
div>'
39 };
40 cmds.commandHandlers[id] = {
41 id: id,
42 action: 'load' + label + 'Notes',
43 activeWhen: { condition: 'conditions.true' },
96 };
The configured header bar in Siemens Web Framework is given below screenshot.
UI Project Structure
The project structure is the following:
• <Prefix>.<AppName> folder, dedicated to the development of project specific widgets, components and
modules.
• app.js, config.js, and index.html files.
The <Prefix>.<AppName> folders contain the following sub-folders:
Folder Contains...
config all configuration files (.js) relative to the service providers, and additional
folders for tests and samples.
Folder Contains...
resources the files regarding localization (one .json file for each available language).
For more information, see Localizing Custom UI Apps and UI Framework
Resources.
styles You can define custom stylesheets within your functional block by releasing
two CSS files (<AppName>-Light.css and <AppName>-Dark.css) and
placing them in the styles folder.
Worflow
1. Create a UI Component.
2. Implement the logic in the <ComponentName>.js file, by also following:
• Implementing a UI Method in a UI Component
• Firing a UI Event from a UI Component
• Accessing Properties from a UI Component
3. Define the UI Component Template.
Parameter Description
Image (Optional) The image that identifies the UI Component in the Mashup
Editor. To set the image, click the Browse button, navigate to the
required folder and then choose the image. SVG images are not
supported.
Min Settings The minimum size of the UI Component in the Mashup editor,
expressed by the minimum number of rows and columns you want to
apply.
Max Settings The maximum size of the UI Component in the Mashup editor,
expressed by the maximum number of rows and columns you want
to apply.
5. If necessary, define the UI Component methods with the relative input arguments, and then click Next.
6. If necessary, define the UI Component events with the relative output arguments, and then click Next.
7. If necessary, define the UI Component properties with the relative default values, and then click Finish.
Each new UI Component contains by default a generic grid, which can be used as an example.
Modifying UI Components
When a UI Component is created, the <ComponentName>.js file is populated with the relevant information
automatically.
However, if you need to make some changes to the UI Component (e.g. change its general settings, add or remove
methods/events, properties), you can:
1. Right-click the <Prefix><AppName><ComponentName>.json file and select the UIComponent command. The
<Prefix><AppName><ComponentName> Update dialog box opens.
2. In the required tab, apply the needed changes by modifying the either the general settings, or adding/ removing
methods, events and so on.
Bear in mind that any information you modify will not be automatically updated in the <ComponentName>.js file,
which must subsequently be modified manually.
As the <ComponentName>.js file contains the code which is used at runtime, the system avoids any automatic
updates of runtime logic that could potentially be dangerous.
The implementation of a UI Component may vary significantly depending on the specific use case. This
auto-generated code is only meant to be an example of a possible UI Component implementation.
(function () {
'use strict';
angular.module('Siemens.MatMgt').component('siemensMatmgtMaterialdetails',
ComponentDefinition());
function ComponentDefinition() {
return {
bindings: {
name: '@'
},
templateUrl: 'Siemens.MatMgt/components/MaterialDetails/
MaterialDetails.html',
controller: ComponentController,
controllerAs: 'vm'
}
}
ComponentController.$inject = ['$rootScope', '$scope',
'common.services.logger.service', 'common.services.component.uiComponentService'];
function ComponentController($rootScope, $scope, loggerService,
uiComponentService) {
var self = this;
var logger;
activate();
function activate() {
logger = loggerService.getModuleLogger('siemensMatmgtMaterialdetails');
init();
registerEvents();
exposeApi();
//TODO: Insert Your Initialization Code Here
initGrid();
}
function init() {
logger.logDebug('Initializing component....', self.name);
self.selectedItem = null;
self.viewerData = [];
self.viewerOptions = {};
//TODO: Insert Your Variable Initialization Here
}
function exposeApi() {
}
function registerEvents() {
$scope.$on('$destroy', deregisterEvents);
//TODO: Uncomment below code if you want to listen on component resize
//For example hanlding svg elements or etc.
//uiComponentService.registerComponentResizeCallback(self.name,
onComponentResize);
//TODO: Uncomment below code if you want to listen on design mode toggled
//
uiComponentService.registerDesignModeToggleCallback(onDesignModeToggled);
}
function deregisterEvents() {
//TODO: Uncomment below code if you are enabled the registration
//uiComponentService.deregisterComponentResizeCallback(self.name,
onComponentResize);
//TODO: Uncomment below code if you are enabled the registration
//
uiComponentService.deregisterDesignModeToggleCallback(onDesignModeToggled);
}
function initGrid() {
self.viewerOptions = {
containerID: 'itemlist',
selectionMode: 'single',
viewOptions: 'gml',
quickSearchOptions: { enabled: true, field: 'Id' },
sortInfo: {
field: 'Id',
direction: 'asc'
},
gridConfig: {
columnDefs: [
{ field: 'Id' }
]
},
propertyFields: [
{ field: 'Id', displayName: 'Id' }
],
image: 'fa-puzzle-piece',
tileConfig: {
titleField: 'Id'
},
onSelectionChangeCallback: function (items, item) {
if (item && item.selected == true) {
self.selectedItem = item;
} else {
self.selectedItem = null;
}
}
};
}
function onComponentResize(size) {
logger.logDebug('Component resized....:' + size.width + ',' +
size.height);
//TODO: Insert code to be executed on component resize
}
function onDesignModeToggled(isEnabled) {
logger.logDebug('Design mode toggled....' + isEnabled);
//TODO: Insert code to be executed on design mode toggled
}
}
})();
You can manually add new methods directly to the .js file, but these methods must then be also added to
the UI Component manifest (json file) by using the <Prefix><AppName><ComponentName> Update
dialog box.
Code example
The following method definition contains code elements that are described here below:
Element Description
You can manually add new events directly to the .js file, but these events must then be also added to the
UI Component manifest (json file) by using the <Prefix><AppName><ComponentName> Update dialog
box.
Code example
The following code represents an example of fire, containing code elements that are described here below:
Element Description
siemensTestappOrderlist The full name of the component, with prefix and App name
You can manually add new properties directly to the .js file, but these properties must then be also added
to the UI Component manifest (json file) by using the <Prefix><AppName><ComponentName> Update
dialog box.
The definition of each property, in the UI Component manifest, is characterized by the following properties:
Property Description
Category A logical categorization of the property, e.g. "Layout", "Data" etc. (useful
to categorize the properties in the Mashup Editor).
Description This property is optional and can be used to provide a description for the
property.
Property Description
Default This property is optional and can be set to a suitable default value for the
property. By default it is set to null. If you want to modify it, the inserted
value must correspond to the selected type.
Opcenter Execution Foundation UI Framework provides you with public APIs (see UIComponent in the Opcenter
Execution Foundation UI Framework Reference) for reading and writing on the UI Component properties and for
notifying a property change.
<style type="text/css">
/*Uncomment the below style snippet if you want the component to be displayed
above other components*/
/*div[name^="{{vm.name}}"] {
overflow: visible;
}*/
</style>
<div class="content-area content-area-relative" style="height: 100%" id="itemlist">
<sit-item-collection-viewer sit-data="vm.viewerData" sit-
options="vm.viewerOptions"></sit-item-collection-viewer>
</div>
Prerequisites
The Service Layer is up and running.
To make a UI Module Screen visible only to a specific user role, it must be made securable by manually
modifying its UI Module manifest.
The modules folder must contain only subfolders that correspond to actual UI Modules. If you want to use
third-party scripts, you should place them in the scripts folder instead.
UI Module Example
var state = {
name: moduleStateName + '_UIModuleScreen2',
url: '/' + moduleStateUrl + '_UIModuleScreen2',
views: {
'Canvas@': {
templateUrl: moduleFolder + '/UIModuleScreen2-list.html',
controller: ListScreenController,
controllerAs: 'vm'
}
},
data: {
title: '<The title of the UI Module Screen>'
}
{
name: moduleStateName + '_UIModuleScreen2',
"type": "standard",
"title": "<ModuleName>",
"header":"",
"icon": 'The svg icon'
"functionalBlock": "<AppName>"
"dependencies": [],
"states": [
{
"id": moduleStateName + '_UIModuleScreen2',
"title": screenName,
"header":"",
"securable": true,
"roles": []
}
],
},
"manifestVersion": "<VersionId>"
}
<ScreenName>-list.html
The following default template is used to display an ICV and a toolbar with four standard buttons, but you can
customize it adding/removing buttons.
<ScreenName>-list.html
The following default template is used to display an ICV and a toolbar with four standard buttons, but you can
customize it adding/removing buttons.
(function () {
'use strict';
angular.module('Siemens.MatMgt',
['Siemens.MatMgt.MatDef']);
})
module.js
1 (function(){
2 'use strict';
3 angular.module('Siemens.MatMgt.MatDefMgt',
[]).config(ModuleStateConfig);
4 ModuleStateConfig.$inject = ['$stateProvider'];
5 function ModuleStateConfig($stateProvider) {
6 var moduleStateName = 'home.Siemens_MatMgt.MatDefMgt';
7 var moduleFolder = 'Siemens.MatMgt/modules/MatDefMgt';
8 var moduleState = {
9 name: moduleStateName,
10 url: '/MatDefMgt',
11 abstract: true
12 };
13 $stateProvider.state(moduleState);
14 //Add new state
15 }
16 }());
In the example above, the definition creates a new AngularJS module called Siemens.MatMgt.MatDefMgt. Note
that:
• the name of the UI Module starts with the name of the App.
• if you want to organize your code in sub-modules, specify them as dependencies of the main module through
the second parameter, which is used for dependency injection. If your module does not have any dependencies,
set this parameter to an empty array when creating a module.
The module method is used to retrieve an existing module if only the first parameter is specified. For more
information, see AngularJS documentation (https://code.angularjs.org/1.6.9/docs/api/ng/function/
angular.module).
When you define the main AngularJS module for your UI Module, you can include the routing configuration in the
same file (or split it into multiple files if it becomes too complex to manage within a single file).
The module.js file includes the configuration of the $stateProvider, listing all additional states that are used within
the UI Module. Consequently, you must manually update this file whenever you add/delete an additional state,
while this operation is not necessary for the main states generated by the system, which are directly managed from
the corresponding .js files.
For example:
module.js
1 (function () {
2 'use strict';
3 angular.module('Siemens.MatMgt.MatDefMgt',
[]).config(ModuleStateConfig);
4 ModuleStateConfig.$inject = ['$stateProvider'];
5 function ModuleStateConfig($stateProvider) {
6 var moduleStateName = 'home.Siemens_MatMgt.MatDefMgt';
7 var moduleFolder = 'Siemens.MatMgt/modules/MatDefMgt';
8 var moduleState = {
9 name: moduleStateName,
10 url: '/MatDefMgt',
11 abstract: true
12 };
13 var matDefSave = {
14 name: moduleStateName + '.state_name',
15 url: '/state_url',
16 views: {
17 'Canvas@': {
18 templateUrl: moduleFolder + '/state_template.html',
19 controller: 'state_controller',
20 controllerAs: 'vm'
21 }
22 },
23 data: {
24 title: 'matDefSave'
25 displayBreadcrumb : false
26 },
27 params: {}
28 };
29 $stateProvider.state(matDefSave);
30 }
31 } ());
Breadcrumb visibility
The visibility of the breadcrumb in any state can be managed from routing configuration, by adding the
displayBreadcrumb property.
For example:
var item = {
name: 'rootstate',
url: '/rootstate',
views: {
'Canvas@': {
templateUrl: 'template.html',
controller: templateController,
controllerAs: 'vm'
}
},
data: {
title: 'Template Title',
help: "Managing Materials",
displayBreadcrumb: false
}
}
If the displayBreadcrumb property is not specified, its value will be inherited as follows:
• if it is not specified in any state it will be inherited from its parent state.
• if it is not present in any parent state or if the parent is not present, then the default value is true.
1 {
2 "name": "Siemens.MatMgt.MatDefMgt",
3 "type": "standard",
4 "title": "MatDefMgt",
5 "header":"",
6 "icon": "fa-folder",
7 "functionalBlock": "Siemens.MatMgt",
8 "dependencies": [],
9 "states": [
10 {
11 "id": "home.Siemens_MatMgt.MatDefMgt.MatMgtPage",
12 "title": "MatMgtPage",
13 "header":"",
14 "securable": true,
15 "roles": []
16 }
17 ],
18 "manifestVersion": "01.01.00"
19 }
• The module declares a state (MatMgtPage) which will be used as an entry point for the UI Module and that will
be included in the sidebar of every UI Application containing the UoM module. The securable property is true, so
the screen can consequently only be viewed by users that have the Supervisor role assigned to them.
• The fa-folder icon ( ) will be used in the sidebar to identify the menu for this UI Module.
• The name of the App (Siemens.MatMgt) containing the UI Module is specified via the functionalBlock property.
(function () {
'use strict';
angular.module('Siemens.MatMgt.MatDefMgt')
.constant('Siemens.MatMgt.MatDefMgt.MatMgtPage.constants',
ScreenServiceConstants())
.service('Siemens.MatMgt.MatDefMgt.MatMgtPage.service', ScreenService)
.run(ScreenServiceRun);
function ScreenServiceConstants() {
return {
data: {
appName: 'MatMgt',
appPrefix: 'Siemens',
// TODO: Customize the entityName with the name of the entity defined
in the App you want to manage within the UI Module.
// Customize the command name with the name of the command
defined in the App you want to manage within the UI Module
entityName: null,
createPublicName: null,
updatePublicName: null,
deletePublicName: null
}
};
}
ScreenService.$inject = ['$q', '$state', 'common.base',
'Siemens.MatMgt.MatDefMgt.MatMgtPage.constants', 'common.services.logger.service'];
function ScreenService($q, $state, base, context, loggerService) {
var self = this;
var logger, backendService;
activate();
function activate() {
logger =
loggerService.getModuleLogger('Siemens.MatMgt.MatDefMgt.MatMgtPage.service');
backendService = base.services.runtime.backendService;
exposeApi();
}
function exposeApi() {
self.getAll = getAll;
self.create = createEntity;
self.update = updateEntity;
self.delete = deleteEntity;
}
function getAll(options) {
return execGetAll(options);
}
function createEntity(data) {
// TODO: Customize the mapping between "UI entity" and the "DB entity"
that will create
var obj = {
'Id': data.Id
};
return execCommand(context.data.createPublicName, obj);
}
function updateEntity(data) {
// TODO: Customize the mapping between "UI entity" and the "DB entity"
that will create
var obj = {
'Id': data.Id
};
return execCommand(context.data.updatePublicName, obj);
}
function deleteEntity(data) {
// TODO: Customize the mapping between "UI entity" and the "DB entity"
that will delete
var obj = {
'Id': data.Id
};
return execCommand(context.data.deletePublicName, obj);
}
function execGetAll(options) {
return backendService.findAll({
'appName': context.data.appName,
'entityName': context.data.entityName,
'options': options
});
}
function execCommand(publicName, params) {
logger.logDebug('Executing command.......', publicName);
return backendService.invoke({
'appName': context.data.appName,
'commandName': publicName,
'params': params
});
}
}
ScreenServiceRun.$inject = ['Siemens.MatMgt.MatDefMgt.MatMgtPage.constants',
'common.base'];
function ScreenServiceRun(context, common) {
if (!context.data.entityName) {
common.services.logger.service.logWarning('Configure the entityName');
};
if (!context.data.createPublicName) {
common.services.logger.service.logWarning('Configure the
createPublicName');
};
if (!context.data.deletePublicName) {
common.services.logger.service.logWarning('Configure the
deletePublicName');
};
if (!context.data.updatePublicName) {
common.services.logger.service.logWarning('Configure the
updatePublicName');
};
}
}());
The Service depends on the following AngularJS services (provided by AngularJS, third-party libraries, or the UI
Framework):
• common.base – retrieves data from the runtime service layer, executes commands on the runtime service
layer, configures and shows a message overlay, shows/hides a busy indicator and exposes a set of commonly
used methods, such as the formatErrorMessage method, which can automatically format an error response
received from the service layer.
• $q – handles Javascript promises.
• $state – used to programmatically redirect to another application state.
• common.services.logger.service – logs diagnostic messages to the browser console.
Once created, the <ScreenName>-srv.js file must be manually modified for:
1. Constants
2. Methods
Constants
Customize the constant section of the file setting the following values otherwise an error is returned:
• entityName: the name of the entity defined in the App you want to manage within the UI Module.
• createPublicName: the name of the command to be used to create a new entity.
• updatePublicName: the name of the command to be used to modify an entity.
• deletePublicName: the name of the command to be used to delete an entity.
Example
.constant('MatMgtPage.constants', {
data: {
entityName: MaterialDefinition,
createPublicName: 'CreateMaterialDefinition',
updatePublicName: 'UpdateMaterialDefinition',
deletePublicName: 'DeleteMaterialDefinition'
}
function ScreenServiceConstants() {
return {
data: {
appName: 'MatMgt',
appPrefix: 'Siemens',
entityName: MaterialDefinition,
createPublicName: 'CreateMaterialDefinition',
updatePublicName: 'UpdateMaterialDefinition',
deletePublicName: 'DeleteMaterialDefinition'
}
};
}
Methods
The Service is realized as a factory that returns an object exposing the following high-level methods:
• getAll – retrieves all the available entities,
• create – creates a single entity,
function createEntity(data) {
var obj = {
'Id': data.Id,
'name' : data.name,
'description' : data.description
};
return execCommand(context.data.createPublicName, obj);
}
<ScreenName>-list.html
The following default template is used to display a toolbar with four standard buttons, but you can customize it
adding/removing buttons.
<ScreenName>-list-ctrl.js
The controller manages the visualization of the entity that has been defined in the App and allows you to use the
command bar to perform CRUD operations on this entity.
You can modify the file in order to perform additional operations, or to remove the standard ones, simply modifying
the references to the relative handlers.
For more information on the sections to be modified refer to the comments within the file generated by the system:
(function () {
'use strict';
ListScreenController.$inject = ['Siemens.MatMgt.MatDefMgt.MatMgtPage.service',
'$state', '$stateParams', '$rootScope', '$scope', 'common.base',
'common.services.logger.service'];
function ListScreenController(dataService, $state, $stateParams, $rootScope,
$scope, base, loggerService) {
var self = this;
var logger, rootstate, messageservice, backendService;
activate();
// Initialization function
function activate() {
logger =
loggerService.getModuleLogger('Siemens.MatMgt.MatDefMgt.MatMgtPage');
init();
initGridOptions();
initGridData();
}
function init() {
logger.logDebug('Initializing controller.......');
rootstate = 'home.Siemens_MatMgt.MatDefMgt.MatMgtPage';
messageservice = base.widgets.messageOverlay.service;
backendService = base.services.runtime.backendService;
self.isButtonVisible = visible;
}
}
ListScreenRouteConfig.$inject = ['$stateProvider'];
function ListScreenRouteConfig($stateProvider) {
var moduleStateName = 'home.Siemens_MatMgt.MatDefMgt';
var moduleFolder = 'Siemens.MatMgt/modules/MatDefMgt';
var state = {
name: moduleStateName + '.MatMgtPage',
url: '/MatMgtPage',
views: {
'Canvas@': {
templateUrl: moduleFolder + '/MatMgtPage-list.html',
controller: ListScreenController,
controllerAs: 'vm'
}
},
data: {
title: 'MatMgtPage'
}
};
$stateProvider.state(state);
}
}());
Click on Select All icon, all the rows displayed when Mode is Table are selected. While Select All checkbox
is selected, rows that are newly added and the rows that are loaded by scrolling in server side pagination
will be selected automatically.
This is the default setting. To implement the behavior, you must remove any custom settings if available
with respect to the selecting records.
The command bar can be exposed to maximum two different button set. If you add more commands or
reduce the size of the command bar, you may miss out some of the commands.
1 var item = {
2 name: rootstate,
3 url: '/' + context.data.entityName,
4 views: {
5 'Canvas@': {
6 templateUrl: folder + '/MatMgtPage-list.html',
7 controller: ListScreenController,
8 controllerAs: 'vm'
9 }
10 },
11 data: {
12 title: context.data.entityName,
13 help: "Managing Materials"
14 },
If a help string has been configured in this way, the help button will be displayed in the header bar, and if clicked it
will open the documentation help window required.
<ScreenName>-add.html
The following default template allows you to display the standard property (Id) of the entity managed by the UI
Module. You can modify the file manually in order to display the other entity properties that have been defined in
the UI Module Data Service or to hide the Id property.
<div class="command-bar-side-panel">
<button ng-click="vm.cancel()" class="btn side-panel-button">Cancel</button>
<button ng-click="vm.save()" class="btn side-panel-button" ng-
show="vm.validInputs">Save</button>
</div>
<div class="side-panel-property-area-body">
<sit-property-grid sit-id="add_form"
sit-layout="Vertical"
sit-type="Fluid"
sit-mode="edit"
sit-columns="1">
<!-- TODO: Type here the properties of the entity managed by the service -->
<sit-property sit-widget="sit-text"
sit-value="vm.currentItem.Id"
sit-validation="{required: true}"
sit-read-only="false">ID:</sit-property>
</sit-property-grid>
</div>
<ScreenName>-add-ctrl.js
The controller manages the creation of new entities with the properties defined in the model factory of the UI
Module Data Service.
(function () {
'use strict';
AddScreenController.$inject = ['Siemens.MatMgt.MatDefMgt.MatMgtPage.service',
'$state', '$stateParams', 'common.base', '$filter', '$scope'];
function AddScreenController(dataService, $state, $stateParams, common, $filter,
$scope) {
var self = this;
var sidePanelManager, backendService, propertyGridHandler;
activate();
function activate() {
init();
registerEvents();
sidePanelManager.setTitle('Add');
sidePanelManager.open('e');
}
function init() {
sidePanelManager = common.services.sidePanel.service;
backendService = common.services.runtime.backendService;
//Initialize Model Data
self.currentItem = null;
self.validInputs = false;
//Expose Model Methods
self.save = save;
self.cancel = cancel;
}
function registerEvents() {
$scope.$on('sit-property-grid.validity-changed',
onPropertyGridValidityChange);
}
function save() {
dataService.create(self.currentItem).then(onSaveSuccess,
backendService.backendError);
}
function cancel() {
sidePanelManager.close();
$state.go('^');
}
function onSaveSuccess(data) {
sidePanelManager.close();
$state.go('^', {}, { reload: true });
}
function onPropertyGridValidityChange(event, params) {
self.validInputs = params.validity;
}
}
AddScreenStateConfig.$inject = ['$stateProvider'];
function AddScreenStateConfig($stateProvider) {
var screenStateName = 'home.Siemens_MatMgt.MatDefMgt.MatMgtPage';
var moduleFolder = 'Siemens.MatMgt/modules/MatDefMgt';
var state = {
name: screenStateName + '.add',
url: '/add',
views: {
'property-area-container@': {
templateUrl: moduleFolder + '/MatMgtPage-add.html',
controller: AddPageController,
controllerAs: 'vm'
}
},
data: {
title: 'Add'
}
};
$stateProvider.state(state);
}
}());
<ScreenName>-edit.html
The following default template allows you to display in edit mode the standard property (Id) of the entity managed
by the UI Module. You can modify the file manually in order to display the other entity properties that have been
defined in the UI Module Data Service or to hide the Id property.
<div class="command-bar-side-panel">
<button ng-click="vm.cancel()" class="btn side-panel-button">Cancel</button>
<button ng-click="vm.save()" class="btn side-panel-button" ng-
show="vm.validInputs">Save</button>
</div>
<div class="side-panel-property-area-body">
<sit-property-grid sit-id="edit_form"
sit-layout="Vertical"
sit-type="Fluid"
sit-mode="edit"
sit-columns="1">
<!-- TODO: Type here the properties of the entity managed by the service -->
<sit-property sit-widget="sit-text"
sit-value="vm.currentItem.Id"
sit-validation="{required: true}"
sit-read-only="false">ID:</sit-property>
</sit-property-grid>
</div>
<ScreenName>-edit-ctrl.js
The controller manages the editing of entities with the properties defined in the model factory of the UI Module
Data Service.
(function () {
'use strict';
EditScreenController.$inject = ['Siemens.MatMgt.MatDefMgt.MatMgtPage.service',
'$state', '$stateParams', 'common.base', '$filter', '$scope'];
function EditScreenController(dataService, $state, $stateParams, common, $filter,
$scope) {
var self = this;
var sidePanelManager, backendService, propertyGridHandler;
activate();
function activate() {
init();
registerEvents();
sidePanelManager.setTitle('Edit');
sidePanelManager.open('e');
}
function init() {
sidePanelManager = common.services.sidePanel.service;
backendService = common.services.runtime.backendService;
//Initialize Model Data
// TODO: Type here the properties of the entity managed by the service
self.currentItem = angular.copy($stateParams.selectedItem);
self.validInputs = false;
//Expose Model Methods
self.save = save;
self.cancel = cancel;
}
function registerEvents() {
$scope.$on('sit-property-grid.validity-changed',
onPropertyGridValidityChange);
}
function save() {
dataService.update(self.currentItem).then(onSaveSuccess,
backendService.backendError);
}
function cancel() {
sidePanelManager.close();
$state.go('^');
}
function onSaveSuccess(data) {
sidePanelManager.close();
$state.go('^', {}, { reload: true });
}
function onPropertyGridValidityChange(event, params) {
self.validInputs = params.validity;
}
}
EditScreenStateConfig.$inject = ['$stateProvider'];
function EditScreenStateConfig($stateProvider) {
var screenStateName = 'home.Siemens_MatMgt.MatDefMgt.MatMgtPage';
var moduleFolder = 'Siemens.MatMgt/modules/MatDefMgt';
var state = {
name: screenStateName + '.edit',
url: '/edit/:id',
views: {
'property-area-container@': {
templateUrl: moduleFolder + '/MatMgtPage-edit.html',
controller: EditScreenController,
controllerAs: 'vm'
}
},
data: {
title: 'Edit'
},
params: {
selectedItem: null,
}
};
$stateProvider.state(state);
}
}());
<ScreenName>-select.html
The following default template allows you to display the details of the standard property (Id) of the entity managed
by the UI Module. You can modify the file manually in order to display the other entity properties that have been
defined in the UI Module Data Service or to hide the Id property.
<div class="command-bar-side-panel">
<button ng-click="vm.cancel()" class="btn side-panel-button">Close</button>
</div>
<div class="side-panel-property-area-body">
<sit-property-grid sit-id="view_form"
sit-layout="Vertical"
sit-type="Fluid"
sit-mode="view"
sit-columns="1">
<!-- TODO: Type here the properties of the entity managed by the service -->
<sit-property sit-widget="sit-label" sit-value="vm.currentItem.Id">ID:</sit-
property>
</sit-property-grid>
</div>
<ScreenName>-select-ctrl.js
The controller allows you to define the entity property for which you want to display the details.
By default only the details of the Id property are displayed, to add other properties, modify the init function within
the file.
(function () {
'use strict';
ViewScreenController.$inject = ['Siemens.MatMgt.MatDefMgt.MatMgtPage.service',
'$state', '$stateParams', 'common.base', '$filter', '$scope'];
function ViewScreenController(dataService, $state, $stateParams, common, $filter,
$scope) {
var self = this;
var sidePanelManager, backendService, propertyGridHandler;
activate();
function activate() {
init();
sidePanelManager.setTitle('Select');
sidePanelManager.open('e');
}
function init() {
sidePanelManager = common.services.sidePanel.service;
backendService = common.services.runtime.backendService;
//Initialize Model Data
// TODO: Type here the properties of the entity managed by the service
self.currentItem = $stateParams.selectedItem;
//Expose Model Methods
self.cancel = cancel;
}
function save() {
dataService.update(self.currentItem).then(onSaveSuccess,
backendService.backendError);
}
function cancel() {
sidePanelManager.close();
$state.go('^');
}
function onSaveSuccess(data) {
sidePanelManager.close();
$state.go('^', {}, { reload: true });
}
function onPropertyGridValidityChange(event, params) {
self.validInputs = params.validity;
}
}
ViewScreenStateConfig.$inject = ['$stateProvider'];
function ViewScreenStateConfig($stateProvider) {
var screenStateName = 'home.Siemens_MatMgt.MatDefMgt.MatMgtPage';
var moduleFolder = 'Siemens.MatMgt/modules/MatDefMgt';
var state = {
name: screenStateName + '.select',
url: '/select/:id',
views: {
'property-area-container@': {
templateUrl: moduleFolder + '/MatMgtPage-select.html',
controller: ViewScreenController,
controllerAs: 'vm'
}
},
data: {
title: 'Select'
},
params: {
selectedItem: null,
}
};
$stateProvider.state(state);
}
}());
Deleting a UI Module
Manually delete both of the following from Project Studio and then verify that they also have been removed from
the File System:
• <ModuleName> folder
• <Prefix>.<AppName>.<ModuleName>.json file
Deleting a Screen
1. Manually delete the following files:
• <ScreenName>-list.html
• <ScreenName>-list-ctrl.js
• <ScreenName>-srv.js
• <ScreenName>-add.html,
• <ScreenName>-add-ctrl.js
• <ScreenName>-select.html
• <ScreenName>-select-ctrl.js
• <ScreenName>-edit.html
• <ScreenName>-edit-ctrl.js
2. Open then following files and delete any reference to the removed screen:
• <Prefix>.<AppName>.<ModuleName>.json
• module.js
<ServerSidePagination-Facet>-list-ctrl.js
findAll service has been enhanced with the capability to flatten facet information to display properties from facets
easily. The widgets ICV and sit-table internally manages the transformed data with the appropriate configuration. In
the case where your screen has to show data in client side mode involving facet information, you can
provide dataTransformInfo as an argument to the findAll service to obtain facets information flattened in the same
level as entity properties. Example for dataTransformInfo is as follows.
1 dataTransformInfo = {
2 facetKeys: {
3 <AliasNameForTheFacet_Defect>: { fullyQualifiedName:
'Siemens.MaterialFacetsTest.MaterialFacetsTest.BLPOMModel.DataModel.Readin
gModel.Defect' },
4 Location: { fullyQualifiedName: <Fully qualified name of the Facet
- Location as exposed from metadata> },
5 Status: { fullyQualifiedName:
'Siemens.MaterialFacetsTest.MaterialFacetsTest.BLPOMModel.DataModel.Readin
gModel.Status' }
6 }
When findAll is used with dataTransformInfo as an argument, original Facets array will no longer be available in the
response from findAll. Example of the response is as shown below.
1 succeeded: true
2 value: Array(7)
3 0: {Id: "d89eaf5a-71ac-ea11-9010-0050569f6a28", AId: "d89eaf5a-71ac-
ea11-9010-0050569f6a28", IsFrozen: false, ConcurrencyVersion: 0,
IsDeleted: 0, …}
4 1: {Id: "b67e2f80-71ac-ea11-9010-0050569f6a28", AId: "b67e2f80-71ac-
ea11-9010-0050569f6a28", IsFrozen: false, ConcurrencyVersion: 0,
IsDeleted: 0, …}
5 2: {Id: "8cf1f3d3-71ac-ea11-9010-0050569f6a28", AId: "8cf1f3d3-71ac-
ea11-9010-0050569f6a28", IsFrozen: false, ConcurrencyVersion: 0,
IsDeleted: 0, …}
6 3: {Id: "8cf1f3d3-71ac-ea11-9010-0050569f6a28", AId: "c57ea457-73ac-
ea11-9010-0050569f6a28", IsFrozen: false, ConcurrencyVersion: 0,
IsDeleted: 0, …
7 CreatedOn: "2020-06-12T06:09:58.9846043Z"
8 Defect: {@odata.type:
"#Siemens.MaterialFacetsTest.MaterialFacetsTest.VKPOMModel.DataModel.Readi
ngModel.Defect", Id: "c77ea457-73ac-ea11-9010-0050569f6a28", AId:
"c77ea457-73ac-ea11-9010-0050569f6a28", IsFrozen: false,
ConcurrencyVersion: 0, …}
9 Location: {@odata.type:
"#Siemens.MaterialFacetsTest.MaterialFacetsTest.VKPOMModel.DataModel.Readi
ngModel.Location", Id: "c87ea457-73ac-ea11-9010-0050569f6a28", AId:
"c87ea457-73ac-ea11-9010-0050569f6a28", IsFrozen: false,
ConcurrencyVersion: 0, …}
10 Status: {@odata.type:
"#Siemens.MaterialFacetsTest.MaterialFacetsTest.VKPOMModel.DataModel.Readi
ngModel.Status", Id: "c67ea457-73ac-ea11-9010-0050569f6a28", AId:
"c67ea457-73ac-ea11-9010-0050569f6a28", IsFrozen: false,
ConcurrencyVersion: 0, …}
11 Description: null
12 EntityType: "Siemens.MasterData.FacetLib_Mat.MSModel.DataModel.Material"
13 Id: "c57ea457-73ac-ea11-9010-0050569f6a28"
14 LastUpdatedOn: "2020-06-12T06:09:58.9846043Z"
15 NId: "Entity_NId"
16 Name: "Entity Name"
17 ToBeCleaned: false …}
18 4: {Id: "b028e776-a3ac-ea11-9010-0050569f6a28", AId: "b028e776-a3ac-
ea11-9010-0050569f6a28", IsFrozen: false, ConcurrencyVersion: 0,
IsDeleted: 0, …}
19 5: {Id: "0f08195e-a7ac-ea11-9010-0050569f6a28", AId: "0f08195e-a7ac-
ea11-9010-0050569f6a28", IsFrozen: false, ConcurrencyVersion: 0,
IsDeleted: 0, …}
20 6: {Id: "76b4dd67-a7ac-ea11-9010-0050569f6a28", AId: "76b4dd67-a7ac-
ea11-9010-0050569f6a28", IsFrozen: false, ConcurrencyVersion: 0,
IsDeleted: 0, …}
When you want to configure a screen with client side data, involving sorting from facet properties you can use the
findAll service by providing values for the facetInfo argument along with the dataTransformInfo as explained
earlier in this section. With the facetInfo argument provided, one can use the service to sort the entities on
properties from facet. findAll will issue two requests to the service layer to achieve sorting. Hence the queryParams
applicable for the facet query must be carefully formed, considering the required results. Example for facetInfo is as
shown below.
1 facetInfo = {
2 name = 'Defect',
3 queryParams:
'$top=10&$skip=0&$orderby=DefectType&$select=Material&$expand=Material($ex
pand=Facets)&$count=true',
4 // prevReqState optional for client side
5 prevReqState = {
6 areMoreFacetsAvailable: true,
7 facetQueriedCount: 0,
8 entityQueriedCount: 0,
9 totalFacetCount: 0,
10 totalEntityCount: 0
11 }
12 }
The following example defines an example for the module screen with client side data. In the controller that
manages the visualization of the entity along with properties from facets that has been defined in the App. Use the
initGridData with arguments as shown below while invoking findAll.
While providing the options for entity when sorting on facet properties, we have to specify a filter condition to
exclude the entities which will be queried from the facet specific query. This must be done to eliminate duplicates.
Along with this condition specified mandatorily one can add adittional conditions to filter entities.
1 function initGridData() {
2 var clientSideFindAllArgs = {
3 'options': '$filter=not(Facets/any(f: f/
Siemens.WidgetApp.WidgetApp.WAPOMModel.DataModel.ReadingModel.Characterist
ics ne null))&$top=10&$skip=0&$expand=Facets&$count=true',
4 'appName': 'WidgetApp',
5 'entityName': 'Inspection',
6 'facetInfo': {
7 'name': 'Defect',
8 'queryParams':
'$top=10&$skip=0&$orderby=DefectType&$select=Inspection&$expand=Material($
expand=Facets)&$count=true',
9 },
10 'dataTransformInfo': {
11 'facetKeys': {
12 'Characteristics': { 'fullyQualifiedName':
'Siemens.WidgetApp.WidgetApp.WAPOMModel.DataModel.ReadingModel.Characteris
tics' },
13 }
14 }
15 }
16
17 dataService.findAll(clientSideFindAllArgs).then(function
(data) {
18 if ((data) && (data.succeeded)) {
19 self.viewerData = data.value;
20 } else {
21 self.viewerData = [];
22 }
23 }, backendService.backendError);
24 }
<ServerSidePagination-Facet>-list.html
The following template is an example that is used to display an ICV consisting of properties from entity and facets,
but you can customize it.
<ServerSidePagination-Facet>-list-ctrl.js
The controller manages the visualization of the entity along with properties from facets that has been defined in the
App.
1 function initGridOptions() {
2 self.viewerOptions = {
3 containerID: 'inspectionDefinitionMasterDetails',
4 svgIcon: 'common/icons/typeExecGroup48.svg',
5 tileConfig: {
6 isCell: true,
7 titleField: 'NId',
8 descriptionField: 'Description',
9 propertyFields: [
10 { field: 'CharType.IsVisual', displayName:
'IsVisual',fieldSource:'Characteristics' },
11 { field: 'CharType.IsAttribute', displayName:
'IsAttribute',fieldSource:'Characteristics' },
12 { field: 'CharType.Variable', displayName:
'Variable' ,fieldSource:'Characteristics'},
13 { field: 'Facet_NId', displayName: 'Facet_NId' ,fiel
dSource:'Characteristics'}
14 ]
15 },
16 filterBarOptions: 'SQ',
17 quickSearchOptions: {
18 enabled: true,
19 field: 'Facet_NId',
20 fieldSource:'Characteristics',
21 filterText: ''
22 },
23 selectionMode: 'single',
24 serverDataOptions: {
25 dataEntity: 'Inspection',
26 optionsString: '',
27 appName: 'WidgetApp',
28 dataService: backEnd,
29 fieldSources: {
30 Characteristics: {
31 name:
'Siemens.WidgetApp.WidgetApp.WAPOMModel.DataModel.ReadingModel.Characteris
tics',
32 type: 'facet'
33 }
34 }
35 },
36 sortInfo: {
37 field: 'Name',
38 direction: 'asc',
39 fields: [
40 { field: 'Name', displayName: 'Name'},
41 { field: 'NId', displayName: 'Id'},
42 { field: 'CharType.IsVisual', displayName: 'IsVisual',
fieldSource:'Characteristics' },
43 { field: 'CharType.IsAttribute', displayName:
'IsAttribute',fieldSource:'Characteristics' },
Prerequisites
• The App, in which you are creating the Model-Driven UI Module, references the Functional Block that contains
the Entities, the Commands or the Reading Functions you want to use in the UI Module.
• The Entities to be used in the in Model-Driven Editor must be present in the Public Object Model of the App
(Functional Block entities cannot be directly accessed).
• The Public Object Model must contain at least one entity, otherwise the Model-Driven Editor cannot start.
• The POMModel project has been built to create the required assemblies.
• If you are modifying an existing Model-Driven UI Module, each time you apply a change to the POMModel project
(for example by adding an Entity or a Command), you must recompile the POMModel project and then stop and
start the UI Model-Driven Server.
Workflow
1. Create a new Model-Driven UI Module or Extend a MDUI Module From Base App.
2. Open the Model-Driven UI Editor.
3. (Optional) Modify the Model-Driven UI Module Information.
4. Create a New Model-Driven UI Screen.
5. Configure the Model-Driven UI Screen Contents . Otherwise, configure a Custom Content for a Master-Details UI
Screen.
6. Configure the Model-Driven UI Screen Actions. Otherwise, configure Custom Action Types for Execute Command
and View Actions or configure Custom Action with In-Canvas Mode for Execute Command and View Actions.
When you create a Model-Driven UI Module, the system generates a manifest with the entered project information.
You can extend a Model-Driven Module by copying it from a base App to an Extension App as described at page How
to Extend User Interfaces in an Extension App.
Procedure
1. In you App/Extension App solution, right-click the <Prefix>.<AppName>/modules folder and then select
the Add > New Item command.
2. Select the UI Model-Driven Module template (Visual C#\Web section).
3. Type the file name in the Name edit box and click Add. Under the modules project folder, the wizard creates
an .mdui extension file containing the project information (such as the module name, the module title, the icon
and so on). This information should not be modified here but rather in the module configuration page of the
Model-Driven UI Editor (as described later in the configuration process).
Prerequisites
• The App, in which you are creating the Model-Driven UI Module, references the Functional Block that contains
the Entities, the Commands or the Reading Functions you want to use in the UI Module.
• The Entities to be used in the in Model-Driven Editor must be present in the Public Object Model of the App
(Functional Block entities cannot be directly accessed).
• The Public Object Model must contain at least one entity, otherwise the Model-Driven Editor cannot start.
• The POMModel project has been built to create the required assemblies.
• If you are modifying an existing Model-Driven UI Module, each time you apply a change to the POMModel project
(for example by adding an Entity or a Command), you must recompile the POMModel project and then stop and
start the UI Model-Driven Server.
• In the App/Extension App, right-click the <Prefix>.<AppName>UserInterface project and then select the Start
UI Model-Driven Server command.
Procedure
1. Right-click the module manifest file (<Acronym.AppName.ModelDrivenModuleName>.mdui or .ext) and then
select the Open UI Model-Driven Module Editor command. The editor opens in a Project Studio tab, with the
module configuration page open by default.
Procedure
1. In the Module configuration start page, click Edit Module and enter the required information:
Parameter Description
Title Module public title that will be visible on top of the sidebar menu.
Parameter Description
Icon Module public icon. The module icon will be visible on the UI Application sidebar.
2. Click Save.
For more information on configuring the general settings for the model-driven UI module see, Configuring General
Settings for the Model-Driven UI Module.
UI Screen Details
1. With the Module selected in the sidebar pane, click the plus icon, select Screen and click Add.
2. Enter the following information:
Parameter Description
ID The identifier assigned to the screen. Once the screen is created, the ID value cannot be
modified.
Parameter Description
Header The resource translation key for the UI screen title. If a translation is required, enter a valid
resource translation key. The resource translation key must be present within a resource file,
which must be created as described at page Localizing Custom UI Apps and UI Framework
Resources. If present, Title will not be considered.
Params The array of parameters that can be passed in input to the screen.
Securable The UI Screen will be defined as a securable object and will accessible only by authorized users
(via user roles).
Layout The template you want to assign to the screen (see examples below):
• Master, to display the entity record/s, which are retrieved from the Live database, on a
single pane, either in a grid view or in a tile view.
• Master-Details, to display entity records, which are retrieved from the Live database, on
two panes: the pane on the left (Master) displays the list of the records for a specified entity
type, and the pane on the right (Details) displays the details for the entity record you
selected in the Master pane.
• Custom, to insert an already developed custom screen in either of the following ways:
• (In Advanced Setting Enabled mode) By default, the Auto Generate State option
will be selected. Leave it selected and enter the following information, if you want
the model-driven runtime engine to create the UI Router State for your screen:
• Controller, the name of the controller (registered on the same module).
• Template URL, the template file path.
• (In Advanced Setting Enabled mode) Clear the selection from the Auto Generate
State option if you want to create the UI Router State for your screen by yourself. To
do so, you must assign to the custom state the same State Id which is indicated by
the model-driven editor. With this option selected, the model-driven runtime engine
will not generate the state for the screen.
• Master Archived, to display the entity records, which are retrieved from the Archiving
database, on a single pane, either in a grid view or in a tile view.
• Master-Details Archived, to display entity records, which are retrieved from the Archiving
database, on two panes: the pane on the left (Master) displays the list of the records for a
specified entity type, and the pane on the right (Details) displays the details for the entity
record you selected in the Master pane.
Parameter Description
Help (In Advanced Setting Enabled mode) The title of Documentation Center page to be linked as
contextual help.
Master example
Master-Details example
In the above example page, 1 indicates the Master screen and 2 indicates the Detail screen.
For each UI Content, you must specify an entity and, in addition, either the outcome of an OData query involving
one or more related entities, or the result of a Reading Function.
For each entity to be represented, you must specify the properties that are visible through Content Fields.
According to the layout specified in the screen configuration, you can do the following:
• For the Master screen layout, you must specify only one content.
• For the Master-Details screen layout, you must specify at least two contents (one for the Master and one for the
Details).
• Only if you have chosen a Master-Details screen layout, you can select the Audit Trail content behavior to
display audit trail information for the entity selected in the Master content.
• If you have chosen either the Master Archived or the Master-Details Archived screen layout, you can only
configure a subset of functionalities because the archiving endpoint (used to expose the Archiving data source
data) allows you to perform only reading operations.
Procedure
1. With a screen selected in the sidebar pane, click , select Content and click Add.
2. Only for Master-Details view screen types, select the content type you are configuring:
either Master or Details.
3. According to the Behavior you specify (see the reference table below), not all tabs will be available:
• For One or Many, enter the required information starting from the Details tab and then move to the
other tabs.
• For Audit Trail, enter only ID and Title as explained below.
Title The title that is displayed for the Details contents as tab titles (for the Master content, it will
not display any title).
If a translation is required, enter a valid resource translation key. The resource translation key
must be present within a resource file, which must be created as described at page Localizing
Custom UI Apps and UI Framework Resources.
Use Custom If selected, you can use a custom content as the Detail Content of a Master-Detail UI Screen
Behavior with the template.
See Configuring a Custom Content for a Master-Details UI Screen for reference.
The Behavior configuration will be hidden. Also, all other tabs are disabled except for
the Details Tab.
Parameter Description
The Audit Trail behavior is not available for Master Archived and Master-Details
Archived screen layouts.
Entity If selected, it allows you to browse the entity exposed either by the Public Object Model App/
Extension App or by the archiving endpoint (see Executing Queries on Archived Entities).
Whenever a DB view or a Third Party Entity view is selected from the Entity Picker, you
should choose a root entity to Export and Edit Segregation Tags. If root entity is not
configured you will not see the Enable Edit Tags and Enable Export check box in the
General Setting tab.
Facets (Only on Entity selected) It allows you to browse the facets associated to the selected Entity
and add them. Multiple facets can be added. Click on Add Item to add a facet and specify the
following:
• Facet, select the facet you want from the list of available Facets of the Entity.
• Alias, provide an alias name for the facet selected which will be used as reference for field
names. For example, if the Facet Alias is given as FacetAlias1 and the fields of the facets
will be represented as FacetAlais1.Field in the Fields Tab and the same field can be used
to configure in General Settings, Tile Settings and so on.
See Example for Configuring Facets in Contents.
Facet and Facet Aliases configured has to be unique. A same facet cannot be added
more than once.
Parameter Description
Reading If selected, it allows you to browse the Reading Function(s) exposed by the Public Object Model
Function App/Extension App.
By configuring the field Root Entity, you will select the entity to be used as reference one for
proper manage Segregation Tag and Export Data Functionalities at runtime.
This option is not displayed for Master Archived and Master-Details Archived screen
layouts.
When a Reading Function is selected, you should configure a root entity. If root entity
is not configured you will not see the Enable Edit Tags and Enable Export check box
in the General Setting Tab.
Params Specifies the input parameters to be passed to the Reading Function. The input parameters are
populated on Reading Function selection.
Input Parameters
{
"ConstantString":"'DefaultCounter'", // constant string
parameter
"ConstantNumber":
1000, // constant number parameter
"ConstantBool": true, // constant boolean
parameter
"CounterId":"contents.Master.selectedItem.Id" //contextual
expression
}
oDataQuery Specifies a query (via oData or via a dedicated query editor), in order to set filtering criteria.
The syntax must be specified starting from the dollar sign, as in the following example:
$filter=NId eq {{contents.WorkOrdersDetails.selectedItem.NId}}
Disable When If selected, it disables the content tab if the condition is satisfied and the condition is either an
Expression or a Function. See Contents and Expressions.
This option is available only for Detail contents of Master-Details screen.
If a condition is configured here to disable the first Detail content, at runtime this
content will not be disabled since a first active tab of a tab set cannot be disabled.
Behavior Screen
One
Many
Audit Trail
A field named Id is mandatory to be present for the entity or reading function selected in Details tab
configuration. This is required for supporting drill-down and unique content item selection capabilities in
the model-driven runtime.
Parameter Description
Name Unique internal identifier, to be used when configuring an expression and you
need to retrieve the field data. If a Facet is included, then properties related to
Facet will be represented as FacetAlias.FieldName.
Parameter Description
Label Property display name, both for tiles and for grids.
If a translation is required, enter a valid resource translation key. The resource
translation key must be present within a resource file, which must be created
as described at page Localizing Custom UI Apps and UI Framework Resources.
Group (Optional and enabled only for content of multiplicity:one) The group to
which the field belongs to (see Configuring General Settings for the Model-
Driven UI Module).
The grouped fields will be rendered together in an accordion (For more
information see, Example of Configuring Groups for Content Fields).
Data Use Select the check box, if you want the data retrieval for your itemCollectionViewer to be
Settings Serve server-side. By default, it is set to client side. If the Enable Pagination option is not
r Side selected, the data is fetched from the server as you scroll down.
Enabl Select the check box, if you want to select multiple content items in the runtime. Select
e all option will be available in the runtime for View Mode of the Grid only. (See Example of
Multi Configuring Multi-Select Capabilities in Contents)
Select
ion
This will be available only for contents of Behavior: Many and will be
unavailable for Master content of Master-Details screens.
When selecting the Enable Multi Selection, the Show When of the action buttons
must be configured by writing an expression to hide/show the button depending
on the selection of multiple items. See Contents and Expressions.
In the Grid mode, if the options Use Server Side and Enable Pagination are
enabled, only the items selected in the first page remains selected on exit of an
action.
When a Reading Function is selected, you should configure a root entity. If root
entity is not configured you will not see the Enable Export check box in the
General Setting Tab.
When a DB view or Third Party Entity is selected, you should configure a root
entity. If root entity is not configured you will not see the Enable Export check
box in the General Setting Tab.
Enabl Select the check box, if you want the pager to be available for your itemCollectionViewer.
e If this option is not selected, a scrollbar is displayed to browse the available items.
Pagin
ation
Page (Only in Advanced Settings Enabled mode) If you have selected the Enable Pagination
Size option, you must configure the page size of the itemCollectionViewer by specifying the
number of items per page (e.g. If the page size is 25, then 25 items per page is shown in
your itemCollectionViewer). This will not be available if the content is a Master of a
Master-Details screen since the itemCollectionViewer is rendered in compact mode and a
scrollbar is available to browse the other available items.
Display Mode The content display mode (Tile only, Grid only, Tile and Grid).
Settings
Defau (Only in Advanced Settings Enabled mode) Allows you to select a default view of an
lt itemCollectionViewer if the selected Mode is Tile and Grid. By default, Grid is selected.
View
Print It is a checkbox for enabling the ICV print button on runtime. If Grid only, Tile and Grid
Enabl Mode is selected this option for print capability will be displayed. Print capability is only
e available for Grid and not for Tile Mode.
File Value of this field will be prefix of the downloaded file. This field is visible only when the
Name print field is enabled.
Separ Value of this field will be used as column separator for the downloaded file. This field is
ator visible only when the print field is enabled.
Field Quick If you want to set the selected property as a search key in the Quick Search.
Settings Searc
At runtime, the Quick Search is a text box where you can enter a search string (applied
h
only to the properties defined as Quick Search relevant).
Quick (Only in Advanced Settings Enabled mode) Enter, if you want to display a custom place
Searc holder for the Quick Search text box at the runtime.
h
Place
holde
r
Data If you want to display the data segregation tags associated with the selected entity.
Segre
An example is provided to show data segregation tags.
gation
Tag
Enabl Select, If you want to enable the tags manager button for the itemCollectionViewer.
e Edit
This option is not available for Master Archived and Master-Details Archived screen
Tags
layouts.
When Reading Function is selected, you must configure a root entity. If root entity is not
configured you will not see the Enable Edit Tags check box.
When a DB view or Third Party Entity is selected, you must configure a root entity. If root
entity is not configured you will not see the Enable Edit Tags check box.
Group If you want to make the property visible in the Groupable drop down list box.
able
At runtime, the Groupable drop down list box contains the entity properties, by which
you can group the results.
Sorta If you want to make the property visible in Sortable drop down list box.
ble
At runtime, the Sortable drop down list box allows you to select the entity property, by
which you want to sort the results.
Breadcr Bread (Only in Advanced Settings Enabled mode and for Master Contents) If you select a
umb crumb content field, the value of the content field is displayed as the breadcrumb title in the
Settings Title runtime.
At runtime, the last element of the breadcrumb is displayed based on the selected object
in the master-details screen.
Use Select the check box, if you want to display the screen title also in the breadcrumb.
Scree
At runtime, the configured breadcrumb title is displayed next to the screen title.
n Title
If the breadcrumb title is not configured then, by default the screen title is
displayed as the breadcrumb.
Title If you select an entity property, this property is displayed as tile title.
Descriptio If you select an entity property, this property is displayed as descriptive second row of the tile.
n
Property You can add other properties to be displayed on the tile by clicking on Add Item and selecting the
Fields entity property. The tile displays maximum of four properties at a time.
The Visibility of each property can be defined by writing an Expression or a Function. See
Contents and Expressions.
It is possible to add a maximum of eight properties.
Enable Cell If set to true, all the Property Fields configured is shown irrespective of the tile size.
If set to false, the number of properties shown is dependent on the tile size.
Parameter Description
Indicators An indicator is used to indicate few statuses of an entity instance. For example, if an entity
instance's status is made as Frozen, then indicators are used to pictorially represent that this
particular instance is frozen.
If you want to configure the indicator settings of a tile, specify the following:
• Icon
Library: The SVG icon to be displayed.
Custom: The relative path for using your own SVG icon (added in the User Interface project
of the Functional Block Solution) must be specified as below:
Siemens.SimaticIT.Material/images/custom.svg
Here Siemens.SimaticIT.Material is the Functional Block Solution name.
• Visibility, the condition on which the indicator must be visible. This property can be set to an
expression string or a function that is evaluated in the context of each tile. See Contents and
Expressions.
tileContent.IsFrozen
Parameter Description
Command If you want to configure the command settings of a tile, specify the following:
s
Any changes to the commands will synchronize with Grid command configured in Grid
Settings and vice versa.
Any changes to the commands will synchronize with Drill Down Action with
Synchronize with Tile/Grid Command enabled and vice versa.
See an example for configuring data drill down capabilities.
See Example of Configuring Drill Down based on a Condition.
The Destination Screen menu lists all the screen names in the the app. You can choose
any screen across all the modules in the current app as the Destination Screen.
If more than one destination screen is configured with the same condition, then the
screen encountered at the first in the order of the screens added will be considered for
navigation.
If a single Destination Screen is configured, then in runtime the command will be hidden
in case the user is not authorized to view the screen.
You can personalize the Field Settings preferences if the content Behavior is set to One by doing the following:
Paramete Description
r
To configure indicators, select the check box on the field (i.e. columns) from Selected Columns and you can
personalize the Indicator Settings by doing the following.
Configured column for indicators appears in Indicators section as an accordion. Any changes will
be synchronize with Grid Settings.
Indicator Settings
Paramete Description
r
displayIco Column header icon to be displayed. The icon is displayed only if indicators are configured.
n
Indicators • Icon
Library: SVG icon to be displayed.
Custom: The relative path for using your own SVG icon (added in the User Interface project
of the Functional Block Solution) must be specified as below:
Siemens.SimaticIT.Material/images/custom.svg
Here Siemens.SimaticIT.Material is the Functional Block Solution name.
• Visibility, the condition on which the indicator must be visible. This property can be set to an
expression string or a function that is evaluated in the context of each tile. See Contents and
Expressions.
tileContent.IsFrozen
You can personalize the Command Settings of a grid, if the content Behavior is set to Many by doing the following:
The configured command will be shown in the first selected column of the grid. See an example for
configuring data drill down capabilities.
Any changes to the commands will synchronize with Tile command configured in Tile Settings and vice
versa.
Any changes to the commands will synchronize with Drill Down Action with Synchronize with Tile/Grid
Command enabled and vice versa. See Example of Configuring Drill Down based on a Condition.
Parameter Description
Conditiona Select if you want to configure multiple destination screens based on a condition.
l
If more than one destination screen is configured with the same condition, then the
screen encountered at the first in the order of the screens added will be considered for
navigation.
Params Lists the input parameters configured for the selected Destination Screen. Specify the input
parameters to be passed to the destination screen.
Default (on Conditional selected) Select if you want to make the added destination screen as default.
This means that at runtime this will be considered as the screen to navigate in case of no
condition evaluates to true. It is mandatory to have one default screen configured if Conditional
is selected.
Parameter Description
Condition (on Conditional selected) Enter the condition on which the the destination screen must be
navigated at the runtime. This property can be set to an expression string or a function that is
evaluated in the context of each grid row. This field will be hidden if Default is selected.
General Filterable If you want to enable this field as one of the filter fields.
Settings
Default (Only for Filter Builder) If set to true, the field is by default added to the filter
dialog in an itemCollectionViewer.
Operators (Only for Filter Builder) If you want to configure different operators required for
a field.
Value Pre-Defined If you want to configure the widget to use for the data input in
Settings Values itemCollectionViewer's filter.
• Input Text, if you want to display an input text field.
• List of Values (Manual Entry), if you want to display a drop-down list box
with a list of values. You can enter the values manually by clicking on plus
icon .
• List of Values (Query Result), if you want to display a drop-down list box
with a list of values. You can configure the entity and the following
information to fill the drop down list box with the query result.
• Use Entity Picker, If selected an entity picker will be shown instead
of a drop-down list in the runtime. This option is available only if List
of Values (Query Result) is selected in the Pre-Defined Values.
• Data Source, select the data source to be used to perform the query.
The accepted values are Entity and Reading Function. Entity is
selected by default. You can configure the following additional
parameters:
• Name, the name of the entity/reading function to be retrieved.
• Title, a title for the entity picker dialog at runtime (Available only
when Use Entity Picker is checked).
If a translation is required, enter a valid resource translation key. The
resource translation key must be present within a resource file, which
must be created as described at page Localizing Custom UI Apps and
UI Framework Resources.
• Query, the filter expression for the entity to retrieve the required
record.
• Display Property,the property whose value you want to be shown in
the drop-down list.
• Value Property, the property whose value you want to actually pass
to the action field.
• Configure Entity Picker, click to configure the additional parameters
for an entity picker. For more information on configuring entity picker
see, Entity Picker Configuration section.
While configuring the Value Settings for a Filter Field in the Filter
Settings, properties from facets are not available for configuration if the
User Input Mode is List of Values(Query result).
Min According to the type of field, specifies the minimum number of digits accepted
Length (or for the field value, or the minimum value.
Min)
Max Length According to the type of field, specifies the maximum number of digits accepted
for the field value, or the maximum value.
/^[a-z][a-z0-9_]+$/i
Procedure
If you want to interact with the model-driven runtime context from your custom template, follow the steps below:
1. Listen to the event mdui-context-refreshed inside your controller to get the Master Content's current selected
item.
2. Inject common.services.modelDriven.runtimeService service inside your controller.
3. In the place where you initialize your controller, call the initCustomContent method of the above service.
This returns an object which has the below callback functions:
• getContext, gets the complete UI Screen context
• setContext, updates the Model-Driven Runtime Context with the custom content data.
• getData, gets the data depending on the Entity or Reading Function configured.
4. Inside the controller call these callback functions (see example below).
These steps must be performed only if you still want to use Model-Driven Runtime to make the queries to
fill the custom template data.
In this case, you can select the Entity or Reading function in the Details tab ( see Configuring the Model-
Driven UI Screen Contents).
Otherwise it is up to you to manage loading the data inside your custom template.
For example, refer to the following sample template and controller code :
Sample Template
Sample Controller
(function () {
'use strict';
angular.module('Siemens.OpcenterEX.FN.Defect')
.controller('failureAttachmentsCtrl', ['$rootScope', '$scope', '$q',
'$timeout', 'common.services.modelDriven.runtimeService',
'common.services.runtime.backendService', function ($rootScope, $scope, $q, $timeout,
mdService, backendService) {
var vm = this;
var mdSvcApis = {};
var backend = backendService;
vm.isMasterSelectionChanged = false;
activate();
function activate() {
var contentName = 'Attachments'; //If invalid, then the apis will not
be available.
subscribeToModelDrivenRuntime(contentName);
initDocumentViewerConfig();
}
function findFormat(mimeType) {
if (mimeType == "text/plain")
return "text";
if (mimeType == "image/svg+xml")
return "svg";
if (mimeType == "application/pdf")
return "pdf";
if (mimeType.match(/^image\//))
return "image";
if (mimeType.match(/^video\//))
return "video";
}
function initDocumentViewerConfig() {
vm.data = [
];
vm.categories = [
{
"id": "1",
"label": "Attachment list",
"uploadEnabled": false,
"deleteEnabled": false
}
];
vm.selectTab = function () {
vm.config.selectCategory("1");
};
vm.actions = [
];
vm.config = {
"title": "Documents",
"showFirstDocument": false,
"mode": "display",
"fullScreenMode": "toolbar",
"plugins": [
{
"format": "svg",
"viewer": "sit-vector-viewer"
}
]
};
}
function subscribeToModelDrivenRuntime(contentName) {
//gets the model-driven runtime apis to interact with the context and
data.
mdService.initCustomContent(contentName).then(function (apiList) {
mdSvcApis = apiList; //gets the api list
}, function (error) {
//An error message will be passed in case of invalid custom
contents.
});
}
vm.data[len].format = findFormat(data.value[0].File.type);
vm.data[len].source = data.value[0].File.data;
if (data.value[0].Icon != undefined)
vm.data[len].thumbnail = data.value[0].Icon.data;
setTimeout(function () { vm.isMasterSelectionChanged = false;
}, 50);
vm.isMasterSelectionChanged = true;
} else {
self.viewerData = [];
}
defer.resolve();
}, backend.backendError);
return defer.promise;
}
function loadFailureAttachments(data) {
var defer = $q.defer();
var promises = [];
for (var ndx = 0; ndx < data.length; ndx++) {
var fileId = data[ndx].FileAttachment_Id_Id;
var iconId = data[ndx].IconAttachment_Id_Id;
promises.push(loadFile(fileId, iconId));
}
$q.all(promises).then(function () {
defer.resolve();
});
return defer.promise;
}
function loadAttachments() {
var options = null;
vm.data = [];
options = "$filter=Failures/any(w: w/Id eq " + vm.selectedMaster.Id +
")";
mdSvcApis.getData(options).then(function (data) {
loadFailureAttachments(data).then(function () {
vm.isMasterSelectionChanged = false;
$timeout(function () { vm.isMasterSelectionChanged = true; },
100);
})
}, function (error) {
//An error message will be passed in case where entity or reading
function is not configured, but still getData api is called
});
}
//an event triggered once the model-driven context changes
var mduiContextRefreshedListener = $rootScope.$on('mdui-context-
refreshed', function (event, params) {
var eventType = params.event;
function getContext() {
mdSvcApis.getContext(); //gets the complete model-driven UI Screen
runtime context
}
function selectionChanged(item) {
mdSvcApis.setContext(item); //updates the model-driven runtime
context with the current selected item
}
Result
The custom content configured will be available in the details tab of a Master-Details UI Screen as shown in the
example below.
Procedure
1. With a content selected in the sidebar pane, click the plus icon , select Action and click Add.
2. Enter the required information starting from the Details tab and then moving to the other tabs described below.
Paramete Description
r
ID Action identifier.
Group Specifies the group to which the action belongs (see Configuring General Settings for the Model-
Driven UI Module for reference).
Paramete Description
r
Params (Only in Advanced Settings Enabled mode) A list of parameters to be passed to the action, so
that they can be referenced from expressions within action fields.
For example, if an action requires an item to be selected from the current content, the ID of this
item is typically passed as parameter to the action in order to retrieve the data of the currently-
selected item via a separate query.
Show You can configure simple expressions to show the action button if a certain condition is satisfied.
When Such conditions will be evaluated at run time within the context of the current screen and can be
expressed in either of the following ways:
• Expression, to enter a condition.
• Function, to enter the body of a javascript function.
For more information, see Contents and Expressions.
Type Description
• Size, select the size of the side panel. Allowed sizes are Large and Small.
• View Mode (Only if Size is set to Small), clear the Modal check box if you want to
open the side panel without blocking the screen, otherwise you can clear this option
and the panel will be opened in a non modal view. By default, the Modal option is
selected (see examples below).
• Submit Title, the label to be displayed on the button that saves the given data in the
side panel. If the field is empty, by default Submit is displayed.
• Header Title, to display the configured side panel title. By default, the label is Action
title field if the field is empty.
• Header Title Field, to display the contextual information for the selected item.
• Cancel Title, the label to be displayed on the button that cancels or closes the side
panel without any changes. If the field is empty, by default Cancel is displayed.
• Close by clicking outside, the behavior of the side panel when a user clicks outside
the panel area. It can be one of the following options:
• Do not close.
• Close with confirmation.
• Close without confirmation.
Do not close is the option selected by default.
• (Only in Advanced Settings Enabled mode) On Exit, to specify which item you want to
automatically select and which content you want to automatically refresh after the action
completion, as follows:
• Click on Add Item to add an On Exit item.
Type Description
• Select Content Id from the drop down list that you want to refresh after the action
completion (belonging either to the Master content or to the Details content,
according to the context where the action is configured).
• In the Selection Key edit box, type the command output parameter to be used to set
the guid of the entity record that must be automatically selected (belonging either to
the Master content or to the Details content, according to the context where the
action is configured);
• Behavior - Use Custom Blueprint, if you want a custom side panel with your own input
form for your action. With this option selected, all the configurations of the Behavior tab
will be hidden and the Fields tab will be disabled. See Configuring Custom Action Types for
Execute Command and View Actions.
• Use In-Canvas Behavior, if you want a custom In-Canvas mode with your own input from
your action. This option is visible once you select the Use Custom Blueprint.
See Configuring Custom Action with In-Canvas Mode for Execute Command and View
Actions.
• Display Mode, by default the mode is selected as side panel, but you will also have an In-
Canvas option. The following option is available when you select the mode as In-Canvas:
• No of columns
If Action is configured as Side Panel in the Base App, you will have an option
to change it as In-Canvas mode in the extension app. In such scenario if
multiple extension installed for Base App, preference is given to In-Canvas.
When Display Mode is selected as In-Canvas, you will not see the Size, View
Mode and Close by clicking outside options.
When In-Canvas Panel for Execute command action is open and the user
tries to navigate away using sidebar, user will view a warning pop-up. If click
Continue, user will be navigated to another screen. If user click cancel, then
everything will be retained.
When In-Canvas Panel for Execute command action is open and the user
tries to refresh or reload the browser, user will view a confirmation pop-up.
If click Reload, user will be navigated to parent screen. If user click cancel,
then everything will be retained.
Type Description
Execute To invoke a public command without user interaction, by displaying a confirmation message
command overlay.
with
confirmatio
The Execute command with confirmation action type is not available for Master
n Archived and Master-Details Archived screen layouts.
• (Only in Advanced Settings Enabled mode) On Exit, to specify which item you want to
automatically select and which content you want to automatically refresh after the action
completion, as follows:
• Click on Add Item to add an On Exit item.
• Select Content Id from the drop down list that you want to refresh after the action
completion (belonging either to the Master content or to the Details content,
according to the context where the action is configured).
• In the Selection Key edit box, type the command output parameter to be used to set
the guid of the entity record that must be automatically selected (belonging either to
the Master content or to the Details content, according to the context where the
action is configured);
To retrieve a property of the entity, for which you are invoking the selected command, and
display its value inside the message overlay, properly modify the following example to be used
in the Confirmation edit box:
Type Description
View To open a pane with a read-only view of the record. For this action type you must specify:
• Entity, the entity to be retrieved.
• Query, the query used to refine the retrieved data.
• (Only in Advanced Settings Enabled mode) In Side Panel Behavior, select the following
configurations for your side panel.
• Size, select the size of the side panel. Allowed sizes are Large and Small.
• View Mode (Only if Size is set to Small), clear the Modal check box if you want to
open the side panel without blocking the screen, otherwise you can clear this option
and the panel will be opened in a non modal view. By default, the Modal option is
selected (see examples below).
• Header Title, to display the configured side panel title. By default, the label is Action
title field if the field is empty.
• Header Title Field, to display the contextual information for the selected item.
• Cancel Title, the label to be displayed on the button that cancels or closes the side
panel without any changes. If the field is empty, by default Cancel is displayed.
• Close by clicking outside, the behavior of the side panel when you click outside the
side panel area. Select one of the following options:
• Do not close
• Close with confirmation
• Close without confirmation
Do not close is selected by default.
• Behavior - Use Custom Blueprint, if you want a custom side panel with your own input
form for your action. With this option selected, all the configurations of the Behavior tab
will be hidden and the Fields tab will be disabled. See Configuring Custom Action Types for
Execute Command and View Actions.
• Use In-Canvas Behavior, if you want a custom In-Canvas mode with your own input from
your action. This option is visible once you select the Use Custom
Blueprint. See Configuring Custom Action with In-Canvas Mode for Execute Command and
View Actions.
Facets are not available for configuring any Action of type View
• Display Mode, by default the mode is selected as side panel, but you will also have an In-
Canvas option. The following option is available when you select the mode as In-Canvas:
• No of columns
You can select the number of columns between 2 to 7, and the width required for each
column is 328 pixels. The preference is given to the highest number of columns.
Type Description
When Display Mode is selected as In-Canvas, you will not see the Size, View Mode and
Close by clicking outside options.
Navigate To open a UI screen. For this action type you must specify:
• Destination Screen, select the destination screen to which you want to navigate.
• Params, specify the list of the input parameters configured for the selected destination
screen. These input parameters will be passed to the destination screen.
Input Parameters
{
"ConstantString":"'DefaultCounter'", // constant string
parameter
"ConstantNumber":
1000, // constant number parameter
"ConstantBool": true, // constant boolean
parameter
"CounterId":"contents.Master.selectedItem.Id" // contextual
expression
}
• The Destination Screen menu lists all the screen names in the the app. You can
choose any screen across all the modules in the current app as the Destination
Screen.
• If the Source screen and destination screen are same, then the parameters can be
modified. These parameters can be used to filter the data.
• At runtime, if a user is not authorized to view the selected screen, the action will be
hidden.
The functionality also supports navigation among UI screens that belong to different App/
Extension Apps. In this case, Destination Screen and Params must be manually entered.
Type Description
A field name Id is required for supporting drill down and unique content item selection
capabilities in the model-driven runtime. See an example for configuring data drill
down capabilities.
• Synchronize with Tile/Grid command, select in order to synchronize the current action
with the drill down commands configured for the parent content's Tile/Grid. The drill down
configuration will be in sync with Tile/Grid commands and vice versa.
This will be available only for actions of content of multiplicity: many. In case of more
than one drill-down actions, this selection will be mutually exclusive. The action for
which synchronization enabled will be in sync with Tile/Grid commands and vice
versa.
Input Parameters
{
"ConstantString":"'DefaultCounter'", // constant string
parameter
"ConstantNumber":
1000, // constant number parameter
"ConstantBool": true, // constant boolean
parameter
"CounterId":"contents.Master.selectedItem.Id" // contextual
expression
"NId":"currentContentItem.NId" // contextual
expression
}
• Default, (on Conditional selected) select if you want to make the added destination screen
as default. This means that at runtime this will be considered as the screen to navigate in
case of no condition evaluates to true. It is mandatory to have one default screen configured
if Conditional is selected.
• Condition, (on Conditional selected) enter the condition on which the the destination
screen must be navigated at the runtime. This property can be set to an expression string or
a function that is evaluated in the context of each tile/grid. This field will be hidden if
Default is selected. See Contents and Expressions.
Type Description
The Destination Screen menu lists all the screen names in the the app. You can choose
any screen across all the modules in the current app as the Destination Screen.
In runtime, if the single Destination Screen selected is not authorized for an user to
view, then the action will be hidden.
It also supports data drill down among UI screen belonging to different App/Extension App,
But Destination Screen, Conditional and Params has to be entered manually.
General Name Unique internal identifier, to be used when configuring an expression and you need to
Fields retrieve the field data.
Group Select a group from the previously defined groups (see Modifying the Model-Driven UI
Module Information) if you want the field to be part of the selected group in the side-
panel.
Default Sets the value of the field based on the condition configured and the condition is
either Expression or Function. See Contents and Expressions.
The condition will be evaluated only once and will not be evaluated after each change
in the fields inside the side panel.
The Default field configuration will have no impact on the file uploader.
Hidden If selected, the parameter is not shown in the input form. To fill in its value, you can
specify an expression or a function.
Read- If selected, the parameter is visible in read-only mode in the input form.
Only
User Input Field Shows the type of the parameter. This will be editable only for newly added fields.
Mode Type
In the model-driven runtime, if the field of the type DateTimeOffset is not filled or is
Settings
emptied afterwards in the form opened in the side panel, the value that is sent to the
command input is null.
User To configure the widget that is displayed and used in action input form. This will be
Input automatically selected based on the Field Type (see Action Field Type Dependent User
Mode Input Modes table below).
• Input Text, if you want an input text field.
• Input Text Multiline, if you want an input text area with support of multiple lines.
If you want to populate the value of the Input Text or Input Text Multiline field
at runtime whenever an expression value changes, select Reload Data on change
and configure the following additional parameters:
• Entity, the entity type to be retrieved.
• Title, a title for the entity picker dialog at runtime (Available only
when Use Entity Picker is checked).
If a translation is required, enter a valid resource translation key. The
resource translation key must be present within a resource file, which
must be created as described at page Localizing Custom UI Apps and UI
Framework Resources.
• Query, the filter expression to retrieve the required record.
• Selection Property, the entity property from which you want to populate
the value of the field.
• List of Values (Manual entry), if you want a drop-down list with a list of values.
You can enter the values manually by clicking Add Item.
• List of Values (Query Result), if you want a drop-down list with a list of queried
values.
• Data Source, select the data source to be used to perform the query. The
accepted values are Entity and Reading Function. Entity is selected by
default. You can configure the following additional parameters:
• Name, the name of the entity/reading function to be retrieved.
• Query, the filter expression for the entity to retrieve the required record.
• Params, the input parameters for the selected reading function. The null
value validations for the input params have to be handled inside the
reading function implementation.
• Display Property, the property whose value you want to be shown in the
drop-down list. This will not be shown if the field is made as Hidden.
• Value Property, the property whose value you want to actually pass to the
action field. This will not be shown if the field is made as Hidden.
If you want to select an item of this drop-down list at runtime whenever an
expression value changes (an example is provided), based on an another
entity, then select Reload Data on change and Preselect Value and
configure the following additional parameters of Preselect Entity
Reference (this option will not be shown if the field is configured as
Hidden or if the Data Source is Reading Function):
• Entity, the entity type to be retrieved.
• Query, the filter expression to retrieve the required record.
• Base Value Property, the base entity property to be used
for selecting an item in the drop-down list.
Use (Only in Advanced Settings Enabled mode) If selected, an entity picker will be shown
Entity instead of a drop-down list in the runtime. This option is available only if List of
Picker Values (Query Result) is selected in the User Input Mode and you can select multiple
entity properties as Value property of the Entity Reference. Click Configure Entity
Picker to configure the additional parameters.
See Entity Picker Configuration section below.
Enable (Only in Advanced Settings Enabled mode) If selected, you will be able to select
Multi multiple items in a drop-down list in the runtime. This option is available only if List
Select of Values (Query Result) is selected in the User Input Mode.
If Use Entity Picker is selected, Enable Multi Select check box will be
disabled and vice versa.
The selected items in the drop down will be sent as an array consisting the values of
the selected Value property of the Entity Reference to the command. (See Example
of Execute-Command Action with a Multi-Select Query Field for an example)
Format (Only in Advanced Settings Enabled mode) If you have set the Field Type to
DateTime, select the DateTime format to be displayed at runtime.
Available options are Short and Medium. By default, Medium will be selected.
Distinct (Only in Advanced Settings Enabled mode) If selected, the system will exclude from
the values that are displayed in the drop-down list any duplicated items returned by
the query response. This will not be shown if the field is made as Hidden.
Reload (Only in Advanced Settings Enabled mode) To re-execute the query when an
Data on expression value changes (for example, in a cascading drop-down list box, which
change must be refreshed according to the previous selection).
Pre (Only in Advanced Settings Enabled mode) To select an item in a drop-down list. By
Select default, first item of a drop-down list will be selected. If the Pre Select Entity
Value Reference is configured, then selection will be based on the query execution. This will
not be shown if the field is made as Hidden.
Validati To configure the validation of the input field in one of the following ways:
on
• Required, if selected, the field value cannot be empty.
• Min Length (or Min), according to the User Input Mode selected, specifies the
minimum number of digits accepted for the field value, or the minimum value.
• Max Length (or Max), according to the User Input Mode selected, specifies the
maximum number of digits accepted for the field value, or the maximum value.
• Min size, for the User Input Mode as File Uploader, specifies the minimum size of
the file that can be uploaded (for example 200 KB).
• Max size, for the User Input Mode as File Uploader, specifies the maximum size
of the file that can be uploaded (for example 2 MB).
• Pattern, uses a valid regular expression to validate the field.
For example, the following regular expression validates a string starting with a letter
and followed by one or more letters, numbers, or underscore:
/^[a-z][a-z0-9_]+$/i
• Custom, to use a custom function body to validate the value of the field. In the
custom function body you can use the following parameters:
Parameter Description
action.fields.fieldName
Binding Parame The name of the command parameter to which you want to pass the value.
ter
Value Sets the value of the field based on the condition configured and the condition is
either Expression or Function. See Contents and Expressions.
The condition will be evaluated after each change in the fields inside the side panel.
Clear/ Disable If selected, disables the field if the condition is satisfied and the condition is either an
Disable When Expression or a Function. See Contents and Expressions.
When
This will not be shown if the field is made as Hidden.
Clear If selected, clears the current value of the field if the condition is satisfied and the
When condition is either Expression or Function. See Contents and Expressions.
This will not be shown if the field is made as Hidden.
Fields Based on the selected entity/ reading function, the properties will be
automatically loaded into the Entity Picker. You can decide to add,
modify or delete Fields
General Settings • Placeholder, to configure a short hint that describes the expected
value of an entity picker.
• Searchable Field, select the property to be used as search key in
the Quick Search.
• Sortable Fields, select the properties to be visible in Sortable drop
down list box of the grid shown when the entity picker is opened.
• Use Server Side, set the data retrieval for your grid to be server-
side. By default, it will be set to client side.
• Enable Pagination, select this check box if you want the pager to be
available for your grid. If this option is not selected, a scrollbar is
displayed to browse the available items.
Grid Settings You can customize the grid preferences by doing the following:
• showing or hiding fields (i.e. columns) by selecting the required field
and then clicking the Add to grid / Remove button.
• setting the field order in the grid, by selecting the item to be moved
and then clicking the arrow buttons on the right.
Tab Description
Filter Settings Select the Enable Filter option if you want to enable the filter for the
grid that will be shown when the entity picker is opened. See Filter
Settings Configuration for an Entity Picker of an Action field section
below.
Parameter Description
Property Unique internal identifier, to be used when configuring an expression and you need to retrieve
the field data.
Type Shows the type of the parameter. This is editable for fields.
Group Select one of the previously defined groups (see Modifying the Model-Driven UI Module
Information) if you want the field to be part of the selected group in the side panel.
General Filterable If you want to enable this field as one of the filter fields.
Settings
Default If set to true, the field is by default added to the filter dialog in an
itemCollectionViewer.
Value Pre-Defined If you want to configure the widget to use for the data input in
Settings Values itemCollectionViewer's filter.
• Input Text, if you want to display an input text field.
• List of Values (Manual Entry), if you want to display a drop-down list box
with a list of values. You can enter the values manually by clicking on plus
icon .
• List of Values (Query Result), if you want to display a drop-down list box
with a list of values. You can configure the entity and the related
information to fill the drop down list box with the query result.
Min Length (or According to the type of field, specifies the minimum number of digits
Min) accepted for the field value, or the minimum value.
Max Length According to the type of field, specifies the maximum number of digits
accepted for the field value, or the maximum value.
/^[a-z][a-z0-9_]+$/i
Custom Provision for the user to customize a validation (reserved for future use).
String Input Text Input Text, List of values (Manual entry), List
of Values (Query Result)
DateTimeOffset Date Time Picker Date Time Picker, List of values (Manual
entry), List of Values (Query Result)
Parameter Value List of Values (Query Result) List of Values (Query Result)
2.2.4.3.1.9 Configuring Custom Action Types for Execute Command and View
Actions
You can configure a custom action for the Execute Command or View action types by specifying the following
information:
• Controller, the name of the controller (registered on the same module).
• Template URL, the template file path to be used.
You can only use a side panel inside this template for the Model-Driven runtime UI Module not to have
inconsistencies.
For this reason, the side panel is available only for actions of type Execute Command or View.
Prerequisites
If you want the onExit configuration to work in your custom action, follow the steps below:
1. Inject common.services.modelDriven.runtimeService service inside your controller.
2. In the place where you initialize your controller, call the initCustomAction method of the above service.
This returns an object which has onExit as callback function.
3. In the command execution response of your controller, call the callback function you received at step 2 with or
without parameters (see example below).
These steps must be performed only if you want the onExit behavior to be supported at runtime.
Otherwise it is up to you to close the side panel and reload the state on the completion of the command
execution.
For example, refer to the following sample controller and template code:
angular.module('Siemens.SimaticIT.Reference.StateMachine')
.controller('MyCtrl',
[ '$state',
'common.base',
'common.services.modelDriven.runtimeService',
function (
$state,
base,
mdRuntimeSvc) {
var self = this;
var sidePanelManager = base.services.sidePanel.service;
self.onCustomActionComplete = null;
self.validInputs = true;
self.save = save;
self.cancel = cancel;
var action = {
title: "My title",
shortTitle: "My short title"
}
self.sidepanelConfig = {
title: action.title,
messages: [{
type: 'warning',
text: ''
}],
actionButtons: [
{
label: action.shortTitle || "Submit",
onClick: self.save,
enabled: self.validInputs,
visible: true
},
{
label: "Cancel",
onClick: self.cancel,
enabled: true,
visible: true
}
],
closeButton: {
showClose: true,
tooltip: 'Close Sidepanel',
onClick: self.cancel
}
};
init();
function save() {
sidePanelManager.close();
var response = backendService.saveValue(self); // executes
command and returns an id as the response
if (typeof self.onCustomActionComplete === 'function') {
self.onCustomActionComplete(response.id); // callback
function received from model-driven runtime to be called on action complete
//callback function called in this format in order to refresh
and select both master and detail content on action complete
var refreshContentsId = { 'Master':response.id, 'Detail':resp
onse.detailId }
self.onCustomActionComplete(refreshContentsId);
}
}
function cancel() {
sidePanelManager.close();
$state.go('^');
}
function init() {
var initObj = mdRuntimeSvc.initCustomAction(); //gets the
callback function
self.onCustomActionComplete = initObj && initObj.onExit ?
initObj.onExit : null;
sidePanelManager.setTitle(action.title);
sidePanelManager.open({mode: 'e', size: 'small'}); //show the
small side panel in modal mode
//sidePanelManager.open({mode: 'p', size: 'small'}); //show the
small side panel in non-modal mode
//sidePanelManager.open({mode: 'e', size: 'large'}); //show the
large side panel in modal mode
}
}]);
If the user is inside Custom In-Canvas Panel and refresh the page, then by default user will be navigated to
the parent screen.
Prerequisites
If you want the onExit configuration to work in your custom action, follow the steps below:
1. Inject common.services.modelDriven.runtimeService service inside your controller.
2. In the place where you initialize your controller, call the initCustomAction method of the above service.
This returns an object which has onExit as callback function.
3. In the command execution response of your controller, call the callback function you received at step 2 with or
without parameters (see example below)
If you want to show warning when Navigating away form the In-Canvas Action Screen configuration to work in your
custom action, follow the steps below:
1. Inject common.widget.messageOverlay.service service inside your controller.
2. In the place where you initialize your controller, call the initCustomOverlayOnStateChange method of the
above service.
3. Call setIsViewAction methodset as false (By default it will be true, it means your overlay will not be displayed).
4. Create an array of overlay button and write onClick functionality for them.
If a user wants to display a confirmation browser pop-up on refresh, then the below listed steps to be followed:
1. User has to inject $scope in the controller.
2. In the initialization of the controller, user needs to add window.onbeforeunload()
3. On destroy of the controller, user must add window.onbeforeunload = null;
If you want to configure the Title of the screen and Breadcrumb In-Canvas then refer to the example below.
(function () {
'use strict';
var app = angular.module('Siemens.SimaticIT.Material.MaterialEngineering');
function init() {
onClickCallback: function () {
//Hiding overlay on click of cancel no data will
be modify and url will be same
warning.hideOverlay();
}
},
{
id: "ok",
displayName: $translate.instant('common.ok'),
onClickCallback: okButtonclick
}
];
warning.setOverlay($translate.instant('inCanvas.overlay.message'),
self.overlayButtons);
function okButtonclick() {
warning.hideOverlay();
//For updating breadcrumb if configured
breadcrumbService.setBreadcrumbChain(breadcrumbService.getBreadcrumbChain().pop())
;
// for updating url when you leave the canvas panel
warning.setOverlayDisplay(false);
//For new screens state and params
$state.go(warning.getState(), warning.getParam(),
{ reload: true });
}
SwacUiModuleManager.contextServicePromise.promise.then(function (service) {
service.updatePartialCtx('location.titles', { headerTitle:
'Dynamic Title Here' });
});
}
breadcrumbService.setBreadcrumbChain(breadcrumbTitle); // Setting
the new item to Breadcrumb chain
self.breadcrumbInCanvasOptions = {
onClick: function (breadcrumbItem) {
breadcrumbTitle.pop();
breadcrumbService.setBreadcrumbChain(breadcrumbTitle);
self.mdViewCtrl = new mdRuntimeSvc.ModelViewCtrl(stateId,
{ params: {} }, $stateParams);
self.mdViewCtrl.goToPreviousLevel(breadcrumbItem);
}
}
// Providing breadcrumb options for 'sit-mdui-breadcrumb' widget.
}
function save() {
var id = backendService.saveValue(self); // executes command and
returns an id as the response
if (typeof self.onCustomActionComplete === 'function') {
self.onCustomActionComplete(id); // callback function
received from model-driven runtime to be called on action complete
closeAction();
}
}
function closeAction() {
breadcrumbTitle.pop();
$state.go('^');
}
$scope.$on("$destroy", function () {
window.onbeforeunload = null;
});
init();
}
]);
})();
The system displays the hints only for the context of entities, such as contents, actions or fields, for which
the related configuration screens have been created, configured and saved in the Model-Driven UI Editor.
Variable Description
activeConten In a Master-Details template, it specifies the Details content that is currently active among
t several contents (other than the Master content which is always active).
currentConte It specifies the fields of the current content's grid row or tile item through which the drill down
ntItem is performed.
selectedItem Allows you to access the fields of the selected content, except for the contents of Behavior
One.
selectedItems Allows you to access the list of items selected for the content of Behavior Many.
selectedItems Allows you to access the number of items selected for the content of Behavior Many.
Count
list To get a list of the values of the given property from the selectedItems list.
eval To evaluate the condition of each item and returns true if all the items in the selectedItems
list satisfy the condition, otherwise it returns false.
Variable Description
Expression example
$filter=NId eq {{contents.Master.selectedItem.NId}}
The following example shows an expression, if assigned to a Disable When of a content, then at runtime that
content will be disabled when the Quantity property of the object, which is selected in the Master content, is lower
than 10.
Expression example
contents.Master.selectedItem.Quantity < 10
The following example shows an expression, if assigned to a Disable When of a content, then at runtime that
content will be disabled when the Quantity property of the object, which is shown in the Overview tab of
the content defined as Behavior One, is lower than 10.
Expression example
contents.Overview.Quantity < 10
The following example shows an expression, if assigned to a Disable When of a content, then at runtime that
content will be disabled when the MaterialQuantity property of an extended entity or reading function of an
extension MaterialEntityExtension of content: Overview of Behavior One, is lower than 10.
Expression example
contents.Overview.MaterialEntityExtension.MaterialQuantity < 10
The following example shows an expression, if assigned to a Show When of an action, then in runtime that action
will be shown only when the Quantity property of the object, which is selected in the Master content, is lower than
10 and active content is Overview.
Expression example
Expression example
contents.Master.selectedItemsCount === 1
The following example shows an expression, if assigned to a Show When of an action, then the action in runtime
will be shown only when the selected number of items in the Master content is more than 1.
Expression example
contents.Master.selectedItemsCount > 1
The following example shows an expression, if assigned to a Show When of an action, then the action in runtime
will be shown only when the status of all the selected items in the Master content is equal to 'Ready'and the items
are not hidden.
Expression example
The following example shows an expression, if configured as a Value of an action field, then in runtime the list of
IDs of the selected items in the Master content is sent to the command payload.
Expression example
contents.Master.selectedItems.list("Id")
Expression example
Variable Description
output Specifies the output parameters of a base command used in an extended action.
queryResult Specifies the response for the query of the Entity or Reading Function. It is only applicable
for the extended fields.
The following example shows an expression, if assigned to a Disable When of an action field, then in runtime that
field will be disabled if the action field: Quantity's value is lower than "10".
Expression example
action.fields.Quantity < 10
The following example shows an expression, if assigned to a Disable When of an action field, then in runtime that
field will be disabled if the extended action field of extension: UAPI_Extension from Extension App:
UAPI_Material: Quantity's value is lower than "10".
Expression example
action.UAPI_Material_UAPI_Extension.fields.Quantity < 10
The following example shows an expression, if assigned to a Default of an action field, where the Entity or Reading
Function is queried for pre-filling, then in runtime that field has the default value set as returned from the
configured expression.
Expression example
action.UAPI_Material_UAPI.queryResult.Quantity
The following example shows an expression, if assigned to a Value of an action field, then in runtime that field will
have the value of the output parameter specified once the base command of an extended action executes.
Expression example
baseCommand.output.MaterialId
The following example shows an function body, if assigned to a Default of an action field, then in runtime that field
will have the default value set as returned from the configured function body after opening the sidepanel.
return contents.Master.selectedItem.NId;
The following example shows an function body, if assigned to a Default of an action field which is a
DateTimePicker, then in runtime that field will have the default value set as current date and time after opening
the sidepanel.
In an extended Model-Driven UI Module, you can only add UI screens, UI contents or UI Actions. You cannot
modify or delete any of the existing base module UI screens or UI contents or UI actions.
However, you can both extend an existing Base Module UI Content of Behavior: One, by selecting
additional entities or reading functions for the content, and extend an existing Base Module UI Action of
type: Execute Command, by selecting additional commands for the Action, as described in the workflow
below.
Workflow
1. In the Solution Explorer pane, expand the User Interface project of the Extension App.
2. Right-click the <Prefix>.<AppName>/modules folder and click Extend MDUI Module from Base App. A dialog
box is displayed showing the list of the available Model-Driven UI Modules provided by the Base App.
3. Select the Model-Driven UI Module to be extended (<Prefix>.<AppName>.<ModuleName>). The system creates
a file <Prefix>.<AppName>.<ModuleName>.ext for managing the extensions to be available in your Base
App. You can select one Module at a time. Your extended Model-Driven UI Module name cannot be modified.
4. Open the Model-Driven UI Module Editor. Once it is opened, the editor will show the extended module and its
Base App module's information.
5. Do either of the following:
• Add new UI Screen to your extended module.
• Add new UI Screen Content to your extended module.
• Add new UI Screen Action to your extended module.
6. Extend a base module UI Content of Behavior: One.
To update the BaseApp for an extension App of a Model driven UI module, you must manually change the
baseAppVersion key in the .ext file.
If there are major changes made to the Base App such as deletion of a page, the Extension App will not
work seamlessly after updating the Base App.
For all the existing extended modules ( .ext ) created manually, following properties must be added inside the
manifest at module level as shown below.
This is a prerequisite for Opening the Model-Driven UI Editor for such modules.
Siemens.MatExtension.MaterialEngineering.ext
{
"name": "Siemens.MatExtension.MaterialEngineering",
"type": "model-driven",
"manifestVersion": "02.01.00",
"header":"",
"title": "Material Engineering",
"icon": "sit sit-engineering-material",
"functionalBlock": "Siemens.MatExtension",
"dependencies": [],
"baseAppName": "Siemens.SimaticIT.Material", // should be added as
<Prefix.BaseAppName>
"baseAppModuleName": "Siemens.SimaticIT.Material.MaterialEngineering", //should be
added as <Prefix.BaseAppName.BaseAppModuleName>
"baseAppVersion": "03.00.00", // should be added as <BaseAppVersion>
"states": [/*{...}*/]
}
Result
The extensions for the Base App Module will be available in the runtime UI Application which includes the Base App
Module.
The order of the new extensions merged inside the Base App Module will be based on the order of the
Extension Apps installed.
Entity If selected, it allows you to browse the entity exposed by the Public Object Model App/
Extension App.
Facet (Only on Entity selected) It allows you to browse the facets associated to the selected
s Entity and add them. Multiple facets can be added. Click on Add Item to add a facet
and specify the following:
• Facet, select the facet you want from the list of available Facets of the
Entity.
• Alias, provide an alias name for the facet selected which will be used as
reference for field names. For example, if the Facet Alias is given as
FacetAlias1 and the fields of the facets will be represented as
FacetAlais1.Field in the Fields and the same field can be used to configure
in Fields Settings.
Facet and Facet Aliases configured has to be unique. A same facet cannot be
added more than once.
Readi If selected, it allows you to browse the Reading Function(s) exposed by the Public
ng Object Model App/Extension App.
Funct
ion
Para Specifies the input parameters to be passed to the Reading Function. The input
ms parameters are populated on Reading Function selection.
Input Parameters
{
"CounterId":"contents.Master.selectedItem.Id",
"StateMachine":"contents.Master.selectedItem.StateMachineNId"
}
Fields Based on the selected entity or reading function, the properties will be automatically
loaded. You can decide to add, modify or delete Fields.
Name Unique internal identifier, to be used when configuring an expression and you need to
retrieve the field data. If a Facet is included, then properties related to Facet will be
represented as FacetAlias.FieldName.
Label Property display name, both for tiles and for grids.
If a translation is required, enter a valid resource translation key. The resource
translation key must be present within a resource file, which must be created as
described at page Localizing Custom UI Apps and UI Framework Resources.
Field You can personalize the PropertyGrid preferences for your content of Behavior:
Settings One by doing the following:
• showing or hiding fields by selecting the required field and then
clicking Add / Remove button.
• setting the field order in the PropertyGrid, by selecting the item to be
moved and then clicking the arrow buttons on the right.
5. Build the Extension App and proceed with deploying the App in Solution Studio.
Result
The PropertyGrid fields added from the extensions for the Base App Module Content will be merged along with
other existing fields in the runtime UI Application (as shown below).
This will be available only for Actions of type: Execute Command so that you can execute additional
commands along with the base command.
Procedure
1. Select an existing Base App Module Action of the type Execute Command in the Model-Driven UI Module Editor.
2. Click on the Extend button to navigate to the Extension Settings tab.
3. Enter the Extension Name and click on the button Add Extension to add the new extension.
4. For each extension added, enter the following information:
Section Parameter Description
Command It allows you to browse the command exposed by the Public Object
Model of the App/Extension App.
Fields Based on the selected command, the editor automatically loads the
properties. You can decide to add, modify or delete Fields.
(See Fields Tab Configuration in Configuring the Model-Driven UI
Screen Actions for reference).
Data Entity • When you configure Entity for each extension, you will
Source view the extended field name matching with the responses
and this will be pre-filled.
• When you configure the default expression with the
respective Entity response, you will view pre-filled
configured field.
• When you configure Entity for each extension, you will
view appropriate suggestions for the default expression.
If Action is configured as Side Panel in the Base App, you will have an option to change it as In-Canvas
mode in the extension app. In such scenario if multiple extension installed for Base App, preference is
given to In-Canvas.
When Display Mode is selected as In-Canvas, you will not see the Size, View Mode and Close by clicking
outside options.
Result
The input fields added from the extensions for the Action will be merged along with other existing Base input fields
in the runtime UI Application.
An example is provided here Example of Extending a Base Model-Driven UI Module Action.
Siemens.SimaticIT.Material.MaterialEngineering.ext
{
"name": "Siemens.SimaticIT.Material.MaterialEngineering",
"type": "model-driven",
"manifestVersion": "02.01.00",
"title": "Material Engineering",
"header": "",
"icon": "sit sit-engineering-material",
"functionalBlock": "Siemens.SimaticIT.Material_Ext",
"dependencies": [],
"states": [
{
"appName": "Material",
"appPrefix": "Siemens.SimaticIT.",
"urlPrefix": "Siemens_SimaticIT_Material_Ext_Material_Engineering_Material",
"id": "home.Siemens_SimaticIT_Material_Ext_Material_Engineering_Material",
"title": "Material",
"header": "",
"activeContent": "Master",
"layoutTemplate": "masterDetails",
"icon": "sit sit-engineering-material",
"securable": true,
"params": [],
"contents": {}
}]
The id of the screen which needs to be extended must be changed to the equivalent base module screen
id.
In order to extend the screen Material in the extension manifest shown above, the state id has to be
changed from
home.Siemens_SimaticIT_Material_Ext_Material_Engineering_Material
to
home.Siemens_SimaticIT_Material_Material_Engineering_Material
Siemens.SimaticIT.Material.MaterialEngineering.ext
{
"name": "Siemens.SimaticIT.Material.MaterialEngineering",
"type": "model-driven",
"manifestVersion": "02.01.00",
"title": "Material Engineering",
"header": "",
"icon": "sit sit-engineering-material",
"functionalBlock": "Siemens.SimaticIT.Material_Ext",
"dependencies": [],
"states": [
{
"appName": "Material",
"appPrefix": "Siemens.SimaticIT.",
"urlPrefix": "Siemens_SimaticIT_Material_Ext_Material_Engineering_Material",
"id": "home.Siemens_SimaticIT_Material_Material_Engineering_Material",
"title": "Material",
"header": "",
"activeContent": "Master",
"layoutTemplate": "masterDetails",
"icon": "sit sit-engineering-material",
"securable": true,
"params": [],
"contents": {
"Master": {
"change":"added", //This has to be added along with other descriptors for
the content
"id": "Master",
"title": "Siemens_SimaticIT_Material.Master",
"query": "$orderby=NId asc",
"multiplicity": "many",
"master": true,
"properties": [
{
"propertyRef": {
"entity": "Material",
"app": "Siemens.SimaticIT.Material",
"property": "NId"
},
"name": "NId",
"label": "Siemens_SimaticIT_Material.NId",
"type": "String",
"sortable": true,
"searchable": true,
"isSelected": false,
"id": "NId"
},
{
"propertyRef": {
"entity": "Material",
"app": "Siemens.SimaticIT.Material",
"property": "Revision"
},
"name": "Revision",
"label": "Siemens_SimaticIT_Material.Revision",
"type": "String",
"sortable": true,
"searchable": false,
"isSelected": false,
"id": "Revision"
},
{
"propertyRef": {
"entity": "Material",
"app": "Siemens.SimaticIT.Material",
"property": "UId"
},
"name": "UId",
"label": "Siemens_SimaticIT_Material.UId",
"type": "String",
"sortable": true,
"searchable": false,
"isSelected": false,
"id": "UId"
},
{
"propertyRef": {
"entity": "Material",
"app": "Siemens.SimaticIT.Material",
"property": "Name"
},
"name": "Name",
"label": "Siemens_SimaticIT_Material.Name",
"type": "String",
"sortable": true,
"searchable": false,
"isSelected": false,
"id": "Name"
},
{
"propertyRef": {
"entity": "Material",
"app": "Siemens.SimaticIT.Material",
"property": "Description"
},
"name": "Description",
"label": "Siemens_SimaticIT_Material.Description",
"type": "String",
"sortable": false,
"searchable": false,
"id": "Description"
},
{
"propertyRef": {
"entity": "Material",
"app": "Siemens.SimaticIT.Material",
"property": "UoMNId"
},
"name": "UoMNId",
"label": "Siemens_SimaticIT_Material.UoM",
"type": "String",
"sortable": true,
"searchable": false,
"isSelected": false,
"id": "UoMNId"
},
{
"propertyRef": {
"entity": "Material",
"app": "Siemens.SimaticIT.Material",
"property": "TemplateNId"
},
"name": "TemplateNId",
"label": "Siemens_SimaticIT_Material.Template",
"type": "String",
"sortable": true,
"searchable": false,
"isSelected": true,
"groupable": true,
"id": "TemplateNId"
},
{
"propertyRef": {
"entity": "Material",
"app": "Siemens.SimaticIT.Material",
"property": "IsCurrent"
},
"name": "IsCurrent",
"label": "Siemens_SimaticIT_Material.IsCurrent",
"type": "Boolean",
"sortable": false,
"searchable": false,
"isSelected": false,
"groupable": false,
"id": "IsCurrent"
},
{
"propertyRef": {
"entity": "Material",
"app": "Siemens.SimaticIT.Material",
"property": "IsLocked"
},
"name": "IsLocked",
"label": "Siemens_SimaticIT_Material.IsLocked",
"type": "Boolean",
"sortable": true,
"searchable": false,
"isSelected": false,
"groupable": true,
"id": "IsLocked"
}
],
"blueprintSettings": {
"viewOptions": "c",
"viewMode": "c",
"tileConfig": {
"propertyFields": [
{
"field": "UId",
"displayName": "Siemens_SimaticIT_Material.UId"
},
{
"field": "Name",
"displayName": "Siemens_SimaticIT_Material.Name"
},
{
"field": "Description",
"displayName": "Siemens_SimaticIT_Material.Description"
}
],
"icon": "sit sit-engineering-material",
"titleField": "NId",
"descriptionField": "Revision"
},
"tagField": "",
"image": "sit sit-engineering-material",
"serverSidePagination": true,
"filterBarOptions": "sqgf"
},
"help": "",
"actions":[],
"entityRef": {
"entity": "Material",
"app": "Material"
}
}
}
}]
Extension Examples: Adding a new action to the base module screen's content
Add the extensions to the screen Material's content Master for adding a new action as shown below.
Siemens.SimaticIT.Material.MaterialEngineering.ext
{
"name": "Siemens.SimaticIT.Material.MaterialEngineering",
"type": "model-driven",
"manifestVersion": "02.01.00",
"title": "Material Engineering",
"header": "",
"icon": "sit sit-engineering-material",
"functionalBlock": "Siemens.SimaticIT.Material_Ext",
"dependencies": [],
"states": [
{
"appName": "Material",
"appPrefix": "Siemens.SimaticIT.",
"urlPrefix": "Siemens_SimaticIT_Material_Ext_Material_Engineering_Material",
"id": "home.Siemens_SimaticIT_Material_Material_Engineering_Material",
"title": "Material",
"header": "",
"activeContent": "Master",
"layoutTemplate": "masterDetails",
"icon": "sit sit-engineering-material",
"securable": true,
"params": [],
"contents": {
"Master": {
"id": "Master",
"title": "Siemens_SimaticIT_Material.Master",
"query": "$orderby=NId asc",
"multiplicity": "many",
"master": true,
"properties": [
{
"propertyRef": {
"entity": "Material",
"app": "Siemens.SimaticIT.Material",
"property": "NId"
},
"name": "NId",
"label": "Siemens_SimaticIT_Material.NId",
"type": "String",
"sortable": true,
"searchable": true,
"isSelected": false,
"id": "NId"
},
{
"propertyRef": {
"entity": "Material",
"app": "Siemens.SimaticIT.Material",
"property": "Revision"
},
"name": "Revision",
"label": "Siemens_SimaticIT_Material.Revision",
"type": "String",
"sortable": true,
"searchable": false,
"isSelected": false,
"id": "Revision"
},
{
"propertyRef": {
"entity": "Material",
"app": "Siemens.SimaticIT.Material",
"property": "UId"
},
"name": "UId",
"label": "Siemens_SimaticIT_Material.UId",
"type": "String",
"sortable": true,
"searchable": false,
"isSelected": false,
"id": "UId"
},
{
"propertyRef": {
"entity": "Material",
"app": "Siemens.SimaticIT.Material",
"property": "Name"
},
"name": "Name",
"label": "Siemens_SimaticIT_Material.Name",
"type": "String",
"sortable": true,
"searchable": false,
"isSelected": false,
"id": "Name"
},
{
"propertyRef": {
"entity": "Material",
"app": "Siemens.SimaticIT.Material",
"property": "Description"
},
"name": "Description",
"label": "Siemens_SimaticIT_Material.Description",
"type": "String",
"sortable": false,
"searchable": false,
"id": "Description"
},
{
"propertyRef": {
"entity": "Material",
"app": "Siemens.SimaticIT.Material",
"property": "UoMNId"
},
"name": "UoMNId",
"label": "Siemens_SimaticIT_Material.UoM",
"type": "String",
"sortable": true,
"searchable": false,
"isSelected": false,
"id": "UoMNId"
},
{
"propertyRef": {
"entity": "Material",
"app": "Siemens.SimaticIT.Material",
"property": "TemplateNId"
},
"name": "TemplateNId",
"label": "Siemens_SimaticIT_Material.Template",
"type": "String",
"sortable": true,
"searchable": false,
"isSelected": true,
"groupable": true,
"id": "TemplateNId"
},
{
"propertyRef": {
"entity": "Material",
"app": "Siemens.SimaticIT.Material",
"property": "IsCurrent"
},
"name": "IsCurrent",
"label": "Siemens_SimaticIT_Material.IsCurrent",
"type": "Boolean",
"sortable": false,
"searchable": false,
"isSelected": false,
"groupable": false,
"id": "IsCurrent"
},
{
"propertyRef": {
"entity": "Material",
"app": "Siemens.SimaticIT.Material",
"property": "IsLocked"
},
"name": "IsLocked",
"label": "Siemens_SimaticIT_Material.IsLocked",
"type": "Boolean",
"sortable": true,
"searchable": false,
"isSelected": false,
"groupable": true,
"id": "IsLocked"
}
],
"blueprintSettings": {
"viewOptions": "c",
"viewMode": "c",
"tileConfig": {
"propertyFields": [
{
"field": "UId",
"displayName": "Siemens_SimaticIT_Material.UId"
},
{
"field": "Name",
"displayName": "Siemens_SimaticIT_Material.Name"
},
{
"field": "Description",
"displayName": "Siemens_SimaticIT_Material.Description"
}
],
"icon": "sit sit-engineering-material",
"titleField": "NId",
"descriptionField": "Revision"
},
"tagField": "",
"image": "sit sit-engineering-material",
"serverSidePagination": true,
"filterBarOptions": "sqgf"
},
"help": "",
"actions":[
{
"change":"added", //This has to be added along with other descriptors
for an action
"id": "add",
"title": "Siemens_SimaticIT_Material.Add",
"tooltip": "Siemens_SimaticIT_Material_MaterialEngineering.AddMaterial",
"icon": "fa-plus",
"main": true,
"params": {},
"behavior": {
"type": "command",
"commandRef": {
"command": "CreateMaterial",
"app": "Material",
"fullName":
"Siemens.SimaticIT.Material.Material.MTPOMModel.Commands.Published.CreateMaterial"
},
"sidePanelMode": "large",
"entityRef": {
"entity": "Material",
"app": "Material"
},
"shortTitle": "Siemens_SimaticIT_Material.Save",
"fields": [
{
"parameterRef": {
"command": "CreateMaterial",
"app": "Material",
"parameter": "NId"
},
"name": "NId",
"description": "",
"label": "Siemens_SimaticIT_Material.NId",
"type": "String",
"values": [],
"readOnly": false,
"hidden": false,
"validation": {
"required": true,
"maxlength": "255",
"minLength": "1",
"maxLength": "255"
}
},
{
"parameterRef": {
"command": "CreateMaterial",
"app": "Material",
"parameter": "Revision"
},
"name": "Revision",
"description": "",
"label": "Siemens_SimaticIT_Material.Revision",
"type": "String",
"values": [],
"readOnly": false,
"hidden": false,
"validation": {
"required": true,
"maxlength": "128",
"minLength": "1",
"maxLength": "128"
}
},
{
"parameterRef": {
"command": "CreateMaterial",
"app": "Material",
"parameter": "UId"
},
"name": "UId",
"description": "",
"label": "Siemens_SimaticIT_Material.UId",
"type": "String",
"values": [],
"readOnly": false,
"hidden": false,
"validation": {
"required": false,
"maxlength": "384",
"maxLength": "384"
}
},
{
"parameterRef": {
"command": "CreateMaterial",
"app": "Material",
"parameter": "Name"
},
"name": "Name",
"description": "",
"label": "Siemens_SimaticIT_Material.Name",
"type": "String",
"values": [],
"readOnly": false,
"hidden": false,
"validation": {
"required": false,
"maxlength": "255",
"maxLength": "255"
}
},
{
"parameterRef": {
"command": "CreateMaterial",
"app": "Material",
"parameter": "Description"
},
"name": "Description",
"description": "",
"label": "Siemens_SimaticIT_Material.Description",
"type": "String",
"values": [],
"readOnly": false,
"hidden": false,
"validation": {
"required": false,
"maxlength": "512",
"maxLength": "512"
}
},
{
"parameterRef": {
"command": "CreateMaterial",
"app": "Material",
"parameter": "UoMNId"
},
"entityRef": {
"app": "Material",
"entity": "UoM"
},
"name": "UoMNId",
"description": "",
"label": "Siemens_SimaticIT_Material.UoM",
"type": {},
"values": [],
"readOnly": false,
"hidden": false,
"query": "$filter=IsHidden eq false&$orderby=NId asc",
"displayProperty": "NId",
"valueProperty": "NId",
"validation": {
"required": false
}
},
{
"parameterRef": {
"command": "CreateMaterial",
"app": "Material",
"parameter": "UseDefault"
},
"name": "UseDefault",
"description": "",
"label": "Siemens_SimaticIT_Material.UseDefaultTemplate",
"type": "Boolean",
"values": [],
"readOnly": false,
"hidden": false,
"validation": {
"required": false
}
},
{
"parameterRef": {
"command": "CreateMaterial",
"app": "Material",
"parameter": "TemplateNId"
},
"entityRef": {
"app": "Material",
"entity": "MaterialTemplate"
},
"name": "TemplateNId",
"description": "",
"label": "Siemens_SimaticIT_Material.Template",
"type": {},
"values": [],
"readOnly": false,
"hidden": false,
"query": "$orderby=NId asc",
"clear": {
"expression": "safeVal('action.fields.UseDefault') === true"
},
"disable": {
"expression": "safeVal('action.fields.UseDefault') === true"
},
"displayProperty": "NId",
"valueProperty": "NId",
"validation": {
"required": false
}
}
],
"onExit": {
"key": "MaterialId",
"refreshAndSelectContents": [
"Master",
"Overview"
]
},
"query": ""
},
"show": {
"expression": "activeContent === 'Overview'"
}
}
],
"entityRef": {
"entity": "Material",
"app": "Material"
}
}
}
}]
In case of duplication in the extensions of the extension apps, only the first installed extension app
changes will be merged to the base app module.
Also you can define the custom services required for an action field custom validation.
Procedure
1. Click the in the Model-Driven UI Editor page.
2. Select the required tab to edit and enter the required information as described below.
3. Click Save.
Parameter Description
Title The header of the command bar group.If a translation is required, enter a valid
resource translation key. The resource translation key must be present within
a resource file, which must be created as described at page Localizing Custom
UI Apps and UI Framework Resources.
Parameter Description
Heading The header of the group. If a translation is required, enter a valid resource
translation key. The resource translation key must be present within a
resource file, which must be created as described at page Localizing Custom
UI Apps and UI Framework Resources.
Collapsible Select false, if you want the group to be non-collapsible. By default all the
groups are collapsible.
If you use the corresponding entities provided by the platform Functional Blocks, you may need to import
other entities to the POM Model of your App. The description of the related entities is not provided here
and compared to the provided data model, some changes have been applied here to simplify the
examples.
Property Type
NId String
Name String
Description String
IsDefault bool
UoMNId String
Property Type
NId String
Name String
Description String
The Master side displays the 1. Add a content of Master layout type.
records of an entity in tile 2. Enter the Content ID (e.g. MaterialTemplateMaster), the title, select the
mode. entity related to the records you want to display (e.g. MaterialTemplate)
and set the Behavior to Many.
3. In the General Settings tab select the Tile View mode.
4. In the Tile Settings tab, select at least two properties to be displayed as
descriptive strings.
5. Save the content.
The Detail side content 1. Add a UI Content, and select the Detail option.
shows the details of the 2. Enter the Content ID, e.g. MaterialTemplateDetails.
record selected in the 3. Select the same entity as the Master entity, set
Master content. the Behavior to One and enter the following expression to display the record
related to the entity item you selected in the Master content (for more
information, see Contents and Expressions:
$filter=Id eq
{{contents.MaterialTemplateMaster.selectedItem.Id}}
If you use the corresponding entities provided by the platform Functional Blocks, you you may need to
import other entities to the POM Model of your App. The description of the related entities is not provided
here and compared to the provided data model, some changes have been applied here to simplify the
examples.
Prerequisites
The MaterialTemplate entity is displayed in the Master side content of the screen as described in the following
example: Example of Master-Details UI Screen with Single Entity.
A tab displays the records of an 1. After the previous example is implemented, add a UI Content and
entity which is linked to the entity select the Details option.
that is selected in the Master 2. Enter the Content ID (e.g. MaterialTemplateUserField) and the title
content. for the tab.
3. Select the required entity (e.g. MaterialTemplateUserField), set
the Behavior to Many and enter an expression to display the records
of the MaterialTemplateUserField entity related to the item which
is currently selected in the Master content.
To do this, you must use the navigation property and set its value
equal to the Id of the item which is currently selected in the Master
content (e.g. if the MaterialTemplateUserField has the
MaterialTemplateUserField_Id navigation property used to
navigate to the MaterialTemplate entity, you can define the
expression as follows.
$filter=MaterialTemplateUserField_Id eq
{{contents.MaterialTemplateMaster.selectedItem.Id
}}
A validation is set on one of the action input fields to make the field
required (and consequently the save button is disabled as long as the field
is filled in).
If you use the corresponding entities provided by the platform Functional Blocks, you you may need to
import other entities to the POM Model of your App. The description of the related entities is not provided
here and compared to the provided data model, some changes have been applied here to simplify the
examples.
The MaterialTemplate entity and the UoM entity are described at Example of Master-Details UI Screen with Single
Entity.
The CreateMaterialTemplate command has the following parameters:
Property Type
PropertyNId String
PropertyUoMNId String
PropertyValue String
Action configuration
Target Use Case Procedure
Within an existing Master- 1. With the just configured master content selected, add a UI Action.
Details Screen, an action 2. Choose the Primary button pattern and type the Action ID.
is configured in order to
add a new record and to
present a form with a set
of input fields.
The action presents a 1. Choose the Execute Command action type, and select a command that
form with a set of input creates an instance of the Master content entity
fields. (e.g. CreateMaterialTemplate).
One of the action input 1. In the Fields tab, identify the field that corresponds to the command input
fields is a complex Parameter Type (i.e. Properties in the example), set it to Hidden (because it
property (Parameter will not be passed from the UI), leave the Parameter field (in the Binding
Type). section) set to Properties.
2. For each property that makes up the structure of the Parameter Type,
manually add a UI field, leave it visible (Hidden = False) and delete the value
from the Parameter edit box in the Binding section (because the Field value
will be passed to the Properties field, and not directly to a command
parameter). For this example, add the following UI Fields:
• PropertyNIdInput (string), mapping the PropertyNId parameter type
property,
• PropertyValueInput (string), mapping the PropertyValue parameter
type property,
• PropertyTypeInput (enum, composed by a list of Name -
Value property couples, used to display the supported C# types such
as String, Datetime, Int, Decimal and so on), mapping
the PropertyType parameter type property.
• PropertyUoMNIdInput (string), mapping
the PropertyUoMNId parameter type property.
3. Expand the field that corresponds to the command input Parameter Type
(i.e. Properties field), expand the Binding section, select Function and type
the following code snippet,
where PropertyNId, PropertyValue, PropertyType and PropertyUoMNId are
the properties of the Parameter Type, whose values must be retrieved from the
just defined action fields:
return {PropertyNId:
safeVal('action.fields.PropertyNIdInput'),
PropertyType:
safeVal('action.fields.PropertyTypeInput.value'),
PropertyUoMNId: safeVal('action.fields.PropertyUoMNIdInput')
,PropertyValue: safeval ('action.fields.PropertyValueInput')
}
4. Repeat the same procedure for any other Parameter Type (e.g. Quantity, in the
current example).
A validation is set on one 1. In the Fields tab, expand the required field.
of the action input fields 2. In the User Input Mode Setting click Required and add a string length
to make the field required constraint if needed.
(the save button is
disabled).
The action will update the item that will be currently selected in the Master
content.
One of the action input fields displays a list of values, retrieved from
another entity. The user can select one of the displayed values.
Id Guid
Name String
Description String
UoMNId String
If you use the corresponding artifacts provided by the platform Functional Blocks, you need to apply some
changes and you may need to import other entities (e.g. the entities related in composition, and so on) to
the POM Model of your App. The description of the related entities is not provided here and some changes
have been applied here to simplify the examples.
Prerequisites
The MaterialTemplate entity is displayed in the Master side content of the screen, as described in the following
example: Example of Master-Details UI Screen with Single Entity.
The action will 1. (In Advanced Settings enabled mode) For each field that will not be shown in the
update the item input form, select the Hidden check box and set the following expressions in the
that will be Value Expression edit box (in the Binding section):
currently selected • For the Id field, enter contents.MaterialTemplateMaster.selectedItem.Id. In this
in the Master way the form does not show the input field for the command Id, but reads it from the
content. Id of the item that is currently selected on the Master content;
• For the Name field, enter contents.MaterialTemplateMaster.selectedItem.Name.
In this way the form reads the value of the Name field from the item that is currently
selected on the Master content.
One of the action 1. In the Fields tab, expand the field to be displayed as a list of values, in our example
input fields displays the UoMNId.
a list of values, 2. In the User Input Mode Setting section, select List of Values (Query result).
retrieved from 3. In the Entity Reference section, in the Entity list box, select the entity from which
another entity. The you want to query (e.g. UoM, to show the list of units of measure in the list box).
user can only select 4. Set Display Property and Value Property to the required property value (e.g. NId for
one of the both values).
displayed values. 5. You can order the displayed values by entering the following snippet in the Query
edit box: $orderby=NId asc
6. Save changes.
Use Case
Target Use Case UI Example
A field of the input form displays the list of the records for the entity of the
Master content.
Another field of the input form displays the value related to the one of the
properties of the record selected in the previous field.
Data Model
The example uses the following artifacts:
• MaterialTemplate entity
• CreateMaterialTemplate command
These artifacts have been explained at page Example of Master-Details UI Screen with Single Entity and Example of
Create Action with Parameter Type
Action configuration
Target Use Case Procedure
A button is available to 1. Add a UI Action, for example invoking a command that creates a record for
perform the action. the Master content entity (e.g. CreateMaterialTemplate).
2. Set the action Type to Execute Command.
A field of the input form Set the Name field to read the value from a list of values:
displays a list of records
1. In the User Input Mode Setting section, select List of Values (Query
retrieved by any required
result).
entity.
2. In Advanced Settings Enabled mode, in the Entity Reference section,
select MaterialTemplate from the Entity list box, and select Name both as
Display Property and as Value Property.
Another field of the input Set the UoMNId field of the command to the UoMNId value of the previously
form displays the value selected record (MaterialTemplate.Name) in cascade as follows:
related to the record
1. In Advanced Settings Enabled mode, in the Entity Reference section,
selected in another field.
select MaterialTemplate from the Entity drop down list box.
2. In the Query edit box, type $filter=Name eq
'{{action.fields.Name.Name}}' to retrieve the Name property value of the
MaterialTemplate entity, which will be passed from the Name list of
values.
3. Set the Display Property and the Value Property to UoMNId, to display the
vaue of the UoMNId property for the MaterialTemplate record that will be
passed from the Name list of values.
4. Select the Reload Data on Change check box.
Use Case
Target Use Case UI Example
Data Model
This example uses the MaterialTemplate entity, whose properties have been documented for previous examples.
Action configuration
Target Use Case Procedure
A record in the Master content is selected Within any already existing Details side content (for example in
and a button is added for navigating to the Details content of the first example) add an action and
another screen. configure it as follows:
• Type: Navigation
• Destination Screen: The ID of the target screen (which has
to be read from the Screen ID parameter), preceded by
"home." (with the dot and without apexes).
• Destination Screen Parameters: The parameter you want
to pass in input to the screen. For example, if you have
selected a Material Template in the Master content, you can
pass to the current screen the value of one of its properties
(e.g. UoMNId) with the following expression:
{"UoMNId":"contents.MaterialTemplateMaster.selectedI
tem.UoMNId"}
When clicking on the navigation button, a 1. Create or configure a UI Screen to be used as the target page
target screen opens displaying data filtered of your navigation as follows:
by some value related to the record
• Title: The screen title you want to display.
previously selected in the Master content.
• Params: The parameter you want to pass in input to
Here you are about to pass the UoM the screen. For example, if the navigation action
(UoMNId property) of the previously passes the UoMNId parameter, here you will enter
selected MaterialTemplate to the query of UoMNId.
the target content. 2. Create a Content (e.g. of Master type) with the following
settings:
• Entity: The entity you want to show in the content
(e.g. MaterialTemplate).
• oData Query: To retrieve the entity instances
(MaterialTemplate) that have the same Unit of
Measure (UoMNId), passed by the navigation action
parameter, set the following expression:
$filter=UoMNId eq '{{params.UoMNId}}'
In a user input form, the user selects a type in an input field, and
according to the implemented custom validation, the system validates
the value that the user enters.
Data Model
The example uses the following data model objects:
• The MaterialTemplateProperty entity (which extends the MasterDataTemplate entity). This entity contains
the following properties:
Property Type
NId String
PropertyValue String
PropertyUoMNId String
PropertyType String
MaterialTemplate_Id Guid
• The CreateMaterialTemplateProperties command has been modeled to accept in input the following
parameters:
MaterialTemplateId Guid
In a user input form, the user selects a type in an input Write the following function body to validate
field, and according to the implemented custom the MaterialPropertyValue field depending on the
validation, the system validates the value that the user selected MaterialPropertyType:
enters.
forms.properties.MaterialTemplateProp
ertyValue.$setValidity('custom',false)
;
} else{
forms.properties.MaterialTemplateProp
ertyValue.$setValidity('custom', true)
;
}
}
Depending the type selected, according to the write the following function body to make the
confugured custom validation, the UoM field value will field MaterialTemplatePropertyUoMNId as
be validated as required. required only when the MaterialPropertyType is
selected as Quantity.
validations.MaterialTemplatePropertyU
oMNId.required = true;
} else{
validations.MaterialTemplatePropertyU
oMNId.required = false;
}
}
Example of customServices
The following example shows how to use customServices to get the reference of a custom service
validationService inside the custom function body.
Use Case
Data Model
The example uses the following artifacts:
Name String
Description String
MaterialNId String
MaterialRevision String
MaterialUId String
TemplateNId String
SourceRevision String
IsCurrent Bool
UId String
NId String
Name String
Description String
UoMNId String
TemplateNId String
Name String
Description String
IsHidden Bool
IsSystemDefined Bool
UoMDimension_Id Guid
UoMBase_Id Guid
Name String
Description String
MaterialNId String
MaterialUId String
MaterialRevision String
UseDefault Bool
StateMachineNId String
TemplateNId String
UseCurrentRevision Bool
Action configuration
1. Add a UI Action, for example invoking a command that creates a record for the Master content entity
(e.g. CreateMaterialLot ).
2. Set the action Type to Execute Command.
3. In the action fields, go through the following steps in order to achieve the use cases:
An Input text field UoM is filled UoM 1. Add a field with Field Name as UoM.
with a value based on the
2. Select User Input Mode as Input Text.
selection of other fields like
Material, Material Revision and 3. Enable Advanced Settings Mode.
Material Unique Identifier
4. Select Reload Data on Change check box.
5. Select Material from the Entity list.
6. Provide the Query as
$filter=NId eq
'{{action.fields.MaterialNId.NId}}' and
Revision eq
'{{action.fields.MaterialRevision.Revision}
}' and UId eq
'{{action.fields.MaterialUId.UId}}'
&$orderby=NId asc
First value of the drop-down list State 1. Add a field with Field Name as State Machine.
State Machine is selected as soon Machi
2. Select User Input Mode as List of Values (Query Result).
as the side panel is opened ne
3. Enable Advanced Settings Mode.
4. Select Material from the Entity list.
5. Select the Preselect Value check box.
An item of UoM drop-down list is UoM 1. Add a field with Field Name as UoM.
selected based on the selection of
2. Select User Input Mode as List of Values(Query Result).
other fields like Material,
Material Revision and Material 3. Enable Advanced Settings Mode.
Unique Identifier
4. Select Preselect Value and Reload on Data Change check
boxes.
5. Select the Entity as UoM.
6. Provide the Query as $orderby=NId asc
7. Select NId as Display Property and Value Property.
8. Select the Entity as Material in the Preselect Entity
Reference section.
9. Provide the preselect Query as
$filter=NId eq
'{{action.fields.MaterialNId.NId}}' and
Revision eq
'{{action.fields.MaterialRevision.Revision}
}' and UId eq
'{{action.fields.MaterialUId.UId}}'
&$orderby=NId asc
Refer to the explanations provided at page Example of Create Action with Parameter Type to complete
the action field configuration.
And refer to Example of Displaying Value Types within Contents to properly display the entity value
types.
The content of the screen displays the segregation tags which are
currently associated to the entity instances.
Prerequisites
• The Data Segregation tags have been assigned to the entity instances of the entity (e.g. the MaterialTemplate
entity). See Data Segregation App in the Opcenter Execution Foundation User Manual.
• A Person has been properly configured to view the required entity tags and this Person will log on at runtime.
Data Model
The same data model that is used for Example of Master-Details UI Screen with Single Entity.
Content configuration
Target Use case Procedure
The content of the screen displays the 1. In an already existing Master-Details layout screen, add a
segregation tags which are currently content of Details type.
associated with the entity instances. 2. Specify all the required information (ID, title) and set the
entity to be displayed (in our example the MaterialTemplate).
3. In the oData Query edit box, enter the following expand
syntax to retrieve the list of tags: $expand=SegregationTags
4. In the Fields tab, manually add the SegregationTags field by
setting Name, Property and Label to SegregationTags).
5. In the General Settings tab, select Grid Only and then select
SegregationTags from the Data Segregation Tag list box to
view the tags in the grid column.
6. In the Grid Settings tab, make the SegregationTags column
visible by adding it to the Selected Columns list.
Data Model
The example uses the data model artifacts:
Name String
Description String
MaterialNId String
MaterialRevision String
MaterialUId String
TemplateNId String
Content configuration
When an entity contains value types, the 1. Within a Master-Details screen, add a content of Details type and
content shows the value type properties configure it to retrieve the data from the required entity (e.g.
on different columns (and not on a MaterialLot).
single column), in to display all the value 2. In the Fields tab, the new fields corresponding to the value type
types. properties you want to display will be automatically added. If
the value type is Status and it contains
StateMachineNId and StatusNId, then
Status.StateMachineNId and Status.StatusNId will be
automatically added and Status will not be added as a field.
Data Model
The example uses the below data model artifacts:
Name String
Description String
MaterialNId String
MaterialRevision String
MaterialUId String
TemplateNId String
Name String
Description String
MaterialNId String
MaterialRevision String
MaterialUId String
EquipmentNId String
TemplateNId String
Code String
CodeType Enum
Configure a Drill-Down 1. Within a Master layout screen (Material Lot), add a master content and
command for a content. configure it to retrieve the data from the required entity (e.g. MaterialLot).
2. In the Tile Settings / Grid Settings tab, in commands section, add a
command and select the destination screen (Material Lot Management)
from the available screens.
3. By default the available params of the destination screen selected will be
updated. If you want to provide additional input parameters to be used for
the destination screen, you must execute both of the following sub-steps:
• Fill in the Params edit box as shown in the example below (See
Contents and Expressions):
Params Example
{"MasterParam":"contents.Master.selectedItem.Id"}
Configure a Drill-Down 1. Within a Master layout screen (Material Lot), add a master content and
action for a screen. configure it to retrieve the data from the required entity (e.g. MaterialLot).
2. Add a Action (e.g. OpenMaterialLot) to the master content.
3. In the Details tab:
• Specify the required information (ID, Title, Icon) to be displayed.
• If required, fill in the Params edit box.
• Provide the Show When expression or function as
contents.Master.selectedItem.Id
in order to show the drill down action only if the content item is
selected. See Contents and Expressions.
4. In the Behavior tab:
• In the Type drop down, select Drill Down.
• Select Synchronize with Tile/Grid Command, if you want to load the
configuration of the drill down commands configured in parent
content (MaterialLot). Follow the below steps if this is not selected or
if any changes needed apart from the saved content's configuration.
All the configurations saved here will be synced with Tile/Grid
commands and vice versa.
• Destination Screen, select the screen for navigation. If the required
screen is not present in the entity picker, then provide the ID of the
target Screen (Material Lot Management) in the text box of the entity
picker.
Params Example
{"MasterParam":"contents.Master.selectedItem.Id"}
Within an existing UI Screen belonging to the Base App UI Module you are
extending, the Add Material action is extended with two command
extensions: UAPI_Extension belonging to the UAPI_Material Extension
App and UADM_Extension belonging to the UADM_Material Extension
App, in order to show the input parameters for the additional commands
to be executed along with the base command.
(Fields form one Extension: UAPI/UADM extension of action to execute a
different command than base command.)
If you use the corresponding entities provided by the platform Functional Blocks, it is required to import
other entities to the POM Model of your App. The description of the related entities is not provided here
and compared to the provided data model, some changes have been applied here to simplify the
examples.
Property Type
UId String
NId String
Revision String
Name String
Description String
TemplateNId String
UoMNId String
The UAPI_Material entity contains the following properties:
Property Type
NId String
Name String
Material_Id Guid
The UADM_Material entity contains the following properties:
Property Type
NId String
Name String
Material_Id Guid
The commands contains the following parameters:
NId String
Revision String
Name String
Description String
TemplateNId String
UoMNId String
UseDefault Bool
UAPI_NId String
UAPI_Revision String
UADM_NId String
UADM_Revision String
Prerequisites
The Add Material action from Material Base App must be of type: Execute Command.
In both the extension apps, inside 1. Navigate to Extensions tab inside action Add Material of Material
the action Add Material, a field: Screen inside UAPI_Material Extension App.
NId_Hidden is created and 2. Open UAPI_Extension and create field NId_Hidden.
configured to be hidden whose 3. Open Binding section and (only on Advanced Settings mode
value is dependent on the field : enabled) specify the following expression as value of the field as
UAPI Material NId or UADM below. (See Contents and Expressions)
Material NId.
action.UAPI_Material_UAPI_Extension.fields.NId
action.UADM_Material_UADM_Extension.fields.NId
After Saving, the base command: 1. Navigate to Extensions tab inside action Add Material of Material
CreateMaterial will be executed. Screen inside UAPI_Material Extension App.
2. Open UAPI_Extension command extension and Open field
Also, all the additional commands
Material_Id of command: CreatePIMaterial.
(CreatePIMaterial and
3. Open Binding section and (only on Advanced Settings mode
CreateDMMaterial) from the two
enabled) specify the following expression as value of the field for
command extensions for the
using the response of the base command: CreateMaterial execution.
action configured
(See Contents and Expressions)
(UAPI_Extension and
UADM_Extension) will be
executed in parallel depending on baseCommand.output.MaterialId
the order of the command
extensions. 1. Navigate to Extensions tab inside action Add Material of Material
The base command output Screen inside UADM_Material Extension App.
parameters is used to fill the value 2. Open UADM_Extension command extension and Open field
of the field: Material_Id in both Material_Id of command: CreateDMMaterial.
the command extensions. 3. Open Binding section and (only on Advanced Settings mode
enabled) specify the following expression as value of the field for
using the response of the base command: CreateMaterial execution.
(See Contents and Expressions)
baseCommand.output.MaterialId
MaterialGroupNId String
ParentMaterialGroupIds List<String>
MaterialGroupId String
If you use the corresponding artifacts provided by the platform Functional Blocks, you need to apply some
changes and you may need to import other entities (e.g. the entities related in composition, and so on) to
the POM Model of your App. The description of the related entities is not provided here and some changes
have been applied here to simplify the examples.
UI Action configuration
Target Use Case Procedure
In a Master-Details 1. Add a UI Action (Join Material Groups) to the Details content (Grouped In).
View screen, a 2. Specify the following expression in the Show When edit box:
button is added
and it is made
visible only if the contents.MaterialGroupMaster.selectedItem &&
current tab is activeContent === 'GroupedIn'
selected and if the
Master content is This expression makes the button visible only if the Master content
not empty. (MaterialGroupMaster) is not empty and if the Details tab content (e.g. GroupedIn)
is active.
3. Choose the Execute Command action type, select the command you want to invoke
(e.g. AssociateParentsMaterialGroupWithMaterialGroup ).
The action will 1. (In Advanced Settings enabled mode) For each field that will not be shown in the
update the item input form, select the Hidden checkbox and set the following expressions in the
that will be Value Expression edit box (in the Binding section):
currently selected • For the MaterialGroupId field, enter
in the Master contents.MaterialGroupMaster.selectedItem.Id. In this way, the form does not
content. show the input field for the command Id, but reads it from the Id of the item that is
currently selected on the Master content;
• For the MaterialGroupNId field, enter
contents.MaterialGroupMaster.selectedItem.NId. In this way, the form reads the
value of the NId field from the item that is currently selected on the Master content.
Ids List<GUID>
User String
Multi-Selection Configuration
Target Use Case Procedure
In the Master content of the 1. (In the Advanced Settings Enabled mode) In a content (Master),
Master Screen (or Details content Navigate to General Settings tab.
of the Master-Details Screen), the 2. In the Data Settings section, select the Enable Multi Selection check
user can select multiple (more box.
than one) items for the content of 3. Click Save.
Behavior Many. 4. Configure the visibility of the actions (FreezeTask,UnFreezeTask etc.)
to show only when the Status of all the selected items are Ready and
not Hidden, as below:
Expression example
contents.Master.selectedItems.eval(item.Status ===
'Ready' && !item.IsHidden)
Procedure
If you want the drill down command to work in your custom action, follow the steps below:
1. Inject common.services.modelDriven.runtimeService service inside your controller.
2. In the place where you initialize your controller, call the initCustomDrillDown method of the above service. The
following table describes the APIs which are exposed:
APIs Description Parameters
Example for performing drill down from Custom screen to Model-driven UI screen
(function () {
'use strict';
angular.module('Siemens.SimaticIT.Material')
.controller('CustomMaterialLotCtrl',
[
'$translate', 'common.services.modelDriven.runtimeService', '$state','
common.base', '$q',
function ($translate, mdRuntimeSvc, $state,base, $q) {
var self = this;
var selectedItemId = '';
var backendService = base.services.runtime.backendService;
activate();
function getData() {
var defer = $q.defer();
var options = '';
var args = { appName: 'Material', entityName: 'MaterialLot',
options: options };
backendService.findAll(args).then(function (data) {
var dataToResolve = data.value || [];
defer.resolve(dataToResolve);
})
return defer.promise;
}
function initTiles(data){
self.pages = data.map(function (item) {
return {
Id: item.Id,
selected: item.Id === selectedItemId,
title: $translate.instant(item.NId),
NId: item.NId,
svgIcon: '',
onClickCallback: function (item) {
if (typeof self.performDrillDown == 'function') {
//the destination screen info to perform a
drill down.
//screenId:the id of the screen without home.
//params : the params of the screen
var destScreenInfo = { screenId:
'Siemens_SimaticIT_Material_Material_Runtime_MaterialLot', params: { } };
self.performDrillDown(item, destScreenInfo,
item.NId); //call the api to perform drill-down navigation to the destination screen
}
}
};
});
}
function initCustomDrillDown(){
//gets the list of api to handle drill down
var apiList = mdRuntimeSvc.initCustomDrillDown();
if (apiList) {
self.performDrillDown = apiList.navigate;
self.getDrillDownInfo = apiList.getInfo;
}
function activate(){
getData().then(function (data) {
//initializes the custom drill-down apis
initCustomDrillDown();
initTiles(data);
})
}
}]);
}());
Example for managing drill down from Model-driven UI screen to Custom screen
(function () {
'use strict';
angular.module('Siemens.SimaticIT.Material')
.controller('CustomMTUCtrl',
[
'$translate', 'common.services.modelDriven.runtimeService', '$state',
'common.base', '$q',
function ($translate, mdRuntimeSvc, $state, base, $q) {
var self = this;
var selectedItemId = '';
var backendService = base.services.runtime.backendService;
activate();
function getData() {
var defer = $q.defer();
var options = '';
var args = { appName: 'Material', entityName:
'MaterialTrackingUnit', options: options };
backendService.findAll(args).then(function (data) {
var dataToResolve = data.value || [];
defer.resolve(dataToResolve);
})
return defer.promise;
}
function initTiles(data){
self.pages = data.map(function (item) {
return {
Id: item.Id,
selected: item.Id === selectedItemId,
title: $translate.instant(item.NId),
NId: item.NId,
svgIcon: '',
onClickCallback: function (item) {
if (typeof self.performDrillDown == 'function') {
var destScreenInfo = { screenId:
'Siemens_SimaticIT_Material_Material_Runtime_MaterialTrackingUnit', params: { 'NId':
item.NId } };
self.performDrillDown(item, destScreenInfo,
item.NId);
}
}
};
});
}
function initCustomDrillDown(){
var apiList = mdRuntimeSvc.initCustomDrillDown();
if (apiList) {
self.performDrillDown = apiList.navigate;
self.getDrillDownInfo = apiList.getInfo;
self.goToPreviousLevel = apiList.goToPreviousLevel;
self.setTitle = apiList.setTitle;
}
}
}
self.breadcrumbOptions = {
onClick: function (item) {
if (typeof self.goToPreviousLevel === 'function') {
//call the api to go to the screen clicked
through the breadcrumb
self.goToPreviousLevel(item);
}
}
}
}
function setBreadcrumbTitle(selectedItemId) {
var selectedItem = self.pages.filter(function (item) { return
item.Id === selectedItemId });
if (typeof self.setTitle === 'function' && selectedItem &&
selectedItem[0]) {
var title = selectedItem[0].NId;
self.setTitle(title);
}
}
function activate() {
getData().then(function (data) {
initCustomDrillDown();
initTiles(data);
//call the api to set the breadcrumb title for the
current custom screen
setBreadcrumbTitle(selectedItemId);
})
}
}]);
}());
When you are creating groups to associate the fields of content of multiplicity: one under one
group
Data Model
The example uses the below data model artifacts:
Name String
Description String
Revision String
Configure a 1. Within a Master layout screen (Material), add a master content and configure
Condtional Drill-Down it to retrieve the data from the required entity (e.g. Material).
command for a content. 2. In the Tile Settings / Grid Settings tab, in commands section, add a
command and select the conditional destination screen.
3. Select the screen (e.g. MaterialOfRevisionAny) from the available screens
menu and click on Add.
4. The first added screen will be automatically set as default.
5. Select the screen (e.g MaterialOfRevision1.0) from the available screens
menu and click on Add.
6. By default the available params of the destination screen selected will be
updated. If you want to provide additional input parameters to be used for
the destination screen, you must execute both of the following sub-steps:
• Fill in the Params edit box as shown in the example below (See
Contents and Expressions) :
Params Example
{"MasterParam":"currentContentItem.Id"}
Configure a Conditional Within a Master layout screen (Material), add a master content and configure it
based Drill- to retrieve the data from the required entity (e.g. Material).
Down Action for a screen.
Add a Action (e.g. OpenMaterial) to the master content.
In the Details tab:
Specify the required information (ID, Title, Icon) to be displayed.
Provide the Show When expression or function as
contents.Master.selectedItem.Id
in order to show the drill down action only if the content item is selected. See
Contents and Expressions.
In the Behavior tab:
• In the Type drop down, select Drill Down.
• Select Synchronize with Tile/Grid Command, if you want to load the
configuration of the drill down commands configured in parent content
(Material). Follow the below steps if this is not selected or if any changes
needed apart from the content's configuration. All the configurations saved
here will be synced with tile/grid commands and vice versa.
• Select the Conditional checkbox to enable the configuration of conditional
based drill down.
• Select the screen (e.g. MaterialOfRevisionAny) from the available screens
menu and click on Add.
• The first added screen will be automatically set as default.
• Select the screen (e.g MaterialOfRevision1.0) from the available screens
menu and click on Add.
• By default the available params of the Destination Screen selected will be
updated. If you want to provide any additional input parameters to be used
for the destination screen, you must execute both of the following sub-steps:
• Fill in the Params edit box as shown in the example below (See
Contents and Expressions) :
Params Example
{"MasterParam":"currentContentItem.Id"}
• Provide the same input parameter to the target screen, as described at page
Example of Navigation to Another UI Screen page. Here you must add the just
specified input parameter to the target screen Params attribute.
• Enter the Condition as expression to configure the condition on which the
current destination screen should be considered for navigation. See
Contents and Expressions.
5. Click Save.
Name String
Description String
Revision String
ResolvedBy String
FoundBy String
Severity Int
Code String
Type String
Country String
Building String
Address String
When an entity contains facets, the facet properties from multiple facets can
be displayed on the content grid or tile.
The facet properties can be used to perform sorting on the content grid or
tile.
The facet properties can be used for searching on the content grid or tile.
The facet properties can be used for filtering on the content grid or tile.
Whenever properties from facets are used for filtering, resulting data will
only consist the entities that are related to those facets involved in filter
clauses.
For example, When the material is filtered with a condition Status_Code <>
999, dispalyed entity list will only consist the entries that has Status type of
facet associated to it. Rest of the entities without an association with Status
facet will not be part of the filtered result.
The facet properties can be used for grouping on the content grid or tile.
The facet properties can be displayed in the property grid for contents of
multiplicity: one.
Content configuration
Target Use Case Procedure
When an entity contains 1. Within a Master-Details layout screen, add a Master content of
facets, the facet properties multiplicity: many.
from multiple facets can be 2. Specify all the required information (ID, title) and set the entity to be
displayed on the content grid displayed (in our example the Material).
or tile. 3. Once the entity is selected, Open Facets accordion to add facets
associated to the entity.
4. Click on Add Item.
5. Select a facet (Defect) from the list of available Facets in the Facets Field.
6. Once a Facet is selected, Alias will be automatically filled with Facet short
name. It can be changed as per the need.
7. Select another facet (Status) from the list of available Facets and specify
the required Alias.
8. In the Fields tab, the properties from entity Material and its Facets:
Defect and Status will be shown.
9. In the General Settings tab, select the display mode as Tile and Grid.
10. In the Tile Settings tab, configure the Property Fields with the properties
from both the Facets added which should be shown on the Tile.
11. In the Grid Settings tab, configure the Selected Columns with the
properties from both the Facets added.
The facet properties can be 1. Within a Master-Details layout screen, add a Detail content of
displayed in the property grid multiplicity: one.
for contents of multiplicity: 2. Specify all the required information (ID, title) and set the entity to be
one. displayed (in our example the Material).
3. Once the entity is selected, Open Facets accordion to add facets
associated to the entity.
4. Click on Add Item.
5. Select a facet (Defect) from the list of available Facets in the Facets Field.
6. Once a Facet is selected, Alias will be automatically filled with Facet short
name. It can be changed as per the need.
7. Select another facet (Status) from the list of available Facets and specify
the required Alias.
8. In the Fields tab, the properties from entity Material and its Facets:
Defect and Status will be shown.
9. In the Field Settings tab, configure the Selected Fields with the
properties from both the Facets added.
Property Type
PropertyNId String
Property Type
PropertyUoMNId String
PropertyValue String
Action configuration
Target Use Case Procedure
Within an existing Master-Details Screen, an action is configured in 1. With the just configured master
order to add a new record and to present a form with a set of input content selected, add a UI
fields. Action.
2. Choose the Primary
button pattern and type the
Action ID.
The action presents a form with a set of input fields. 1. Choose the Execute
Command action type, and select
a command that creates an
instance of the Master content
entity (e.g. CreateMaterial).
Create execute command action with display mode as In-Canvas. 1. Enable the Advanced Settings.
2. Change the display mode as In-
Canvas.
3. Name the Header Title as
Localization Key.
4. Select the Header Title Field from
the drop-down list.
5. Name the Breadcrumb Title as
Localization Key.
6. Select the Breadcrumb Title Field
from the drop-down list.
7. Select the number of columns
between 2 to 7.
Passing only the converted base64 string of the file to the command:
• configure a field with above mentioned use case.
• create another hidden field with its value configured as
action.fields.FileUploaderField.contents.
Limitation
If you have an environment configured in HTTPS, debugging functionalities on Business Logic and UI Modules are
not available.
Prerequisites
• You must have rebuilt the <AppName>.UserInterface project to create a copy of the common folder within the
project structure, which contains the UI Framework. This folder is accessible on the file system, but it is not
visible in Solution Explorer. This operation must be performed for each project every time the UI Framework
version changes.
• The UI Model-Driven Server must have been started (by right-clicking the <AppName>.UserInterface project
and selecting the Start UI Model-Driven Server command).
• The Solution containing the entities and commands used by the UI Module has been deployed at least once.
• The Runtime Service Layer is running and it is possible to retrieve data and execute commands.
Procedure
In Project Studio,
1. Right-click the <AppName>.UserInterface project and select Generate UI Application Files to launch
the script that automatically updates the default UI Application files.
2. Right-click the <AppName>.UserInterface project and select Run UI Application in browser to open the
modules in the default browser.
If the UI you are debugging contains widgets that make requests to any Service Layers outside your App
(e.g. the Electronic Signature sit-es-scenario-picker widget), you must manually add the required OData
endpoint to the config.js file of your UI Interface project in the applicationServiceUrls section. For
example, referring to sit-es-scenario-picker widget:
"applicationServiceUrls": {
"AuditTrail": "http://localhost/sit-svc/Application/AuditTrail/odata",
Pay attention that you need to repeat this manual operation each time you use the Generate UI
Application Files command, as the file is overwritten.
When testing a UI Application, you should always keep your browser Developer Tools open. To open the
Developer Tools in one of the supported browsers, press F12. Keeping the Developer Tools open also
inhibits any automatic caching of web content on the client side, which can be helpful when debugging.
Preconditions
• You must have rebuilt the <AppName>.UserInterface project to create a copy of the common folder within the
project structure, which contains the UI Framework. This folder is accessible on the file system, but it is not
visible in Solution Explorer. This operation must be performed for each project every time the UI Framework
version changes.
• The UI Model-Driven Server must have been started (by right-clicking the <AppName>.UserInterface project
and selecting the Start UI Model-Driven Server command).
• The Solution containing the entities and commands used by the UI Module has been deployed at least once.
• The Runtime Service Layer is running and it is possible to retrieve data and execute commands.
• The same preconditions described for Debugging Commands and Reading Functions via App Debugging Tool.
Procedure
In Project Studio:
1. Right-click the <AppName>.UserInterface project and select the Generate UI Application Files (Debug)
command. This command sets inside the config.js file the endpoint of the Debug Runtime Service Layer.
2. Right-click the Solution in Project Studio (App or Functional Block) and select Properties.
3. Select the Multiple startup projects option button and then set the Start action for both the User Interface
project and the Handler to be debugged (Command Handler/Composite Command Handler or Reading
Function Handler).
4. Right-click the <AppName>.UserInterface project and select Run UI Application in browser to open the
modules in the default browser.
5. In the Login page, to which you are automatically redirected, enter the credentials of an authenticated user (i.e.
a user associated with the proper role required to execute the operations invoked in the UI Screen).
6. Execute the operation you want to test. The system will automatically open the related invoked Handler and will
stop at the required breakpoint.
If the UI you are debugging contains widgets that make requests to any Service Layers outside your App
(e.g. the Electronic Signature sit-es-scenario-picker widget), you must manually add the required OData
endpoint to the config.js file of your UI Interface project in the applicationServiceUrls section. For
example, referring to sit-es-scenario-picker widget:
"applicationServiceUrls": {
"AuditTrail": "http://localhost/sit-svc/Application/AuditTrail/odata",
Pay attention that you need to repeat this manual operation each time you use the Generate UI
Application Files command, as the file is overwritten.
If the Debug Service Layer is not ready when you click Start, you may not be correctly redirected to the
login page. The best solution to this issue is to refresh the UI page, by pressing F5, in order to make sure
the Service Layer is running.
To avoid errors on CORS policy, make sure to set all the required headers in svc/application of IIS HTTP
Response Headers. See an example for reference.
If you did not use the Copy to Engineering Target Folder option during the package generation
procedure, manually copy the App package, and the packages generated while compiling the referenced
functional blocks, into the following folders in order to properly load the relative metadata in Solution
Studio:
App %ProgramData%
\Siemens\SimaticIT\Unified\Engineering\Packages\Proj
ects
To secure the custom package release, see Whitelisting in the Opcenter Execution Foundation Security
Concept.
Limitations
• Subfolders are not supported
• There must not be two files with the same name.
Procedure
1. From the Installer project, right-click the ExternalDependenices folder and select Add > ExistingFile.
2. Browse to the files you want to include in the App package and click OK.
Result
These files will be included in the External Dependencies folder of the App package zip.
to the data model defined both inside the current model project and inside the referenced Functional Blocks. You
must then manually copy the elements you need and type the required values. When you use the tool to create
the .xml template, the system does not directly overwrite the Dbinit.xml file but displays the template inside a
temporary file.
If you do not need to insert any information, leave the file empty.
Both if you are in a Functional Block and if you are in App, the tool generates an .xml representation of the
data model present in your model project and in the referenced Functional Blocks.
To initialize the Automation App data, you cannot use the dbinit.xml file because it does not perform data
checks
but you must follow the configuration workflow documented at How to Manage Automation Nodes in the
Opcenter Execution Foundation User Manual
Prerequisites
• The model project has been compiled and any required referenced Functional Blocks have been included.
• The entity types you want to initialize with default values must contain a logical key, otherwise they cannot be
imported inside the initialization file.
• You have used Reference Manager to manage relationships between Functional Blocks. If you have manually
added references to other Functional Blocks, the template will not be generated.
You cannot update an entity instance whose logical key has the same value in the database as the one you
are specifying in the initialization file.
Entity type, which describes the type of the entity It can contain multiple
(corresponding to the Fullname displayed Property elements.
Used to describe an entity.
in the Properties pane of the entity in
Project Studio).
Property • name, which describes the name of the • If the described property
property. specifies a reference to a
Used to describe a property
• kind, which specifies if the property is a parent (i.e. the kind is
of an entity.
plain property, a value type property SingleReferenceToParent)
or a reference property (see notes) the element has one inner
• value, which contains the value of the LogicalKey element
property if the property defined for indicating the referenced
kind is plain. The value representation parent entity.
follows the C# • If the described property
System.Globalization.CultureInfo.Invari specifies a many-to-many
antCulture format, except for Guid relationship (i.e. the kind is
values, which are represented in the ManyToManyReference)
following example format: the element contains
"0b0e9810-096f-4864- multiple LogicalKey
b8e0-0dca91f6ff0f". If the property is elements indicating the
enumeration type the value to be linked entities.
specified must be the enumerator • If the described
name and not its numerical value. If the property specifies a
property defined for kind is not plain, value type (i.e. the
this attribute is not present. kind is Complex),
the element should
contain the inner
properties of the
value type, which
can be either Plain
or
SingleReferenceTo
Parent.
LogicalKey entityType, which specifies the type of the It contains a Property element
Specifies the key used to link linked entity. for each property that is part of
an entity to a referenced the logical key of the referenced
entity. entity.
Notes
• The kind attribute can assume the following
values: Plain, SingleReferenceToParent, ManyToManyReference, Complex.
• Relationships among entities are always specified by the forward navigation property.
• You cannot add part entities to a composite entity when it is Frozen, Locked or Marked for Cleaning.
• Null values are indicated by specifying the NULL reserved string (upper case).
• The LogicalKey elements can be nested if the logical key of an entity type includes a navigation property.
• Blob and FileType property types cannot be initialized and should not be present in the .xml.
In both cases, the default language of xml file is English and the file name must be in the
format: <Acronym>.<AppName>.ApplicationLog.en-US.xml. You must not modify the file name, even
though the system allows you.
This way, you can have multiple Application Log xml files (1 for each App). The system manages all xml files
and stores the messages from them in the database. You can install the Application Log App in Solution Studio to
log the defined messages and view them in your UI Application at runtime.
This section describes the structure of the xml file and its restrictions.
File Structure
ID is a mandatory attribute.
Level The type of message. The system accepts only Critical, Error,
Warning, Informational or Verbose value.
Parameter Key The primary key that stores the name of the parameter that repeats
multiple times for a message.
Parameter Type The type of the parameter that repeats multiple times for a message.
Example values for the Application Log File:
-00001 Unable to start the operation Unable to start the operation Error
%op_name% because the work order
%wo_name% is on hold.
-00001 Unable to start the operation Unable to start the operation %op_id% Error
because the work order %wo_id% is on
hold and material lot %m_lot% is mark
to be cleaned.
The Application Log xml file requires certain restrictions that you must respect to avoid database update errors:
Do not modify the file name, even though the system allows you to. If you rename, the system does not
take into account the custom name and returns an error while building the Installer project.
For the whole configuration procedure, see How To Manage Application Logs.
Output files should be always generated by default when compiling the project.
Sensitive data
• Access to the documentation service layer is anonymous. Consequently the documentation center
store must not include sensitive data. If this is strictly necessary, suitable security measures must be
implemented (e.g. restrict access to the network where the documentation service layer is deployed).
• HTTPS communication is recommended.
Inserting comments
The following procedure is the same described for Functional Blocks, but related to the App solution environment:
1. In Project Studio, in the Object Model (or Public Object Model for Apps), double-click the artifact for which you
want to enter comments.
2. In the Model Details pane, in the General tab, type the required description in the Description edit box.
3. In the Properties window, enter the required descriptions for each artifact parameter or property.
compiling the Installer project, the file will be placed under the output folder which is currently set for the
solution configuration you are using (e.g. bin\Debug or bin\Release or any other output folder).
Procedure
1. In the Solution Explorer pane, right-click your Command Handler project and select Build Dependencies >
Project Dependencies.
2. Click on the Dependencies tab.
3. Select your Command Handler project from the Projects drop down list.
4. In the Depends on pane select your model project and click OK.
5. Select your Event Handler project from the Projects drop down list.
6. In the Depends on pane select your model project and click OK.
If build errors persist when building from the command line, open .sln file from the solution folder, and
make sure the model project (.pmproj) is the first project in the list.
Alternative Procedure
To set the build order perform the following procedure, first for the command handler project and then for the
event handler and Installer project:
1. Create a reference to the model project from the command handler project by right-clicking
the CommandHandler project node in Solution Explorer and clicking Add > Reference.
2. In Reference Manager select Solution > Projects in the left hand pane, select the model project and click OK.
3. Right-click the CommandHandler project and select Build.
4. Right-click the CommandHandler project node in Solution Explorer and select Open Folder in File Explorer.
5. Open the file <AppName>.CommandHandler.csproj with a text editor.
6. In the <ProjectReference> node you created in step 2 enter <ReferenceOutputAssembly>false</
ReferenceOutputAssembly>.
<ProjectReference Include="..\FBAppxx.UPPOMModel\FBAppxx.UPPOMModel.pmproj">
<Project>{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}</Project>
<Name>FBAppxx.UPPOMModel</Name>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
7. Click Save.
8. Repeat the whole procedure for the event handler and installer project.
The RestoreSimaticITUAFPackage target replaces the necessity to perform a Restore operation from Reference
Manager.
Prerequisites
The build order must have been defined.
Procedure
The RestoreSimaticITUAFPackage target can be added to your solution as follows:
1. Right-click the model project node in Solution Explorer and select Open Folder in File Explorer.
2. Open the file <AppName>_<Acronym>POMModel.pmproj with a text editor.
3. At the end of the file add the following nodes:
<Import Project="$(SITUnifiedVSToolingPlatformBin)
\Siemens.SimaticIt.ReferenceManager.targets" />
Prerequisites
• If the App contains the definition of composite commands, reading functions or new event handlers, you must
also have imported the related command, or reading functions, or event C# classes (these classes must not
necessarily contain implemented code, but they must be present in the App).
• If you want to enter default values for the initialization of the Opcenter EX FN database, the Dbinit.xml file has
been compiled.
• If you want to add/edit the application log messages for the App, Application Log file has been managed.
• If you want to use the Copy to Engineering Target Folder (see explanation below), the user that is currently
running MS Visual Studio must have write permissions on the target folder (either the user himself or by means
of a dedicated Windows group).
If your App contains references to Functional Blocks, Reference Manager will ensure that these Functional
Blocks will also be referenced by the App Package. However, if you added references manually, without
using Reference Manager, you must modify the <Prefix>.<App>.References.xml file contained in
the Installer project > Config folder, as described for the Functional Block package.
3. If you want be able to extend this App through an Extension App, set the Can be Extended option to True.
4. Build the Installer Project in either of the following ways:
• by building the entire Solution
• by building the Installer project.
The output files are saved in the bin\Debug folder of the Installer project (for example,
MyApp\MyApp.Installer\bin\Debug). You define where the project will be saved as its Location when you
create the solution in MS Visual Studio. If you do not select the Copy to Engineering Target folder check
box, you will have to manually copy the output zip file, which is placed in the Installer project local output
folder, to the Engineering target folder.
<Prefix>.<DomainName>.<AppName>.< It contains the definition of the entity classes that are required to
Acronym>Model.PublicModel.dll execute reading operations on the public object model.
<Prefix>.<DomainName>.<AppName>.< It contains the definitions of the classes for the types (parameter
Acronym>Model.Types.dll types, enumeration types) that are required to handle the events,
commands and reading functions.
Workflow
1. Create an Extension App.
2. Extend the Public Object Model.
3. Create new Artifacts and Business Logic.
4. Extend User Interfaces.
5. Generate the Extension App Package.
Workflow
1. Create an Extension App.
2. Reference other Functional Blocks from an Extension App.
3. Load Base App changes from an Extension App.
Once you have selected the base App which your Extension App will extend, you cannot remove this base
App, or any of the Functional Blocks it references, from the Extension App solution.
Prerequisites
• The base App to be referenced must have been compiled with the required extension option (Can Be
Extended option) (see Generating an App Package).
• The output zip file of the App you want to reference, created during the App generation, must be saved in the
folder %ProgramData%\Siemens\SimaticIT\Unified\Engineering\Packages\Projects and the zip files of any
referenced Functional Blocks must be saved in the folder %ProgramData%
\Siemens\SimaticIT\Unified\Engineering\Packages\FunctionalBlocks.
Procedure
1. In Project Studio select the File > New > Project command.
2. In the left pane, click Installed and then expand the Simatic IT node.
3. Select FunctionalBlock.EApp.
4. Enter a name for the Extension App, which will then be used in the solution. The name can contain only
alphanumeric characters (20 characters maximum), and it cannot be modified once inserted.
The name of the Extension App must be different from the name of the base App it will reference, and
the names of the Functional Blocks referenced by the base App. It must also be different from the name
of the artifact types (e.g. "event", "commands" etc) and must not contain C# reserved keywords.
5. Enter the location where the Extension App will be created. The location name cannot contain the following
special characters: < (less than), > (greater than), : (colon), " (double quote), / (forward slash), \ (backslash), |
(vertical bar or pipe), ? (question mark), * (asterisk), & (ampersand), # (hashtag), % (percentage), , (comma).
6. Click OK: the creation process is simplified by an integrated wizard which guides you through the
necessary steps.
7. Click Next.
8. Select the base App you want to extend and the specific version you require.
Once selected you cannot uninstall the referenced base App, or install a different App.
9. Enter a prefix for the Extension App (see constraints below). The prefix is then appended to the Extension App
name in order to easily identify it within the development and configuration process.
10. Modify the Extension App version if the default value (01.00.00) does not correspond to your requirements.
11. Insert a description providing other users with additional and exhaustive information on the functionality
provided by the Extension App.
Note During the modeling phase, it will be possible to modify the description of the Extension App at any time,
right-clicking the Installer project and selecting the Properties command.
12. Enter a two-character acronym for the Public Object Model (POM), which must be different from the acronyms
assigned to the standard domains (i.e. not RF, OP, MS) and from the acronym assigned to the base App Public
Object Model. The acronym must not start with a number.
13. Click Next.
14. Select which elements (called projects in the Solution Explorer in Project Studio) your Extension App will
contain:
• Public Object Model (POM) Project (always selected by default) which contains the public reading data
model.
• Reading Function Project: from which you can implement the query expression for reading functions.
• Command Handler Project: from which you can implement the business logic for composite
commands.
• Event Handler Project: from which you can implement the business logic for referenced events.
• UI Project: from which you can develop a user interface for your Extension App.
• Installer Project (always selected by default): where the files required to create the Extension App
package are contained.
Result
If you have selected all available projects the structure displayed in the Solution Explorer pane is the following:
The <Prefix>_<Acronym>_<AppName>.dm file, which will contain the graphical representation of the data model
(in the Diagrams sub-folder), is created within the model project folder.
Additional operations
• To remove a project, right-click it and then select the Remove command.
• To add a new project, right-click the App root, select the Add > New Project command, select
the Installed\Templates\Simatic IT node and then select the required option. The following restrictions apply
when adding a new project:
• there can be only one POMModel Project
• there can be only one UserInterface Project
• there can be only one Installer Project
• it is not possible to add a Model Project to an Extension App solution
• it is not possible to add an External Data Source Project to an Extension App solution.
There can be several Reading Function Projects, Command Handler Projects, Event Handler Projects.
Although events cannot be modified, you can create new handlers for referenced events.
Available operations
• Installing a Functional Block from an Extension App
• Updating the Version of a Functional Block from an Extension App
• Restoring the Files of a Functional Block from an Extension App
• The Functional Block packages must have been created in at least version 2.0 of SIMATIC IT UAF or migrated to
this version. If you try to install a Functional Block from a prior product version an error message will be
displayed.
If two referenced Functional Blocks themselves reference the same Functional Block (i.e. A and B both
reference C) Reference Manager checks to see whether they reference the same version.
If they differ by patch or minor version the highest version is loaded.
For example:
• A references version 01.00.01 of Functional Block C
• B references version 01.00.02 of Functional Block C
Reference Manager will load version 01.00.02 as this should not cause compatibility issues.
If they differ by major version an error is returned and the operation will not be possible.
Procedure
1. In the Solution Explorer pane, double-click the packages.reference file in the Solution Items folder.
2. Click on the Browse tab and select the Functional Block you want to reference. If it can be installed, its details
will be displayed in the pane on the right, otherwise an error message will be displayed.
3. Click Install. If the Functional Block contains references to other Functional Blocks, these will be displayed
under Dependencies and will automatically be installed if their .zip files are available in the folder,
otherwise you will receive an error message.
Result
• The packages you have installed will be displayed in the Installed tab and will have a green tick icon next to
them.
• The Solution Explorer tree view will contain the .um, .umd and .dlls of the referenced Functional Block. A new
folder, SimaticITPackages, if it doesn't already exist, will be created in the folder where your project files are
saved. A subfolder will be created for each referenced Functional Block, its name is comprised of the name and
version of the referenced Functional Block. The files contained in the .zip file are saved in this folder, with the
following structure:
• config folder, with the Dbinit.xml file for initializing the database
• handlers folder, with the command and event handlers
• model folder, with the data model files and assemblies
• ExternalDependencies folder, with third-party files required by the Functional Block you are referencing
• manifest file
Prerequisites
• The output zip file of the Functional Block you want to reference, created during the Functional Block
generation, must be saved in the folder %ProgramData%
\Siemens\SimaticIT\Unified\Engineering\Packages\FunctionalBlocks.
• The Base App you want to reference is updated.
Procedure
1. In the Solution Explorer pane, double-click the packages.reference file in the Solution Items folder.
2. Click on the Installed tab and select the Functional Block you want to update. If it can be updated, its details
will be displayed in the pane on the right, otherwise an error message will be displayed.
3. Click Update. If the Functional Block contains references to other Functional Blocks, they will be automatically
installed if their .zip files are available in the folder, otherwise you will receive an error message.
If two referenced Functional Blocks themselves reference the same Functional Block (i.e. A and B both
reference C) Reference Manager checks to see whether they reference the same version.
If they differ by patch or minor version the highest version is loaded.
For example:
• A references version 01.00.01 of Functional Block C
• B references version 01.00.02 of Functional Block C
Reference Manager will load version 01.00.02 as this should not cause compatibility issues.
If they differ by major version an error is returned and the operation will not be possible.
Prerequisites
The output zip file of the Functional Block you want to reference, created during the Functional Block generation,
must be saved in the folder %ProgramData%
\Siemens\SimaticIT\Unified\Engineering\Packages\FunctionalBlocks.
Procedure
1. Copy the new .zip file of the modified Functional Block in folder %ProgramData%
\Siemens\SimaticIT\Unified\Engineering\Packages\FunctionalBlocks.
2. Double-click the packages.reference file in the Solution Items folder of the Solution Explorer.
3. Click Restore packages. If the zips of the referenced Functional Blocks have been saved in the correct folder the
referenced Functional Blocks will be installed on the user's machine, otherwise an error message will be
displayed.
Prerequisites
The output zip file of the App you want to reference, created during the App generation, must be saved in the
folder %ProgramData%\Siemens\SimaticIT\Unified\Engineering\Packages\Projects and the zip files of any
referenced Functional Blocks must be saved in the folder %ProgramData%
\Siemens\SimaticIT\Unified\Engineering\Packages\FunctionalBlocks.
Procedure
1. Double-click the packages.reference file in the Solution Items folder of the Solution Explorer.
2. Click Restore packages. If the zips of the referenced base App and Functional Blocks have been saved in the
correct folder they will be installed on the user's machine, otherwise an error message will be displayed.
Prerequisites
The output zip file of the App you want to reference, created during the App generation, must be saved in the
folder %ProgramData%\Siemens\SimaticIT\Unified\Engineering\Packages\Projects and the zip files of any
Procedure
1. In the Solution Explorer pane, double-click the packages.reference file in the Solution Items folder.
2. Click on the Installed tab and select the App you want to update.
3. Select the required version from the Version drop down list and click Update.
• Any Functional Blocks referenced by the App will be automatically installed if their .zip files are available in the
folder, otherwise you will receive an error message.
• The version of the Base App in an extended Model-driven UI module gets updated automatically for an
extension app.
Naming Conventions
The name of any artifact imported in the POM is automatically composed by the short name of the Extension
App and the artifact name separated by underscore (_).
Note that the Extension App prefix cannot be removed.
Example: (<ExtAppShortName>_<ArtifactName>).
Possible operations
The following procedures refer to standard App operations, as they are identical to those required to extend the
POM of the Extension App:
• Import new entities to the Public Object Model (entities from the newly referenced Functional Blocks or from
the Base App)
• Import commands to the Public Object Model
• Import views from the Opcenter EX FN repository to the Public Object Model
• Promoting new Signals from referenced entities or business events
• Creating new subscriptions on referenced events (events that are either referenced from Functional Blocks or
Base App). Existing subscriptions cannot be modified.
• Modeling Post-Actions for Composite Commands (both Referenced and not Referenced, as described for the
Functional Blocks).
You can also deprecate artifacts. Note that artifacts deprecated in the Functional Block are automatically
set as deprecated in the referenced App as well, where they are displayed as read-only.
Naming Conventions
The name of any created artifact is automatically composed by the short name of the Extension App and the
artifact name separated by underscore (_).
Note that the Extension App prefix cannot be removed.
Example: (<ExtAppShortName>_<ArtifactName>).
Copying artifacts
You can copy the following artifacts: Parameter Types, Enumeration Types, Public Commands, Composite
Commands, Reading Functions and Roles. If you copy a Public Command, the artifact you actually create
is a Composite Command, because the only commands that you can create inside Apps and Extension
Apps are Composite Commands.
If you have configured Model-Driven UI screen actions by using a custom Blueprint in order to have a
custom side panel with your own input form for your action, pay attention that all files required for a
correct action functioning (controller, template file and any related file) will not be copied in the Extension
App. For this reason, you need to copy these files in your extended UI manually, in order for the custom
panel to work correctly.
Prerequisites
• You have previously created a Model-Driven UI Module in Project Studio. As result, the wizard has created
a .mdui extension file containing the project information, such as the module name, the module title, the icon
and so on (<Prefix>.<AppName>.<ModuleName>.mdui file).
• You have created the .json resource files required to localize the UI Applications according to the suggested
naming convention.
For any operations on the Model-Driven UI Module, refer to chapter How to Create a Model-Driven UI
Module.
To make your changes effective at runtime, add the Extension App to your solution, associate the new UI
modules and deploy the solution.
Supported operations
The following operations can be performed for Project Studio files:
• Create an automated build process
• Merge modifications
• Configure the .gitignore file
We recommend that you version in a source control system only the files which are displayed in the
solution (i.e. you should not add hidden files under the model project or the SimaticITPackages folder).
Prerequisites
• The source control system is correctly configured to manage the required projects.
• Opcenter Execution Foundation has been installed.
• The build order of the projects within each Opcenter Execution Foundation solution (i.e. Functional Blocks and
Apps) has been set (see Defining the Build Order of a Functional Block and Defining the Build Order of an App);
• Functional Block references have been automatically updated for each compiled solution
• The Copy To Engineering Target Folder option has been selected in the Build Options properties of the
installer project to avoid needing to manually copy the output zip file, which is placed in the local output folder
of the Installer project, to the Engineering target folder.
Process
1. Set the solutions under source control and check-in all the solution files.
2. Create a build definition by setting the following:
• multiple solution management;
• the build order of the solutions according to the solution dependencies;
• a distinct output folder for each solution;
<ItemGroup>
<Solution Include="$(SourcePath)FB1\FB1.sln">
<Properties>
Configuration=$(Configuration);
Platform=Any CPU;
OutDir=$(OutDir)\FB1
</Properties>
</Solution>
<Solution Include="$(SourcePath)FB2\FB2.sln">
<Properties>
Configuration=$(Configuration);
Platform=Any CPU;
OutDir=$(OutDir)\FB2
</Properties>
</Solution>
<Solution Include="$(SourcePath)FBApp1\FBApp1.sln">
<Properties>
Configuration=$(Configuration);
Platform=Any CPU;
OutDir=$(OutDir)\FBApp1
</Properties>
</Solution>
</ItemGroup>
4. Add a build node to the .proj XML file, which specifies the order to be used when building, as follows:
<Target Name="Build">
<MSBuild Targets="Build"
Projects="@(Solution)"
StopOnFirstFailure="true" />
</Target>
DM files, where graphical representations of the model are saved, can be saved and versioned in source
control systems, but cannot be merged.
UL files cannot be opened in Project Studio and should not in any case be used as a shortcut to make
modifications to the model for the following reasons:
• The major/minor/patch version compliancy checks in Project Studio cannot be applied to the manual
modification of UL files.
• Manual modifications can also result in data loss due to misalignment.
When you check-in your changes in your source control system, if there is a merge conflict because there is a more
recent version of your UL files, you must follow this procedure:
1. Close your model in Project Studio.
2. In your source control system launch the Get Latest Version command. This is particularly important to
perform before checking in if you are using a gated check-in rule, which includes a build action.
3. Manually resolve conflicts in the UL files if they are not managed automatically by the source control system.
4. (Optional) In Project Studio, double click the dm model project file in the Model Explorer: the new changes will
be automatically applied.
5. Check-in all your UL files in your source control system.
Troubleshooting notes
If import errors occur, a message will inform you and the error details will be displayed in the Visual Studio
output window. Make the appropriate modifications to your model in Project Studio wherever possible,
for example by removing the property of an entity that has been deleted.
Only if it is not possible to directly solve the errors in Project Studio, you can modify the UL files in Visual
Studio (as long as the Functional Block is closed), or in another instance of Visual Studio or with any text
editor program. Use the error details displayed in the Visual Studio output window as guidelines. Although
the Open, Open with, View code and Run custom tool commands are enabled in Project Studio, they
cannot be used because UL files must not be edited in this work environment to avoid inconsistencies.
Should an error concerning a Mandatory attribute appear (such as Model has to be aligned from UL files,
alignment operation in progress ... ERROR! [...] Semantic error at (0, 0): invalid usage of token
'[LogicalKey]' (#0). Details: LogicalKey attribute requires that Mandatory attribute is defined at the same
time), manually open the DataModel.ul, browse to the line indicated in the error message and add the
[Mandatory] tag to the wrongly configured property. This error should only occur in cases of migration
from older product versions such as 1.3 Update 3. More recent versions correctly support the functionality
of setting a navigation property to logical key.
If you are about to... You must check-out the following files:
Create a new version of a Functional Block • All the files in the model project
• The .iproj file in the Installer project
• The .csproj files in the CommandHandler and
EventHandler projects
Add changes to Reference Manager • All the files in the model project
• The .csproj files in the CommandHandler and
(e.g. to add a reference to a Functional Block)
EventHandler projects
Troubleshooting notes
If you have added changes to Reference Manager checking out the related files not in exclusive mode, a
misalignment between data in the Project.config file and data displayed in Reference Manager can occur.
In this case, we suggest that you resolve it manually, by modifying the Project.config file according to the
information displayed in Reference Manager.
An additional file is present in the model project and contains the project properties (name, domain, version etc...).
The file must not be manually modified unless you have to merge conflicts. The file structure must respect the
following format:
<DSL Version='1.7'>
<Project>
<Name>FBApp1.FRPOMModel</Name>
<Version>01.00.00</Version>
<Prefix>Myprefix</Prefix>
<Domain>FBApp1</Domain>
<Guid>9b1c0689-4d4c-4640-b4e9-cc078dfa4ef2</Guid>
<ProjectKind>Pom</ProjectKind>
</Project>
<References>
<Project>
<Name>FBLibrary2.MSModel</Name>
<Version>01.00.00</Version>
<Prefix>bbb</Prefix>
<Domain>MasterData</Domain>
<Guid>25c49d93-fcc2-41a0-9dd6-7d7656b18917</Guid>
</Project>
</References>
</DSL>
• an index on entity
Each entity contains comments, annotations, properties with annotations.
///sec = true
///modified
[Sealed]
[@Guid(714d2ba9-b17b-47ea-a7a6-64d4067d5766)]
[@GuidId(4786f70a-ab79-4f9a-b718-ac16c5624eec)]
[#tag entity]
[#securable]
[Securable]
ENTITY ent_1_sec
WITH
[Length = 255]
[@Guid(c13af04a-f3e5-405e-8f0b-daf90ef8f498)]
ent_1_sec_NewProperty AS string
[Length = 255]
[@Guid(7bc892c0-bc54-4d26-8935-22372e7e5296)]
ent_1_sec_NewProperty1 AS string
[Length = 255]
[@Guid(f2175b7a-ad69-4466-8f0d-00ae34a97752)]
ent_1_sec_NewProperty2 AS string
///sec = False
[@Guid(accc5235-1c1b-49aa-af17-56b425706bc3)]
[@GuidId(cb5418f3-c6de-4017-b6c6-88952a502af6)]
[#tag entity]
[#no securable]
ENTITY ent_1_NoSec
WITH
[Length = 255]
[@Guid(16cefb18-a5cc-49a6-bae7-b14555c16d57)]
ent_1_NoSec_NewProperty AS string
[Length = 255]
[@Guid(63fa8265-51b2-4576-a7ef-0680545eb80b)]
ent_1_NoSec_NewProperty1 AS string
[@Guid(f8b50fca-1143-4c75-ac2c-db76b55d551f)]
INDEX CLUSTERED ON ent_1_NoSec
[@Guid(2c8858dc-e9af-4db6-abae-7360f4d4770d)]
ent_1_NoSec_NewProperty
[@Guid(718b7fc5-6665-46b9-9672-ecd7a4426984)]
[@GuidId(69e7c4fc-e942-47b4-8901-e95bb0af3f5b)]
[#tag entity]
[#no securable]
ENTITY ent_1_NoSec_1 EXTENDS ent_1_NoSec
WITH
[Length = 255]
[@Guid(6d5bd334-6eae-401d-8295-8b26bcca1270)]
ent_1_NoSec_1_NewProperty AS string
[Length = 255]
[@Guid(8b93941e-b01b-4144-ad96-7f249099a30c)]
ent_1_NoSec_1_NewProperty1 AS string
///modified
[@Guid(83634c94-edf6-472a-acb3-78e92de29132)]
[@GuidId(9bd77402-5431-4eb2-a67a-e7a0a9885087)]
[#tag entity]
[Securable]
ENTITY ent_sealed_sec
WITH
[Length = 255]
[@Guid(f165a75f-e46c-498c-9a10-871f7553cc9f)]
ent_sealed_sec_NewProperty AS string
[Length = 255]
[@Guid(c043d2a7-1b53-4bf5-bd69-96274ec22975)]
ent_sealed_sec_NewProperty1 AS string
[@Guid(2b116c10-dbfe-46a2-bc4e-b8b0224d8bea)]
[@GuidId(44e63cb5-5657-46b5-aed3-724ccc964907)]
FACET ent_seal_fac1 EXTENDS ent_sealed_sec
WITH
[Length = 255]
[@Guid(2a56a8cf-0246-4823-8a16-a6268580d978)]
ent_seal_fac1_NewProperty AS string
VERSION '01.07'
[Sealed]
[Securable]
[@Guid(afe67022-5a54-45ec-b194-51cda63146c8)]
[@GuidId(e0868d1f-b1d3-4b09-a6e0-dd8f1aa7ffbc)]
ENTITY vw_MOM_SHCVUN_BREAK
WITH
[Mandatory]
[@Guid(e0868d1f-b1d3-4b09-a6e0-dd8f1aa7ffbc)]
id AS int
[Mandatory]
[@Guid(ebff8cd2-c9ee-4933-a367-f71d18995701)]
myGuid AS Guid
[Mandatory]
[@Guid(52832268-16a5-466f-8d25-c7691dda17db)]
bias AS smallint
[Mandatory]
[@Guid(0be75205-6c8a-4257-aaf7-52ee0319f565)]
break_end_bias AS smallint
[Mandatory]
[@Guid(1701c5c4-4373-4e51-850b-511f0480f103)]
break_start_bias AS smallint
[Mandatory]
[Length = 50]
[@Guid(a56dfe9e-1c78-455f-98a8-612a16663daa)]
label AS string
[Mandatory]
[@Guid(c5645585-fa65-4292-ab81-c1feb54241a0)]
colour AS int
[Mandatory]
[Length = 50]
[@Guid(4b2b7fac-65b8-4111-8954-dfcb54d03e11)]
last_user AS string
[Mandatory]
[Length = 1]
[@Guid(a49fbb7a-a296-4222-b27d-5c739dbbd948)]
type AS string
[@Guid(c4f5eafe-a8f7-4580-92d2-b3129cd94433)]
myTinyint AS tinyint
[Mandatory]
[@Guid(a8921947-b0a2-4a0b-9cb8-9f1bf37ce721)]
myGuid_1 AS Guid
[Mandatory]
[@Guid(901a19af-8540-4ce4-a4e6-e4cfdbcd3d8d)]
myGuid_2 AS Guid
///description
[@Guid(fcb6f1bd-fcae-4883-8b9b-2f39594c25d5)]
ENTITYLINK e1 TO aaaaa.AppTerzePa.AppTerzePa.AAPOMModel.DataModel.e1
[@Guid(24c42161-5cdb-42f9-8290-ba26d8c45d5e)]
ENTITYLINK Ent1 TO bbb.MasterData.FBLibrary2.MSModel.DataModel.Ent1
[@Guid(e0de9e0f-0324-4ceb-8382-b10c7eab1f2b)]
ENTITYLINK Ent2 TO bbb.MasterData.FBLibrary2.MSModel.DataModel.Ent2
VERSION '01.07'
///securable = true
///protected
[Protected]
[@Guid(31946744-9b74-4634-94b7-6aec4f9be091)]
COMMAND cmd_1_sec
WITH
[Length = 255]
cmd_1_sec_NewParameter AS string
RESPONSE
[Optional]
[Length = 255]
cmd_1_sec_NewParameter AS string
///securable = false
///protected
[Protected]
[NotSecurable]
[@Guid(cec060b6-a444-4fef-baa6-94a26770b79d)]
COMMAND cmd_1_noSec
WITH
[Length = 255]
cmd_1_noSec_NewParameter AS string
RESPONSE
[Optional]
[Length = 255]
cmd_1_noSec_NewParameter AS string
///private
[Private]
[@Guid(4c726a82-ef3b-43c6-8516-71d78fe47f7d)]
[NotSecurable]
[@Guid(d4777a0c-3cc6-48c8-857b-68078bd4917c)]
COMMAND C3Priv
WITH
[Length = 255]
C3Priv_NewParameter AS string
[Protected]
[@Guid(28ec8c92-f0e7-4f8c-99d1-fc11f17ede44)]
COMMAND C2
WITH
C2_NewParameter AS aaaaaa.MasterData.FbTest2.MSModel.Types.Pt2
RESPONSE
[Optional]
[Length = 255]
C2_NewParameter AS aaaaaa.MasterData.FbLibTest.MSModel.DataModel.Ent01.PropA
VERSION '01.07'
[Composite]
[Protected]
[@Guid(82526211-a95c-42cf-889a-6940d5e53d37)]
COMMAND Composite1
WITH
[Length = 255]
Name AS string
Height AS int
RESPONSE
[Optional]
C1_NewParameter AS Guid
VERSION '01.07'
[@Guid(a3afe955-9ce6-4483-b241-5d63037d8b08)]
EVENT evt_1_sec
[NotSecurable]
[@Guid(b43d5632-1903-4e7f-ba99-ae43fae873c8)]
EVENT Evt1
WITH
[Length = 255]
Evt1_NewParameter AS string
Evt1_NewParameter1 AS Guid
Evt1_NewParameter2 AS DateTime
[@Guid(7b531a08-ed74-4175-afe1-b0ba1b1c18b9)]
EVENT Evt2
WITH
[Length = 255]
Evt2_PropRef AS Myprefix.MasterData.FbLibTest.MSModel.DataModel.Ent01.PropA
Evt2_ParamType AS Myprefix.MasterData.FbTest2.MSModel.Types.Pt2
[@Guid(63a38930-b938-48a9-9ec9-81ce65e09bf8)]
EVENTHANDLER EvtHandler1 LINKED TO Myprefix.MasterData.FbTest2.MSModel.Events.Evt2
[@Guid(50467d47-0c34-464d-95c2-7ca7c1ca0c2c)]
EVENTHANDLER Evthandler2 LINKED TO Myprefix.MasterData.FbTest2.MSModel.Events.Evt2
[@Guid(aef3b15d-46fb-42c0-9ca2-e0868d01b66f)]
EVENTHANDLER Evthandler1 LINKED TO Myprefix.MasterData.FbTest2.MSModel.Events.Evt1
VERSION '01.07'
[@Guid(e0d3923b-ca07-4349-8c35-76dcd7c096fa)]
EVENTHANDLER MyHandler LINKED TO Myprefix.MasterData.FbTest2.MSModel.Events.EvtNoSec
[@Guid(e46251a8-dbb7-4645-9357-dedd01056e2b)]
SIGNAL SignalEnt2 ON Myprefix.FBApp1.FBApp1.FRPOMModel.DataModel.Ent2
[@Guid(92812d86-ac01-48a6-9915-dfa6da786fac)]
SIGNAL SignalEnt1 ON Myprefix.FBApp1.FBApp1.FRPOMModel.DataModel.Ent1
VERSION '01.07'
[@Guid(667ac4f5-2975-4b2e-b3c6-7bd2307581e7)]
USERROLE UR
GRANT
[@Guid(24c42161-5cdb-42f9-8290-ba26d8c45d5e)]
Myprefix.FBApp1.FBApp1.FRPOMModel.DataModel.Ent1 AS Read
[@Guid(e0de9e0f-0324-4ceb-8382-b10c7eab1f2b)]
Myprefix.FBApp1.FBApp1.FRPOMModel.DataModel.Ent2 AS Read
[@Guid(05449674-d48b-4b0b-87b3-5e0639b37928)]
USERROLE UR2
GRANT
[@Guid(e46251a8-dbb7-4645-9357-dedd01056e2b)]
Myprefix.FBApp1.FBApp1.FRPOMModel.Events.Signals.SignalEnt2 AS Subscribe
[@Guid(92812d86-ac01-48a6-9915-dfa6da786fac)]
Myprefix.FBApp1.FBApp1.FRPOMModel.Events.Signals.SignalEnt1 AS Subscribe
[@Guid(24c42161-5cdb-42f9-8290-ba26d8c45d5e)]
Myprefix.FBApp1.FBApp1.FRPOMModel.DataModel.Ent1 AS Read
VERSION '01.07'
[Length = 255]
[@Guid(8b5f4cf3-e68c-46f1-b347-af0529a4bee8)]
[#tag type]
TYPE ta1 AS string
[@Guid(ccac6430-4345-4e4c-ae31-12d150917611)]
VALUETYPE VTWithPropRef
WITH
[Length = 255]
[Reference]
[@Guid(1488c6fa-5537-4bcb-a05e-f866c341b4fd)]
VTWithPropRef_NewProperty AS
Myprefix.MasterData.FbLibTest.MSModel.DataModel.Ent01.PropA
[@Guid(f841c0ed-68ac-41ca-a51c-a563a3c75b0d)]
[#tag type]
PARAMETERTYPE pt1
WITH
[Length = 255]
[@Guid(01d9becf-9f51-4d47-871b-2751db686fa9)]
pt1_NewProperty AS string
[Length = 255]
[@Guid(7d7164ad-d4e3-4203-b794-bd888ed9c94b)]
pt1_NewProperty1 AS string
[Length = 255]
[@Guid(d479a087-d326-49fc-86df-d23a33a695a7)]
pt1_NewProperty2 AS string
[@Guid(a0fc3486-8eaa-41aa-a600-cc9f9d223ba0)]
PARAMETERTYPE Pt
WITH
[Length = 255]
[@Guid(22a17a7a-a3d5-4d3d-828f-41b5059929ac)]
Pt_NewProperty AS Myprefix.MasterData.FbLibTest.MSModel.DataModel.Ent01.PropA
[@Guid(ef4fe891-18bb-4e4e-9feb-183a8532f78f)]
Pt_NewProperty1 AS bool
[Optional]
[@Guid(721361e3-8d44-4395-82e5-da732503c6ef)]
Pt_NewProperty2 AS Myprefix.MasterData.FbTest2.MSModel.Types.pt1
[@Guid(57687c46-0483-4176-9209-510ce93511d1)]
[#tag type]
ENUM Colors
WITH
[@Guid(406375df-bc26-45df-866f-1118a80139b5)]
Blue AS 1
[@Guid(52a37281-ecf7-469d-b4da-c81bd6329c93)]
Red AS 2
[@Guid(c5bf4e3d-fc2d-46ce-900d-ce2ec9bd1963)]
Yellow AS 3
[@Guid(a0fc3486-8eaa-41aa-a600-ce9f9d223ba0)]
PARAMETERTYPE PtApp
WITH
[@Guid(ef4fe891-18bb-4e4e-9feb-182a8532f78f)]
Pt_NewProperty1 AS bool
[@Guid(57687c46-0483-4176-9209-410ce93511d1)]
[#tag type]
ENUM Enum1
WITH
[@Guid(406375df-bc26-45df-866f-0118a80139b5)]
Prop1 AS 1
[@Guid(52a37281-ecf7-469d-b4da-f81bd6329c93)]
Prop2 AS 2
[@Guid(c5bf4e3d-fc2d-46ce-900d-ee2ec9bd1963)]
Prop3 AS 3
VERSION '01.07'
VERSION '01.10'
[@Guid(82123211-a95c-42cf-143a-6940d5e53d37)]
READING FUNCTION MyReadingFunction
INPUT
[Length = 255]
LotId AS string
Quantity AS int
OUTPUT
[Mandatory]
RowCount AS int
Prerequisites
• Opcenter Execution Foundation has been installed.
• The .gitignore file is installed in Team Explorer. If not, follow the procedure described in: https://
docs.microsoft.com/en-us/azure/devops/repos/git/ignore-files?view=azure-devops&tabs=visual-studio.
Procedure
1. In Team Explorer, edit the .gitignore file located in the Ignore & Attributes Files section.
2. Add the section below at the end of the file to exclude the unnecessary files:
# OpCenter EX Foundation
**/SimaticITPackages/*
**/*UserInterface/common/*
*.um
*.umd
Available Operations
The Solution Studio home page contains cards and icons which allow you to perform the following operations:
Card Description
Create Solution Allows you to create a new solution or open the currently indicated solution and perform
all the required configurations.
If the solution is already created, the solution name will be displayed as card title.
Card Description
Create Solution Allows you to create a solution from an existing backup file.
from Backup
Documentation Allows you to access all official documentation and custom reference
Center documentation (Documentation Center).
Host Allows you to deploy a solution package on the environment hosts (Host Management)
Management and monitor the environment host status.
About Allows you to view the current Opcenter Execution Foundation version.
Avatar Icon Allows you to change the view of the Solution Studio.
• Sign out option to sign out the current signed in user from Opcenter Execution
Foundation.
• Settings
• Full Screen Mode option to view the Solution Studio in full screen.
• Command Labels option to display the name of the command icons in
Solution Studio.
Procedure
To correctly connect from the web clients to Opcenter EX FN hosts check that you have correctly executed
the following procedures:
• Configuring Microsoft ARR Load Balancer in the Opcenter Execution Foundation Installation Guide.
• Configuring the Web Endpoint settings. See one of the following sections in the Opcenter Execution
Foundation Installation Guide, depending on the configured scenario:
• Web Endpoints Parameters
• Web Endpoints Parameters for StandAlone Separate Database
• Web Endpoints Parameters for Distributed Scenario.
Should login problems occur, see also Troubleshooting Login Errors in the Opcenter Execution
Foundation Installation Guide.
Be also aware that some web browser versions need to use an FQDN name or an IP address (i.e. they must
contain a dot character in the URL).
Additionally, you can enable the minification procedure for your UI Application. Minification allows you to compress
the javascript files that are part of your UI Application by minifying them and generating a unique bundled file. This
process helps in improving the performance of the runtime application as multiple resource files are processed as
one file thus saving time and results in fast processing of the application. The minification applies to any UI
Application that is part of the Solution.
The minification procedure takes place during the Build process. If you modify this setting on an already deployed
Solution (and consequently the Minification column value in the Package Management page is not aligned with
the Enable Minification check box in the Advanced screen) you must perform a Force Build procedure to apply the
global configuration.
Available Operations
In the Solution Studio home page, you can do either of the following:
• Create a solution from scratch
• Create a solution from a previously backed-up solution
If the solution is already created, go to How to Manage the Solution.
Prerequisites
• Engineering Services are up and running.
• The user that logs in must belong to the SIT_UAF_SYSADMIN UMC predefined group, as described in the
Opcenter Execution Foundation Installation Guide.
• There are no solutions present. Any existing solutions must be deleted in order to create a new one.
Procedure
1. From Solution Studio home page click Create Solution.
2. In the Create Solution pane, insert the name you want to assign to the solution and, if required, a description
with additional information. The description can be modified later.
3. Click Create. The new solution is displayed in the Solution Administration page. You can now add Apps to your
solution by navigating to the App Management page.
Workflow
1. Restore the backup.
2. Only for earlier versions, update the solution apps to the current platform version.
Prerequisites
• There are no solutions currently loaded. If there is one, it must be deleted. If required you can make a backup
copy of the solution.
• If you want to restore the MOM Solution database on a new database machine, restore its backup file as usual
but remember to also configure the database ownership if you are on a SQL Server instance.
• You have saved the backup files of the solution you want to restore in %SITUnifiedSystemData%
\Engineering\Packages\Solutions.
• If the backed-up solution references other Apps/Functional Blocks, copy the App/Functional Block packages
(including the System App and the SITUASys Functional Block, if referenced) to the required destination
folders.
• If you want to be able to further develop code, also copy the project model files (.um, .umd and .dll) from the
ExtensionApps/Apps/Functional Blocks to the required destination folders.
*.dll %SITUnifiedSystemData%
\Engineering\Dev\ModelBin
Restore Role Associations to Users/ To maintain the previously defined UMC configurations
Groups concerning associations between roles and users/groups. This
option is useful if you are creating the solution in the same
environment where you created the solution backup file. In this
way you can manage more than one solution in the same
environment. If the package is restored in a different
environment with a different UMC domain (i.e. different from the
one where it was first created) and you select the Restore Role
Associations to Users/Groups option, some user or user group
IDs may correspond to different users/groups. Consequently, to
avoid misalignment, do not select the Restore role associations
to users/groups check box if you want to restore the package in
a different environment.
Restore Database Connection To restore all the previously defined database connections.
Information This option is useful if you are creating the solution in the same
environment where you created the solution backup file. In this
way you can manage more than one solution in the same
environment.
3. Select the backup file you want to restore.
4. Click Create.
behavior: the Apps that require an update are marked with the indicator, while all the other Apps
that do not show this indicator require a reload ( ).
• If you have updated any custom Apps in Project Studio, either reload them ( ) or update them (
) according to the versioning logic you have used (see Creating a New Version of Functional Block or
App and Reloading Apps and Extension Apps in a Solution).
2. If you come from version SIMATIC IT UAF 1.3 Update 4, in the Mashup page you have to open each Mashup
module, check that the wiring page is well formatted and then generate the Mashup.
3. In the UI Applications page, open any UI Applications to verify the following:
• Ensure they do not contain UI Modules that are no longer used in the updated solution. If you find any UI
Modules whose status is deleted, select them and click Unassign deleted modules. If you fail to do this,
the UI Application will be invalid.
• Add/delete the required UI Modules; for example, you can add new UI Modules in order to display any
newly provided screens.
4. Run the scripts for upgraded Apps, if you have Apps that reference the
Siemens.SimanticIT.EQU_MS 05.00.00, Siemens.SimaticIT.EQ_OP 05.00.00, Siemens.SimaticIT.TSK_MS
06.00.00, Siemens.SimaticIT.TSK_OP 08.00.00 and Siemens.SimaticIT.UDM_RF 04.00.00 Functional Blocks.
When you restore a Solution, you can choose whether to restore or not the configuration of the data
source and the configuration of the roles. If you do not restore this configuration now, remember that you
need to perform these configurations (see database connections and associations between roles and
users/groups) before deploying your Solution in Solution Studio.
Prerequisites
You can restore the Opcenter EX FN database only on an instance that has already been properly configured. See
Moving Databases to a Different Database Instance in the Opcenter Execution Foundation Installation Guide.
EXECUTE(@sqltoexec)
SELECT @sqltoexec = REPLACE(@SQL,'@LOGIN',@mandatoryDomain +
'\SIT_UNIFIED_MEDIUM_H')
EXECUTE(@sqltoexec)
COMMIT TRAN;
BEGIN TRAN
IF @optionalDomain IS NOT NULL
BEGIN TRY
SELECT @sqltoexec = REPLACE(@SQL,'@LOGIN',@optionalDomain + '\SIT_UNIFIED_LOW'
)
EXECUTE(@sqltoexec)
SELECT @sqltoexec = REPLACE(@SQL,'@LOGIN',@optionalDomain +
'\SIT_UNIFIED_MEDIUM_L')
EXECUTE(@sqltoexec)
SELECT @sqltoexec = REPLACE(@SQL,'@LOGIN',@optionalDomain +
'\SIT_UNIFIED_MEDIUM_H')
EXECUTE(@sqltoexec)
END TRY
BEGIN CATCH
IF @@TRANCOUNT > 0
ROLLBACK TRAN;
END CATCH;
IF @@TRANCOUNT > 0
COMMIT TRAN;
Available Operations
• Checking the current solution status
• Creating a backup of the solution
• Navigating to the App installation
• Checking the status of the Audit Trail App and redirecting you to the required target page.
• Checking the Maintenance Configuration status.
• Editing the solution description (by clicking Edit).
• Deleting the solution (by clicking Delete).
The Audit Trail configuration pages are visible only if you install the Audit Trail app. For more information,
see Audit Trail App in the Opcenter Execution Foundation User Manual.
Possible operations
The operations that can be performed in this area depend on the status of the solution:
A backup copy can be used afterwards to restore the previous solution in the same environment as the current
solution or to move the solution from one engineering environment to another.
The backup package does not contain Functional Block or App files or any MOM solution database backup
files. Consequently, if you archive the solution backup package in a dedicated folder or other storage media, make
sure you archive also all the Functional Block and App packages referenced by the solution.
This page describes how to create a backup of the current solution.
Prerequisites
A solution has been created.
Procedure
1. In the Solution Administration page, click Backup > Create Backup.
2. Enter the name you want to assign to the backup package, a description of its content and then click
Save. A default name for the backup package is proposed with the following format:
<SolutionName>_<date>_<time>, but you can change the proposed name.
3. Manually create a backup of the following folders, if you want to restore the solution on a different engineering
machine:
• %SITUnifiedSystemData%\Engineering\Packages\FunctionalBlocks folder to copy all referenced
Functional Block packages.
• %SITUnifiedSystemData%\Engineering\Packages\Projects folder to copy the Apps.
• %SITUnifiedSystemData%\Engineering\Packages\ExtensionProjects folder to copy the Extension
Apps.
Result
To see the newly created backup, as well as any other previously created backups, click Backup > Show
Backups.
Solution backup packages are listed in the Backups pane and the related files are located in the
%SITUnifiedSystemData%\Engineering\Packages\Solutions folder, containing:
• all the engineering configurations (i.e. Manufacturing Solution repository data, including User Roles).
• the content of the UI configurations, including Mashup UI Modules and the UI Applications (with the whole
folder content, if existing, contained in %SITUnifiedSystemData%\Engineering\Solutions\<SolutionName>).
When creating a new solution or migrating an existing one, the latest version of the System App is
automatically installed.
For more information, see System App in the Opcenter Execution Foundation User Manual.
To access this page, click the card with your solution in the Solution Studio home page, and click App
Management in the sidebar.
Available operations
• Adding an App
• Removing an App
Constraints
• A solution has been created.
• The required App packages (.zip file) must have been copied to %SITUnifiedSystemData%
\Engineering\Packages\Projects.
• The referenced Functional Block packages (.zip files) must have been copied to %SITUnifiedSystemData%
\Engineering\Packages\FunctionalBlocks.
• Apps cannot have the same App Name and different Prefix.
Supported Versions
Product Version Supported
• (*): This means that the App/Referenced Functional Block version is supported only if it has been migrated to
a 2.x/3.x version in Project Studio first.
• : This means that the App/Referenced Functional Block is fully supported.
Conflict Description
Different patch versions The Functional Block with the highest patch version number will
always be used in the solution.
Different minor versions The referenced Functional Block with the highest minor number is
used in the solution. For example, if App1 references FB_A version
02.02.00 and the user adds App2, which references FB_A 02.03.00, the
Functional Block FB_A 02.03.00 will be used in the Solution.
If there is a higher minor version of FB_A (02.04.00), but this version is
not referenced by any of the Apps in the solution, it will not be used.
Different major versions The user will be warned that there are conflicts. If the user performs
the add operation anyway, the solution will be marked as invalid, no
engineering operations are allowed and the higher version cannot
consequently be removed from the solution. The Apps must be
aligned to the higher version in one of the following ways to resolve
the conflicting Functional Block references:
• removing the App which references the lower major version of the
commonly referenced Functional Block.
• aligning the Functional Blocks references of the Apps in Project
Studio so that all Apps reference the same higher Major Functional
Block version. This operation may also require modifying the Apps
themselves in order to align them with the new Functional Block
version.
If neither of the previous operations are possible, you can recover the
last valid Solution status by restoring a previously backed up solution.
Procedure
1. In the App Management page click the Available tab.
2. Click Show all Version if you want to see all the versions of available Apps. Click Show latest
Version if you only want to see the recent version of available Apps.
3. Should a previous version of the System App be in use (example by restoring a 2.3 backup), always update it to
the most recent version.
4. Select the tile of the App you want to add, and click Install. You can now configure your Apps.
Constraints
• The App cannot be removed if any of its UI Components are used within a UI Mashup Module or if any of its UI
Modules are used within a UI Application.
• You cannot remove an App that references a higher major version of a Functional Block, if the other Apps in the
solution do not also reference the higher version, and the solution is consequently in invalid status. Once all the
Apps have been aligned to the higher major version of the common Functional Block the App can be removed.
• If two Apps reference different minor versions of the same Functional Block, and one of these Apps is removed,
the minor version of the Functional Block loaded in the solution will correspond to the version referenced by the
remaining App. For example, if a solution contains App1, which references FB_A 01.02.00 and contains App2,
which references FB_A 01.03.00, FB_A 01.03.00 will be used in the solution. If App1 is removed, FB_A 01.02.00
will then be used in the solution.
• You cannot remove an App if any of its App Extensions have been installed.
• Do not remove the System App as it is a prerequisite for building the solution.
Procedure
1. In the App Management page, select the App you want to remove.
2. Click .
Available operations
• Adding Extension Apps
• Viewing App and App Extension Details
• Reloading Apps and Extension Apps
• Updating Apps and Extension Apps
Extension Apps cannot be removed from the solution if any of their artifacts are used by a UI Application or
UI Module.
You can check this in the Where Used tab of the App Extension details.
Prerequisites
• The Extension App packages (.zip file) must be present in %SITUnifiedSystemData%
\Engineering\Packages\ExtensionProjects.
• All packages required for the Base App must be present in the required directories.
• The Base App has been compiled with the required extension option (Can Be Extended option), otherwise the
Extensions tab is not displayed.
• The Base App is installed.
Procedure
1. Click on the Installed tab in the App Management page.
2. Select the tile of the base App whose Extension App you want to add.
3. Click to open the App.
4. Click on the Extensions tab.
5. Click to load the most recent version of each Extension App.
6. Then do either of the following to add the most recent version of the Extension App:
• Select the tile of the Extension App you want to add and click .
• Click Alternative Versions , select a specific version of an Extension App and then click on the
corresponding row.
The installed Extension Apps have the indicator icon within their tile.
• Click on the Alternative Versions tab to see which other versions exist of the Extension App.
• Click on the Dependencies tab to display the Functional Blocks referenced by the Extension App and
ones referenced by the Base App.
• Click on the Where Used tab to display in which UI Components and Modules the Extension App is used.
App is applied. It is not required to reset the UI Application to get the latest update. The changes to other properties
such as custom folder, home state, order of folder and screens are also preserved.
Procedure
1. In the App Management page click the Installed tab.
2. Select the required App.
3. To reload the App, click .
4. To reload also the related Extension App, click on the selected App tile and then click the Extensions tab.
5. Click to load the most recent version of each Extension App. The installed Extension Apps have the
indicator icon within their tile.
6. Select the tile of the installed Extension App you want to reload and click .
Constraints
You cannot update an App/Extension App with an inferior version (major or minor).
Conflict Description
Different patch versions The Functional Block with the highest patch version number will always
be used in the solution.
Different minor versions The referenced Functional Block with the highest minor number is used
in the solution. For example, if App1 and App2 reference FB_A version
02.02.00 and the user updates App2, which now references FB_A
02.03.00, the Functional Block FB_A 02.03.00 will be used in the Solution.
If there is a higher minor version of FB_A (02.04.00), but this version is
not referenced by any of the Apps/Extension Apps in the solution, it will
not be used.
Conflict Description
Different major versions The user will be warned that there are conflicts. If the user performs the
update operation anyway, the solution will be marked as invalid, no
engineering operations are allowed and the higher version cannot
consequently be removed from the solution. The Apps/Extension Apps
must be aligned to the higher version in one of the following ways to
resolve the conflicting Functional Block references:
• removing the App/Extension App which references the lower major
version of the commonly referenced Functional Block
• aligning the Functional Blocks references of the App/Extension App
in Project Studio so that all App/Extension App reference the same
higher Major Functional Block version. This operation may also
require modifying the App/Extension App themselves in order to
align them with the new Functional Block version.
If neither of the previous operations are possible, you can recover the
last valid Solution status by restoring a previously backed up solution.
Prerequisites
It is recommended to save a backup copy of your solution before performing update operations as you cannot
subsequently revert to a previous version.
Procedure
1. In the App Management page click the Installed tab.
2. Select the required App and to update it, click . All the more recent versions for the selected App are
displayed in the Available Versions pane on the right. Apps which have a more recent version available have
the indicator icon within their tile.
3. To update also the related Extension App, click on the selected App tile and then click the Extensions tab.
4. Click to load the most recent version of each Extension App. Extension Apps which have a more recent
version available have the indicator icon within their tile.
5. Select the tile of the Extension App you want to update.
6. Click the Alternative Versions tab. The highest patch version for each major/minor version is displayed.
7. Select a specific version of an Extension App then click .
Result
When you update a minor version of an App/Extension App the following operations will also be performed:
• all new items are loaded
• new UI Module screens are added
• any new commands and event subscriptions are associated with the default worker role.
• all UI Applications dependent on the App/Extension App are updated with changes.
• If you have customized your UI Application in the sidebar configuration, your changes made to icon, title,
display will be retained, otherwise the latest update from the reloaded App/Extension App is applied.
• It is not required to reset the UI Application to get the latest update. The changes to other properties such
as custom folder, home state, order of folder and screens are also retained.
• any newly added screens will be added as they are.
When you update a major version of an App/Extension App the following operations will also be performed:
• all items contained in the previous version and not present in the current version are removed
• associations between deleted commands and existing worker roles are removed
• subscriptions relative to deleted events and associations between these subscriptions and the existing worker
roles are removed
• the status of UI Modules referencing deleted UI Components is set to Invalid.
• the status of UI Applications referencing invalidated UI Modules is set to Invalid.
• deleted Modules or Screens will be removed from the UI Application.
• all UI Applications dependent on the App/Extension App are updated with changes.
• If you have customized your UI Application in the sidebar configuration, your changes made to icon, title,
display will be retained, otherwise the latest update from the reloaded App/Extension App is applied.
• It is not required to reset the UI Application to get the latest update. The changes to other properties such
as custom folder, home state, order of folder and screens are also retained.
• any newly added screens will be added as they are.
Available operations
• Configure command settings
• Configure protected command settings
• Manage App Extensions
• Configure event subscriptions
However, it is possible to create new worker roles, and assign commands to this worker role and modify
the command execution timeout for individual commands, overriding the default settings of its worker role.
When an App is reloaded or updated, these modifications are maintained, except in specific cases described in
Reloading Apps and Extension Apps in a Solution and Updating Apps and Extension Apps in a Solution, and any new
commands are added to the default worker role.
If you enable the Advanced Configuration option in the Solution Studio settings, you can also see protected
commands, that have not been published in the Public Object Model, and you can modify their command execution
timeout value and worker role.
You can also enable or disable Pre-Checks previously defined in Project Studio for Public and Composite
Commands belonging to Base or Extension Apps.
These Pre-Checks can be used to implement conditions that determine the execution, or the non execution, of a
command. This additional code is executed at the beginning of the command logic, performing required checks
before the command execution.
Depending on the Pre-Check behavior you have configured, at the first Pre-Check failure:
• the Pre-Check execution stops, according to the stop and fail behavior (default).
• all Pre-Checks are executed anyway, according to the fail and proceed behavior.
The command will be executed after the success of all Pre-Checks.
This functionality allows you to reuse existing commands by simply enabling or disabling the Pre-Checks, without
rewriting business logic.
You can also enable or disable Post-Actions previously defined in Project Studio for Public and Composite
Commands belonging to Base or Extension Apps. Post-Actions belonging to Protected Commands can be only
configured via script (for more information about the configuration, see How to Manage Post-Actions via Scripts in
Opcenter Execution Foundation Installation Guide) .
Constraints
A command cannot be associated with two worker roles at the same time. However, when you import a protected
command in the POM Model, the published command and the original protected command of the Functional Block
are two distinct artifacts although they trigger the same business logic. Consequently they can be associated with
different worker roles as well as with the same worker role.
2. In the App Configuration page, click on the Commands tab: the commands that are already associated with
the current worker role are displayed.
3. Select the commands whose association you want to modify, proceed in either of the following ways and when
finished click Save to apply the changes:
• click > Move Commands To An Existing Worker Role to select an existing worker role and then
select the required worker role from the list box.
• click > Move Commands To A New Worker Role to create a new target worker role for the selected
commands and enter the following information:
Parameter Description
Name Enter a meaningful name that allows other users to easily identify the
worker role.
Execution Mode Set the Execution Mode either to Parallel or Sequential, according to
the required execution logic (see Parallel vs. Sequential Command and
Event Handler Execution). If Sequential mode is selected, some other
configuration options are automatically set by the system and cannot
be modified (i.e. the retry number will be set to 0, and the number of
instances will be set to 1).
For more information, see Command Retry Management.
Deployable Select the Deployable check box to include the worker role in the
deployment package and make it ready for execution on the Runtime
hosts. If no commands or event subscriptions are assigned to the
worker role, it will not be included in the deployment package even if it
has been flagged as deployable.
Number of Instances Specify the number of instances to be created for each worker role, if
the worker role has been flagged as deployable.
Target CPU (Only if you are creating the Worker Role from the Worker Roles page)
Select the Target CPU architecture type for the worker role from the
drop down list.
This option is not available if you are creating the Worker Role
either from the App Configuration page or from the Protected
Commands Configuration page. In these use cases, if you
select a command, the target CPU of its Command Handler will
drive the Target CPU of the created Worker Role (in particular,
if the selected commands have either anyCPU or x64, the
created Worker role will be x64, on the contrary if the selected
commands have either anyCPU or x86, the Worker Role will be
x86). Be aware that if you select commands with x86 and x64
CPU, it will not be to possible create any Worker Roles for
moving the commands.
Parameter Description
Retry Number Enter a retry number to specify the maximum number of times the
execution of a command will be retried before failing. Possible values
range from 0 to 5, the default value is 3. This behavior is then applied to
all commands assigned to the worker role, but this can be overridden
for specific commands in the commands tab.
Command Timeout Enter a command execution timeout value in seconds. Possible values
range from 10 seconds to 3 hours (10800 seconds), the default value is
30 seconds. This behavior is then applied to all commands assigned to
the worker role, but this can be overridden for specific commands in the
commands tab.
and click .
2. In the App Configuration page, click on the Commands tab.
3. Click the icon next to the Public/Composite Command for which Post-Actions configuration you want to
modify. This icon is displayed only if a Post-Action (or a Pre-Check) has been defined for the command. The
system displays the related list of Post-Actions (as well as the list of Pre-Checks) according to the order of
execution.
4. Click Configure.
5. In the Pre and post execution configuration pane, open the Post-Actions tab.
6. If you have set Post-Actions as optional in Project Studio, enable or disable the Post-Action execution within the
Post-Actions area according to your needs.
Post-Actions which have not been set as optional in Project Studio are mandatory by default. So, they
cannot be edited and will be always executed.
7. If needed, modify the order in which the Post-Actions will be executed by moving them within the Post-
Actions area. If a Post-Actions panel has this icon it means that it has still the default order ( i.e. -1 value in
Order Execution field ).
8. Click Save. The Post-Action configuration is persisted in the system, including the Post-Actions which you have
not changed.
Constraints
• A command cannot be associated with two worker roles at the same time. However, when you import a
protected command in the POM Model, the published command and the original protected command of the
Functional Block are two distinct artifacts although they trigger the same business logic. Consequently they can
be associated with different worker roles as well as with the same worker role.
• You can associate with a worker role only protected commands that have been compiled in MS Visual Studio to
run on the same, or on any, target platform. For example, if you have selected the x86 option as worker role
architecture type, you can associate with it only commands compiled to run on a 32 bit, or on any, target
platform.
Prerequisite
Protected commands are visible in Solution Studio only if the Advanced Configuration mode has been enabled in
the How to Configure Solution Studio Settings page.
Name Enter a meaningful name that allows other users to easily identify the
worker role.
Execution Mode Set the Execution Mode either to Parallel or Sequential, according to
the required execution logic (see Parallel vs. Sequential Command and
Event Handler Execution). If Sequential mode is selected, some other
configuration options are automatically set by the system and cannot
be modified (i.e. the retry number will be set to 0, and the number of
instances will be set to 1).
For more information, see Command Retry Management.
Deployable Select the Deployable check box to include the worker role in the
deployment package and make it ready for execution on the Runtime
hosts. If no commands or event subscriptions are assigned to the
worker role, it will not be included in the deployment package even if it
has been flagged as deployable.
Number of Instances Specify the number of instances to be created for each worker role, if
the worker role has been flagged as deployable.
Parameter Description
Target CPU (Only if you are creating the Worker Role from the Worker Roles page)
Select the Target CPU architecture type for the worker role from the
drop down list.
This option is not available if you are creating the Worker Role
either from the App Configuration page or from the Protected
Commands Configuration page. In these use cases, if you
select a command, the target CPU of its Command Handler will
drive the Target CPU of the created Worker Role (in particular,
if the selected commands have either anyCPU or x64, the
created Worker role will be x64, on the contrary if the selected
commands have either anyCPU or x86, the Worker Role will be
x86). Be aware that if you select commands with x86 and x64
CPU, it will not be to possible create any Worker Roles for
moving the commands.
Retry Number Enter a retry number to specify the maximum number of times the
execution of a command will be retried before failing. Possible values
range from 0 to 5, the default value is 3. This behavior is then applied to
all commands assigned to the worker role, but this can be overridden
for specific commands in the commands tab.
Command Timeout Enter a command execution timeout value in seconds. Possible values
range from 10 seconds to 3 hours (10800 seconds), the default value is
30 seconds. This behavior is then applied to all commands assigned to
the worker role, but this can be overridden for specific commands in the
commands tab.
Event subscriptions can be configured either in Solution Studio by directly associating events with event handlers
or within the Apps in Project Studio, in the predefined event subscriptions.
Once configured in either of the two ways, event subscriptions must be assigned to one or more worker roles.
Predefined subscriptions are loaded together with the App in Solution Studio, and are directly associated to the
default worker role and are read-only. These subscriptions can be assigned to different or even no worker roles, but
they cannot be modified or deleted.
The association between event subscriptions and worker roles is not unique: different worker roles can receive the
same event and execute the same logic.
You can also implement event subscriptions inside a third-party application through
the IUnifiedSdkLean interface.
Configuration workflow
Procedure
1. In the App Management page, click the App tile whose configuration you want to modify and click .
2. In the App Configuration page, click on the Event Subscriptions tab: the predefined event subscriptions that
are already associated with the current worker role are displayed, but cannot be modified.
3. Click Add Event Subscription Here (or click if an item is already present in the page).
4. In the New Subscription pane, in the Properties tab enter a name and description that identify the
subscription.
5. Select Show valid events only if you want to display only the events that are already associated to a handler
and that can be consequently assigned to the worker role as valid event subscriptions. If you clear the check
box, you will also display the events that are not associated to any handler (and that cannot be used in an event
subscription because there is no business logic to be triggered).
6. Click on the Event browse button to view available events in the Select Item dialog box, where you can filter
and sort results.
Name Enter a meaningful name that allows other users to easily identify
the worker role.
Deployable Select the Deployable check box to include the worker role in the
deployment package and make it ready for execution on the
Runtime hosts. If no commands or event subscriptions are
assigned to the worker role, it will not be included in the
deployment package even if it has been flagged as deployable.
Number of Instances Specify the number of instances to be created for each worker role,
if the worker role has been flagged as deployable.
Parameter Description
Target CPU (Only if you are creating the Worker Role from the Worker
Roles page) Select the Target CPU architecture type for the worker
role from the drop down list.
Retry Number Enter a retry number to specify the maximum number of times the
execution of a command will be retried before failing.
Possible values range from 0 to 5, the default value is 3. This
behavior is then applied to all commands assigned to the worker
role, but this can be overridden for specific commands in the
commands tab.
• modify its description, filter and worker role by selecting the event subscription and clicking .
• unassign the event subscription from the worker role, by selecting the event subscription and clicking .
To be authorized, users must be associated to roles. Roles represent groupings of permissions used to set
constraints on the operations that users are allowed to perform within the Manufacturing Solution. For the list of
object types and operations you can associate to roles, see Modeling Roles.
This authorization method is valid for Web Applications that access the Opcenter EX FN Service Layer by means of
the UI Framework infrastructure, which is made available by Project Studio.
Alternatively, Web Applications that interact with the Opcenter EX FN Service Layer but that do not use the UI
Framework infrastructure, can be authorized through a valid access token.
Role Description
SignalRulesAdmin This role is associated to the management of Signal Rules in the Signals
App.
Account associated to this role can view, create, modify, import, export,
approve and deploy Signal Rules.
SignalRulesEngineer This role is associated to the management of Signal Rules in the Signals
App.
Account associated to this role can view, create, modify, import and
export Signal Rules.
Role Description
SignalRulesViewer This role is associated to the management of Signal Rules in the Signals
App.
Account associated to this role can view Signal Rules.
User-defined Roles User-defined roles which group permissions required to access the
application data model (read entities, invoke commands, subscribe to
events or signals, display UI screens). These roles are created either in the
Apps or in Solution Studio, and are always applied to the solution you are
configuring. If you load an App containing one or more predefined roles
that match the authorization requirements of your Solution, you do not
have to create and configure other roles in this page.
This role does not allow access to Solution Studio.
Pre-defined user roles, created in Project Studio, cannot be modified in
Solution Studio.
RemoteSystemCall This role is associated with the system certificate required to invoke
remote artifacts and it is created by the Opcenter Execution
Foundation Configuration tool, both in fresh installation and when
migrating from a previous product version.
Account associated with this role can access the remote App backend and
invoke commands and read entities. You don't need to assign users or
groups to this role. You cannot delete the role but you can only modify it
by assigning additional function rights or unassigning the existing ones.
UserPreferences This role is associated to the management of the user preferences and, in
particular, to the possibility of saving the changes applied to the view of
tables, grids or columns within UI screens.
Available operations
• View users and groups
• Configure roles
For more information on creating users and groups, refer to the UMC documentation (i.e. UMC Web UI User
Manual and UMX User Manual).
Procedure
1. Click Account in the sidebar and then select either Users or Groups.
2. Select the user/group whose details you want to view.
3. Click Details: the name and assigned roles are displayed.
Workflow
1. Create user-defined roles from scratch, by copying existing roles or by using predefined roles (i.e. roles
configured in Apps).
2. Assign rights to roles according to their category (entities, reading functions, commands, events, signals,
screens).
3. Assign users/groups to roles.
4. Apply changes to runtime hosts.
System roles, identified by a lock icon, cannot be edited, configured or deleted, but only assigned to users/
groups.
Prerequisites
The artifacts displayed on this page must have been flagged as securable during the development phase in Project
Studio (or Solution Studio for Mashup Module screens).
By default only commands and entities that have been imported into the POM model of the App they belong to are
displayed. However, if the Advanced Settings option has been enabled, protected commands and entities of
referenced Functional Blocks are also listed and can be configured for compatibility purposes.
If the referenced entities and commands have been also imported to the POM Model (and the Advanced
Settings option is enabled), protected commands and entities imported to the POM Model appear in the
list both with the name used in the Functional Block and with the name assigned in the POM Model. These
objects are handled within role configurations as autonomous, distinct securable objects and you can
consequently configure them separately.
Procedure
1. Click Account in the sidebar and then select Roles.
2. Click the role tile for the role you want to assign rights to and click .
3. In the Roles pane, select the category tab of the artifacts you want to assign to the role.
4. In the desired tab, do one of the following:
• If no rights are assigned, click Assign Entities / Assign Commands / .... Assign <Artifact type> (the name
of the button depends on the type of rights you are associating) and select the artifacts from the list.
• If any rights are already present, click to add any new right or select a right and click to remove
the association.
• If all rights for a certain artifact type have been assigned during the role creation, by means of the Grant
Full permission option, and you now want to override the configuration, click Assign Rights and select
the single permissions you want to assign. In this way, the previous list will be completely removed and
only the newly selected permissions will be displayed. For this reason, a warning message is displayed,
advising you are about to change the configuration.
5. Click Assign.
Procedure
1. Click Account in the side bar and then select Roles.
2. Click the role tile for the role you want to assign users or groups.
3. Click to assign users/groups: a pane opens with the list of users/groups configured in User Management
Component (for more information, refer to User Management Component documentation).
4. Click on either of the following tabs:
• Users
• Groups
5. Click Assign Users / Assign Groups and select the required user or group. You can select multiple users or
groups simultaneously.
6. To confirm the association, click Assign at the bottom of the pane.
If one of these prerequisites is not satisfied you must redeploy the solution.
Prerequisites
• The solution has already been deployed on a target environment and at least one of its hosts has been run once.
• There are no running hosts in errors.
• The Apps or the Extension Apps inside the Solution have not been reloaded, updated or deleted (this is required
because the commands, events and signals must be the same as the previously deployed ones).
Procedure
1. In the Roles page, click to deploy the new configuration on all running hosts.
2. Verify that no error messages are displayed in the host tiles in the Host Management page, to make sure that
your changes have been applied successfully.
• UI Applications
Available operations
1. Managing SWAC components and their manifests.
2. Designing Mashup UI Modules.
3. Configuring the final UI Application by combining the Mashup UI modules (and the UI Modules created in MS
Visual Studio).
Procedure
1. In the SWAC Components page click New.
2. Select the .json descriptor of the SWAC component from the drop down list by browsing to the proper file. Its
name is displayed read-only in the Name field.
3. Enter a title for the SWAC Component, which will be displayed in the toolbox.
4. Enter the ID of the icon, which will graphically identify the SWAC component. Start typing the icon type (e.g. svg)
to browse the available list.
5. Define the height of the SWAC Component by specifying the default number of rows.
6. Define the width of the SWAC Component by specifying the default number of columns.
7. Click Save. The imported SWAC Component is displayed as a tile, with the following information:
Where Used Mashup UI Screen The Mashup UI Screen where the SWAC
component has been used.
View SWAC Component details by clicking , or modify the SWAC Component by clicking Edit.
Procedure
1. In the SWAC Components page, select the tile of the SWAC component whose manifest needs to be migrated.
Prerequisites
The SWAC Component manifest must have been migrated to the current version.
Procedure
1. In the SWAC Components page, select the tile of the SWAC component whose manifest needs to be reloaded.
2. Click Reload.
3. Select the required manifest from the SWAC Manifest drop down list.
4. Click Save.
Prerequisites
The SWAC Component manifest must have been migrated to the current version.
Procedure
1. In the SWAC Components page, select the tile of the SWAC component whose URL needs to be modified.
2. Click : the name of the component and its current URL are displayed.
3. Enter a new URL.
4. Click Save. The SWAC manifest, available in the Engineering repository, is updated, along with the Mashup
manifest, if the component has been used within a module.
Workflow
1. Create a Mashup UI Module
2. Design UI Screens
3. Test and generate the Mashup UI Module
Status Description
Invalid A new major version of an App has been reloaded, and one of its UI
Components used in the UI Module has consequently been modified or
deleted.
3. If required, you can provide a new name, title and icon for the new module, and decide whether it will be
securable or not.
4. Click Save.
To export a UI Module simply select it in the Mashups page, click Export and select which screens you
want to export together with the UI Module.
Workflow
1. Create additional UI Screens.
2. Manage the layout.
3. Add UI and SWAC Components.
4. Connect the Components.
5. Set parameters and contexts.
If a Mashup UI Module has only one screen, this screen can be modified by clicking on the icon in the
tile.
If it contains more than one screen, the pencil icon is not visible, and you must click on the icon to
open the UI Screen page, where you can create, modify, copy, or delete the UI Screens in the module.
1. In the Mashups page, click the module tile which contains the screen you want to copy and click .
2. In the UI Screen page of your selected module, click .
3. If required, modify the following fields:
Field Value provided
Procedure
1. In the Mashups page, click the Mashup UI Module tile containing the required screen and click .
2. In the UI Screen page click the screen row you want to modify and click .
3. Click on the Layout Design tab.
4. Use the following command bar buttons to customize your layout:
Configure Layout Design Displays the Configure Layout Design Properties side
Properties panel. The available settings are:
• Number of Columns: the number of columns displayed
in the working area. Default: 12 columns.
If you change the number of columns in a populated UI
Screen, the Mashup Editor will attempt to scale
components accordingly. In some cases this may lead to
the incorrect placement of the components on the
working area, and therefore manual rearrangement may
be required.
• Vertical Margin: the distance (in pixels) between each
component (y axis), when displayed at runtime.
• Horizontal Margin: the distance (in pixels) between
each component (x axis), when displayed at runtime.
• Allow components to be moved and resized at
runtime: if enabled, it will be possible to rearrange and
resize components at runtime but the Pushing, Floating
and Swapping toggles will be disabled.
• Outer Margin: if enabled, the values previously set for
the vertical and horizontal margins around each
component, will also be applied to the whole Mashup
canvas at runtime.
• Enable responsive mode: if enabled
• For small devices: it identifies the threshold
below which the components will be stacked in a
single column.
Default width: 768 pixels, minimum value: 320
pixels.
• For medium devices: the layout of the
components will depend on the user's
configuration of the selected components and
screen size. For example, if the width of a
component is set to less than half of the screen
width value, then two components will be
viewed alongside each other in one row. If the
width is set to more than half of the screen width
value, then only one component will be viewed
on the row.
Default width: 1024 pixels, minimum value: 769
pixels.
Toggle Floating Automatically places the components at the top of the grid if
there is space available.
Toggle Gridlines Shows the lines between rows and columns in the grid.
Prerequisite
SWAC Components are available for UI screens if they have been previously imported to Solution Studio
(see Importing SWAC Components).
Procedure
1. In the Mashups page click the required module tile and click .
2. In the UI Screen page, click the screen you want to configure and click .
3. Click on the UI Components tab in the toolbox on the right-hand side, and drag and drop the required UI
Components onto the working area.
4. Click on the SWAC Components tab in the toolbox on the right-hand side, and drag and drop the required SWAC
Components onto the working area.
5. Locate and resize the Components in the available space according to project requirements.
6. Set the default properties for UI Components by selecting the UI Component in the working pane, clicking on
the UI Component Properties tab in the side bar and defining default values for the properties contained in the
Component in the Model area. Any category properties defined for the UI component can be viewed.
The properties for SWAC Components are not displayed in this tab. However, if you need to set default
values you can manually modify the SWAC Component Manifest, and reload it.
• Parameters are used to define inbound data, when navigating to a Mashup Screen.
• Contexts are used to define outbound data, when navigating from a Mashup Screen. Contexts are automatically
transformed into parameters when you are connecting to a new screen, as they then become inbound
parameters.
Procedure
1. In the Mashups page click the required module tile and click .
2. In the UI Screen page, click the screen row (whose parameters and contexts you want to configure) and click
.
3. Click the Wiring tab.
4. Click to configure Mashup Module parameters.
5. To define new parameters:
• Click the Parameters tab.
• Click Add New Parameter.
• Define the name, type and default value for the inbound parameter from the screen you are navigating
from.
• Click Save.
6. To define new contexts:
• Click the Context tab.
• Click Add New Context.
• Define the name, type and default value for the outbound parameter for the screen you are navigating
to.
• Click Save.
7. Click .
Procedure
1. In the Mashups page click the required module tile and click .
2. In the UI Screen page, click the screen row and click .
3. Click the Wiring tab.
4. To configure the UI Screen parameters and properties, click the button and set the following parameters
for each new item:
Parameter Description
Parameter Description
5. Click the button to define a new wiring among the selected components: the system prompts you to enter
both a name and a description that, once inserted, cannot be modified.
You change change the order in which wires are displayed by dragging and dropping them.
6. The system automatically groups and displays the selected components in the Components tab within the
sidebar according to their possible role:
• only input (components raising events).
• only output (components exposing methods).
• both input and output (components raising events and exposing methods).
Move the components to the working area, the system helps you locate them correctly by highlighting
the proper column (or columns).
If you have configured at least one parameter or context for the UI Screen, a system UI Component
(called Mashup System Component) is also displayed in the Input-Output Components list. Move it to
the working area if you want to use it to define your navigation logic.
7. Select the output component relative to each connection you want to configure.
8. In the Configuration tab, configure the module behavior, establishing a mapping between the events exposed
by the input component (Source Event parameter) and the methods exposed by the output component
(Destination Method parameter).
9. If the type of the event and the command parameters are different, or if you want to customize the conversion
mode, type the relative code in the Code tab.
Since the system does not perform any checks on the Javascript code, entering incorrect code could
break:
• wiring
• Mashup UI Module
• any UI Application using the Mashup UI Module containing incorrect code
The following image displays the wire configuration of a Mashup UI Module containing a button as input
component and a grid as output component: whenever the user clicks the button, the grid content is updated
through the refresh command.
If necessary, the system prompts you to configure the parameters required by the selected event and/or command,
displaying them in the Standard tab.
If, in the example above, you select the sortOrders command instead of the refresh one, you must select the field
to be used to sort data (in this case, Id).
setContext
This method can be called to change the value of one or more contexts defined for the screen.
Its parameters are dynamic, as they depend on the screen whose context you want to change.
navigateTo
This method can be called to navigate to another screen in a UI Application.
It contains the following parameters:
display
This method can be called to show/hide specific instances of components included in the screen.
It contains the following parameters:
setPosition
This method can be called to define the physical position and size of a component in a screen.
Ensure your configuration maintains the component within the grid and doesn't overlap other
components.
onLoaded
This event is triggered when you navigate to the screen corresponding to the Mashup UI Module.
It contains the following parameters:
onContextChanged
This event is triggered when any of the screen contexts changes.
It contains the following parameters:
• navigateTo method
See Mashup System Component Methods and Mashup System Component Events for details.
Prerequisites
You have created a UI Module which includes the following UI Components:
• materialFilter, a list box displaying material data, that is used to provide a filter for the orderGrid component.
• orderGrid, a grid suitable to display order data, optionally filtered by material.
• navButtons, a set of buttons.
Configuration Procedure
1. In the Mashups page click the required module tile and click Open.
2. In the UI Screen page, click the screen row and click Open.
3. Click the Wiring tab.
4. Click the button, and:
• in the Parameters tab, define the MaterialId parameter with number type.
• in the Context tab, define the OrderId with string type and the MaterialId with number type, leaving
the default values empty.
5. Wire the components as follows:
Wiring Result
Wiring Result
Runtime Behavior
At runtime the configured wirings are activated as follows:
1. When the user navigates to the UI State through the relative url (for example, <server>/myscreen1?
MaterialId=73), the onLoad event is triggered passing the value of the MaterialId parameter in input to the
materialFilter list box.
2. When the value of the MaterialId parameter changes to 73, the onMaterialChanged event is fired and then,
consequently to the configured wiring, the following methods are called:
• setContext, setting the value of the UI Module MaterialId property to 73.
• loadOrdersByMaterial, loading the orders filtered by the specified material ID in the orderGrid grid.
3. When the user selects an order in the orderGrid grid (for example A0042), the onOrderChanged event is fired
and then, consequently to the configured wiring, the following methods are called:
• setContext, setting the value of the UI Module OrderId property to A0042.
• displayOrderButtons, displaying a set of buttons dedicated to perform operations on orders.
4. When the user clicks a button, the onButtonClicked event is fired thus calling the navigateTo method, as
configured in the wiring. This method, displays another UI State of the UI Application, passing a url that contains
the values of the properties saved in the UI Module context (for example, <server>/myscreen2?
MaterialId=73&OrderId='A0042').
Constraints
• The Test Run operation will attempt to deploy a test UI Application on the current host, and it will work only if
the engineering service layer is running on the current host.
• In some circumstances the Test Run may fail if access to some files on the web server are blocked by a process
or by IIS itself. If this should happen try executing the Test Run again.
Procedure
1. In the Mashups page select the module you want to test.
2. Click : the system creates and deploys a test UI Application containing the UI Module you have configured
and prompts you to open it in order to verify the UI Module before deploying the whole solution.
3. Once you are ready to generate the Mashup UI Module, select it again in the Mashups page.
4. Click : the system displays a message informing you that the operation has been completed successfully
and sets its status to Generated.
Workflow
1. Create a UI Application. For more information on the home page and the Navigation menu visualization, see
Home Cards and Navigation in the Opcenter Execution Foundation User Manual.
2. If required, modify any UI Application properties (for example, to apply Multilanguage).
3. Select the UI Modules.
4. If required, configure the UI Application menu.
5. Test the UI Application.
6. If required, reset the UI Application. This discards all the user configurations and reverts all apps to their original
configuration.
UI Application Lifecycle
Status Description
Status Description
Ready All the UI Modules in the UI Application are in Generated status and the
application can be deployed.
If one of the UI Modules reverts back to Editing status, the application will
also revert back to Editing status.
Invalid A new major version of an App has been reloaded, and one of the UI
Components used in the UI Application has consequently been modified or
deleted.
Localization
In case of localization, it is mandatory to set the proper languages as described below, and modify the UI
Application properties in order to define the UI Framework Localization Master app (see Modifying UI
Application Properties).
In case of localization of system apps, see How to Use Opcenter Execution Foundation in Multilanguage.
In case of localization of custom apps, the resources must have been translated and saved in the App
project files (see Localizing Custom UI Apps and UI Framework Resources).
The required language is selected at login from the User Management Component (UMC). For detailed
information on how to perform this operation, see the relative documentation.
5. Select Deployable if you want the UI Application to be included in the final deployment package. Only UI
Applications in Ready or Deployed status can be effectively deployed.
6. Select DataSegregation to display the data segregation tags assigned to the user in the runtime application.
This option is available only if the Data Segregation App is installed in the solution (for more
information see Data Segregation App in the Opcenter Execution Foundation User Manual). If the option
is selected, and the Data Segregation App is then removed from the solution, the option will be reset.
7. If necessary, change Home Page Type by choosing one of the following options:
• Single Page with Quick Search (selected by default): The Home page contains the Home Cards on the
top and the Home Tiles below. The Search filter is available on top of the page to filter by the Home Tiles.
• Multi Page: The Home Page contains the Home Cards only. When the user clicks on a Home Card, a new
page is shown with the Home Tiles of the associated UI Screens.
• Custom: A UI Screen is set as Home page. In this case no Home Cards or Home Tiles are present.
8. If necessary, change settings for Home Page Configuration, not applicable to the Custom Home page. You can
choose either of the following:
• Configuration per Top Menu (selected by default): In the Home page, the configured categories are
displayed as Home Cards and the associated screens are displayed as Home Tiles. You can view the
configured categories in the sidebar menu. The side bar will also have the same menu structure as the
home page (categories > associated screens).
• Configuration per Menu Item: In the Home page, the categories that are associated with a screen are
displayed as Home Cards and its corresponding screens are displayed as Home Tiles. The side bar
displays the associated modules and corresponding screens.
For more information on the home page configuration types, see Home Cards and Navigation in
the Opcenter Execution Foundation User Manual.
9. If necessary, choose a different Home Card in the Default Home Card category list. This setting can be applied
only if Home Page Type is either set to Single Page with Quick Search or to Multi Page.
10. Click Create.
Copying a UI Application
1. In the UI Applications page click .
2. Modify the values proposed for the new Application as required, such as the title or languages.
3. Click Save. It will be saved in the UI Applications page, together with all its copied modules.
Importing a UI Application
Previously exported UI Applications can be imported into the solution. UI Applications are exported by selecting
them in the UI Applications page, and clicking .
Procedure
1. In the UI Applications page select the required UI Application.
2. To modify the UI Application properties, click .
3. Modify the needed information for Title, Theme, Logo, Log Level, Languages, UI Framework Localization
Master, Deployable, Home Page Type, Home Page Configuration, Default Home Card. See Creating a UI
Application for the description of the UI Application properties while for UI Framework Localization Master
see below.
4. Click Save.
Prerequisites
• The UI Module ExportImportAdmin must be associated to the selected UI Application in order to import and
export the related entities and instances.
• Only UI Modules in generated status can be added to a UI Application.
Procedure
1. In the UI Applications page, click the UI Application tile and click .
2. Click Associate UI Modules (if no modules are associated yet) or click .
3. In the Associate UI Modules pane select the required UI Modules, from among those included in the entire
Solution, and click Associate.
4. Click Save.
Procedure
1. In the UI Applications page, click the UI Application tile whose menu you want to configure and click .
2. If modules are present, click to configure the sidebar menu.
3. In the Sidebar Configuration pane, select the folder or screen you want to modify and set the following
parameters:
Parameter Description
Title Enter a title for the folder or screen as required. (The title for the
categories in case of per top menu configuration cannot be
modified).
Note: If the title is edited by the user, the runtime application
displays the edited title in the Navigation sidebar and the home
page. The title will not be translated in such a scenario.
Note: If you have chosen the Custom Home Page Configuration, in
order to have the Custom Folder and Screens properly translated,
you need to provide here a valid resource key.
Header (Read-only) Translation key for the screen title. The key must be
present, together with the required translation, in the application
translation file.
If there is no key provided in this parameter, the Runtime
application displays the value defined in the Title parameter.
Note: This parameter is not available if you have chosen a Custom
Home Page Configuration and you have selected a Custom Folder
or you have chosen Per Top Menu and you have selected a
Category.
Parameter Description
Icon Choose an icon from the provided list. Only svg icons are visible in
the UI Application sidebar.
• A Category or a Folder must have cmd icon.
• A Screen must have type icon.
Show in Home Page Select whether or not to display the category, folder or screen in
the runtime UI Application Home page and sidebar. Hidden
elements are displayed in grey in the menu, with a hidden icon
displayed next to them. Screens inherit the visibility
properties of their parent folder, so if the parent folder is hidden,
all its screens are hidden too and cannot be made visible.
Home (Valid only if you have set the Home Page Type to Custom while
Creating the UI Application or Updating the UI Application). Select
whether or not the screen will be used as the runtime application
home page. Home page screens cannot be hidden. Home screens
have a home icon displayed next to them.
Picture for the Home Page (Enabled if a Screen is selected in the Configuration per Menu
Item or a category is selected in the Configuration per Top menu,
while Creating the UI Application or Updating the UI Application
configuration). Select a Home card from the list of pre-defined
home cards.
The ProcessEngineeringFlow module is for internal use only. For this reason, we recommend that you
do not display the Process Engineering Flow element in the UI Application sidebar and do not use the
related screen as the run-time application home page.
4. In the Sidebar Configuration pane, click to create a new container folder to group screens in the navigation
menu. You can delete a Category only if it does not contain any screen. If you delete any folder, the screens they
contain will be displayed at the top of the menu at the root level, and can be reorganized under different folders.
5. Drag and drop folders and screens to change their position in the menu. Screens can also be moved into
different folders/categories.
6. Click to expand all nodes in menu configuration and click to collapse all nodes in menu configuration.
7. To reinstate the initial configuration, click on group button. Reset All will reinstate all the configurations
done by user. Reset Titles And Icons will reinstate changes in Title and Icon only.
8. Click to reinstate changes of Title and Icon in selected item.
9. Click Save when you are satisfied with your configuration.
10. Click Save and close when you are sure of the configuration and want to close the Sidebar Configuration pane.
Prerequisite
You can test the UI Application only if you are running Solution Studio directly on the Engineering host.
Procedure
1. In the UI Applications page select the UI Application you want to test.
2. Click . The system creates and deploys a test UI Application containing all UI Modules you have inserted and
prompts you to open it in order to verify the UI Application before deploying the whole solution.
During the test procedure the system deploys a test UI Application (called __TEST__) on IIS. This
application must be removed before moving to the production environment, by deleting the relative folder
from File Explorer. Client side caching of static files is not enabled for the test run.
Procedure
1. In the UI Applications page select the required UI Application.
2. Click .
3. Click Ok.
Available operations
• How to Execute Maintenance on the Live (runtime) Database
• How To Execute Maintenance on the Archiving Database
• If you are interested in rebuilding database indexes, see Managing Indexes in Opcenter Execution
Foundation.
• Refer to How to Manually Align the Live Database and the Archiving Database in case of Maintenance
configuration problems.
Opcenter Execution Foundation does not delete data from third-party databases and does not copy it to
the Opcenter EX FN Archiving database. Thus if you autonomously set up your own cleaning mechanism
for third-party databases, you should also set up your own mechanism to preserve this data.
The Maintenance Configuration becomes active only after you build and deploy the Solution.
How to archive data (from the Live database to the Archiving database)
A Maintenance Configuration can contain a Maintenance Archiving Rule, defining how often data will be copied to
the archiving database.
After your application creates, modifies or deletes an entity instance, the system replays the transaction on the
archiving database.
Besides the production data, the Archiving rule also copies the Audit Trail records and the Data Segregation Logs.
For more information, see AuditTrailRecord Entity and AuditTrailRecordCreated Event and Displaying Segregation
Tag Logs in the Opcenter Execution Foundation User Manual.
Remember that data marked as ToBeCleaned and IsDeleted is differently handled in the Runtime and
Archiving databases:
• IsDeleted: any data that has been logically deleted from the Runtime database (IsDeleted attribute)
will be also logically deleted in the Archiving database. You can physically remove this data from the
Archiving database by means of the PurgeLogicallyDeletedItems Stored Procedure (see below).
• ToBeCleaned: any data that has been marked as ToBeCleaned will be physically removed from the
Runtime database (according the defined scheduling) but will be preserved in the Archiving
database. The value of the ToBeCleaned entity attribute is not copied to the Archiving database.
Entities in In Maintenance Cleaning Rules you may select composite entities and not
composition composition parts.
A composite will be cleaned with all its parts, when all the following conditions
apply:
• the Cleaning Conditions apply to the composite and to the parts or the parts
are logically deleted
• neither the composite nor any part is locked/frozen
• neither the composite nor any part is at the One end of relationships with
other locked/frozen instances or instances not selected by rules
Facets (logical In Maintenance Cleaning Rules you may select main entities and not facets.
extension)
An entity will be cleaned with all its facets, when all the following conditions
apply:
• the Cleaning Conditions apply to the composite and to the facets or the
facets are logically deleted
• the owner entity is not locked/frozen
• the owner entity is not at the One end of relationships with other locked/
frozen instances or instances not selected by rules
Derived entities You must explicitly specify derived entities in Maintenance Cleaning Rules.
(physical
A Maintenance Cleaning Rule will just apply to the instances of the selected type,
extension)
with no impact on instances of derived entity types.
The existence of instances of other types that cannot be cleaned will not prevent
the specified entities from being cleaned.
Entities at the Selected instances at the One end of a relationship will be cleaned only after all
One end of instances at the Many end have been cleaned.
relationships
Entities at the Selected instances at the Many end of a relationship will be cleaned.
Many end of
relationships
Locked entities Locked entities cannot be cleaned and they will be ignored during the cleaning
(IsLocked) procedure, together with their parts and facets, if any.
If a locked entity is at the Many end of a relationship, the instance at the One end
will be ignored as well.
Frozen entities Frozen entities cannot be cleaned and they will be ignored during the cleaning
(IsFrozen) procedure, together with their parts and facets, unless they were logically
deleted.
If a frozen entity is at the Many end of a relationship, the instance at the One end
will be ignored as well.
Logically If you define Cleaning Conditions on logically deleted entities, they will be
deleted entities cleaned even if they had been frozen before being deleted.
(IsDeleted > 0)
Instances cannot be cleaned and will be ignored during the cleaning procedure.
Instances selected in Maintenance Cleaning Rules will be cleaned during the cleaning procedure, if no
other rows in this table prevent it.
The cleaning procedure defined within the Maintenance Configuration affects only the Runtime database.
Workflow
1. Configure the Maintenance Cleaning Conditions.
2. Configure the Maintenance Schedules.
3. Define the Maintenance Configuration.
4. Associate Entities to Cleaning Conditions and Schedules.
5. Configure the Maintenance Archiving Rule.
6. Enable the Maintenance Configuration, if it is not yet enabled.
7. Build and Deploy the Solution.
In particular, if no custom conditions are needed, an alternative basic workflow based on the built-in condition can
be followed:
The maintenance rules defined for the entities you have marked will remove them physically according to their
schedules.
The value of the ToBeCleaned attribute is not copied to the Archiving database.
Available Operations
• Creating a new cleaning condition from scratch
• Modifying a cleaning condition
• Deleting a cleaning condition
Modifying a condition
1. In the Maintenance Registry page, click the Cleaning Conditions tab.
2. In the Cleaning Conditions pane, select the row you want to edit and click .
3. Modify name or description if needed.
4. Change the condition expression, if needed.
5. Save changes.
To add new clauses click , and select whether the new clause is additional or in alternative to the
first clause by selecting And or Or. To remove existing clauses, click .
You can define up to ten clauses for each cleaning condition.
Available Operations
• Creating a new maintenance schedule from scratch
• Modifying a maintenance schedule
• Deleting a maintenance schedule
Modifying a schedule
1. In the Maintenance Registry page, click the Schedules tab.
2. In the schedules pane, select the row you want to edit and click .
3. In the Edit Schedules pane, modify name if needed.
4. Modify start date, time of the day and time zone, end date, schedule mode and recurrence according to the
selected schedule mode, if needed.
5. Save changes.
Deleting a schedule
1. In the Maintenance Registry page, click the Schedules tab.
2. In the schedules pane, select the row you want to delete and click .
Available operations
In the Maintenance Configuration page:
1. Click the Overview tab to manage the Maintenance Configuration name, description and the enabled/disabled
flag.
2. Click the Rules tab to configure the following rules contained in the Maintenance Configuration:
• Cleaning Rules
• Archiving Rule
Available Operations
• Create a new configuration from scratch
• Modify a configuration
• Delete a configuration
• Enable or disable the configuration
Modifying a configuration
1. In the Maintenance Configuration page, in the Overview tab, click .
2. Modify name or description if needed.
3. Save changes.
4. If you want to enable (or disable) the configuration, see Enabling the Configuration at Runtime.
Deleting a configuration
Prerequisites
• The maintenance configuration to contain the rules has been defined.
• Some custom maintenance cleaning conditions have been defined, if you do not want to use the built-in
maintenance cleaning condition.
• Some maintenance schedules have been defined.
Operation Description
Create a new Maintenance Cleaning Rule from To create a new Maintenance Cleaning Rule.
scratch
Modify a Maintenance Cleaning Rule To modify Maintenance Cleaning Rules by changing the
associations of entities with conditions and schedules.
Click on the arrow icon to expand the details of an entity (e.g. in case of parts of composite entities or facets).
If you select more than one entity type, one rule will be created for each selected entity type, combined
with the selected condition and schedule.
Modifying a rule
1. In the Maintenance Configuration page, click the Rules tab.
2. In the Cleaning Rule panel, select the rule you want to edit and click .
3. In the Edit Cleaning Rule pane, expand the Cleaning Conditions panel and select a different the cleaning
condition, if needed.
4. Expand the Schedules panel and select a different schedule, if needed.
5. Save changes.
You can modify multiple rules at once only if they have the same condition and the same schedule.
Deleting a rule
1. In the Maintenance Configuration page, click the Rules tab.
2. In Cleaning Rule panel, select the rule you want to delete and click .
Derived entities (physical extension) A Maintenance Cleaning Rule configured for entity types
participating in physical extension applies to the specified
entity type only. Each entity type must be independently
selected.
Facets (logical extension) A Maintenance Cleaning Rule configured for entity types with
facets applies to instances of the parent entity type and to their
facets.
Once the rule is activated, you can either suspend it, or stop it.
If you stop and start the archiving, you must manually align the database (see How to Manually Align the
Live Database and the Archiving Database), while if you suspend it and resume it, the live (Runtime) and
the Archiving databases are automatically aligned.
If you stop and start the archiving, you must manually align the database (see How to Manually Align the
Live Database and the Archiving Database), while if you suspend it and resume it, the live (Runtime) and
the Archiving databases are automatically aligned.
See How to Manually Align the Live Database and the Archiving Database to check the use cases that
require a manual alignment of the databases.
Parameter Description
Name
CorrelationId A Guid that uniquely identifies the current stored procedure execution.
Oracle example
DECLARE
CORRELATIONID RAW(200);
BEGIN
CORRELATIONID := '46456D5AA83849308B68DDAA543A0A15';
"MyMaintenanceDBArch"."PurgeLogicallyDeletedItems"(
CORRELATIONID => CORRELATIONID
);
END;
The stored procedure should be executed either by a SQL Server/Oracle Job or by a DBA.
3.11.4 How to Manually Align the Live Database and the Archiving
Database
If you have not configured and enabled Maintenance properly in your Manufacturing Solution, you must perform a
manual database alignment as described in order to ensure the system will correctly archive all the data that will be
permanently removed.
You must manually align the live and the Archiving database in the following use cases:
• if you have enabled an Archiving Rule after you have already populated the live database,
• if you have disabled the Archiving Rule and the production has proceeded in the meantime,
• if you have disabled/deleted the Maintenance Configuration containing an Archiving Rule and the production
has proceeded in the meantime.
If you need to temporarily stop the Archiving Rule, we suggest you suspend the Archive Rule and resume it
when needed, instead of disabling or deleting it. In this case, the manual alignment must not be
performed.
Provider Procedure
Provider Procedure
• Data Sources
• Worker Roles
Available Operations
Solution settings cover two main areas:
• Configuring data sources
• Configuring worker roles
If you have deployed Signal Rules in the Signals App, and subsequently change the data source, alignment
problems will occur.
Consequently, before changing the data source you must delete all the deployed Signal Rules (see How to
Manage Signals Rules in the Opcenter Execution Foundation User Manual. First ensure that you have
backed-up all the Signal Rules by exporting them, and, if you want to continue working on the same
solution configuration, re-import them after changing the data source.
Parameter Description
Data (MSSQL only) The SQL Server instance name (i.e. <SQL Server machine name>\<SQL Server
Engine instance>). If you are in SQL Server Cluster, the SQL Server instance is preceded by the virtual
Instance node.
You can create the database on a remote SQL Server instance (if this has been properly
configured) or in SQL Server Cluster (for the required procedures see the Opcenter Execution
Foundation Installation Guide). If you do not enable the SQL Server Browser service (as
described in Opcenter Execution Foundation Installation Guide), also specify the port of the
instance as follows: <SQL Server machine name>\<SQL Server instance>,<PortNumber>.
Initial (MSSQL only) The name that will be assigned to the database. It is set by default to the
Catalog Solution name.
Server (Oracle only) The Oracle server name. You can create the database on a remote Oracle
Name server (if this has been properly configured).
Schema (Oracle only) The name that will be assigned to the schema. The schema will contain all model
objects as a collection of tables/views.
It cannot contain dots (.) or begin with the letters "sys".
Connectio The timeout for the database connection (in seconds). The minimum value that this timeout
n Timeout can assume is 0, where 0 on SQL Server/Oracle means that the Connection timeout is infinite.
Consequently, if you set this timeout to 0, it means that you do not apply any timeout here
and the value of the worker role Command timeout is applied. The default value is 15
(seconds).
Command The execution timeout (in seconds) of any database statement (such as for example a Submit
Timeout or a Delete operation). This timeout must not be confused with the timeout of the worker role
Command. The timeout applied to a worker role Command refers to the entire Commands'
chain (i.e. the chain of Commands invoked by a root Command) and cannot be exceeded by
the database statement timeout. Consequently, the maximum value that you can set here for
the database statement is 3 hours (10800 seconds), which corresponds to the maximum value
of the worker role Command timeout. The minimum value that this timeout can assume is 0,
where 0 means that the Command timeout is infinite. Consequently, if you set this timeout to
0, you actually do not apply any timeout here, and the timeout of the worker role Command
will be applied. The default value is 30 (seconds).
5. Click Save.
See How to Manually Align the Live Database and the Archiving Database to check the use cases that
require a manual alignment of the databases.
Constraints:
• The archiving database is created/updated together with the Opcenter EX FN database during the
deploy procedure (see Deploying the Solution Package to Hosts), only if all these conditions are met:
• both the Opcenter EX FN database and the archiving database are configured
• the Maintenance Configuration has been enabled
• an Archiving Rule has been activated
• The archiving and the Opcenter EX FN database (live database) cannot be the same database.
• The archiving and the Opcenter EX FN (live database) must have the same data structure and the same
collation.
• Once you have configured and updated an archiving database for a live database, the archiving
database cannot be chosen as archiving database for any other live database.
• Once you have configured and updated an archiving database, this database cannot be reused as live
database.
You must define the connection string for all the external data sources from which you have imported
views during the development phase and related to the Functional Blocks specific for external data
sources you have referenced inside your Apps.
2. Click .
3. Set the following parameters by typing or selecting the required value:
Parameter Description
Possible operations
The operations that can be performed in the Worker Roles page are:
• Viewing and editing an existing worker role (to modify some of the worker role configurations).
• Creating a new worker role.
Here you cannot associate events subscriptions or commands to worker roles (or remove them from
worker roles) as this operation can only be performed in the App Management environment.
To grant high availability for this process, the system implements an active-passive hot-standby mechanism
whereby the worker instance that is executing the handlers is the active instance and the workers on the other
hosts are the passive instances (i.e. they are running but do not execute handlers). Should the active instance fail,
the infrastructure will activate one of the passive workers which starts executing the command and event
requests. During the switch-over there is the possibility that some command requests, or events, are lost. This
happens if they are queued and they go in timeout because the system was not able to unqueue them in time.
In a Stand-Alone environment, in case of a fatal error impacting the only worker role instance connected and
listening to the Manufacturing Service Bus queues, the system tries to restart the worker process anyway.
If a command handler returns a transactional error, an immediate retry is performed (see Command Retry
Management) but in case of system errors or timeouts, no delayed retry will be performed and the successive
command is directly executed.
This sequential and synchronous behavior is not optimal in terms of performance and system scalability
because sequential long running logics could act as bottlenecks.
Performance slowdown occurs also when you subscribe handlers to the CommittedEvent, because the
worker role applies logics to grant the ordering of the CommittedEvents.
Consequently, you should always carefully evaluate the logic you are planning to execute sequentially.
Moreover, bear in mind that if a command is queued in a sequential worker role, and this command waits
for the completion of another (long-running) command before it, it might go in timeout if the time in the
queue exceeds the timeout limit specified for the worker role.
To grant sequential execution of your business logic, ensure that the commands associated to a sequential
worker role are not at the same time sub-commands of other root commands, possibly associated to
parallel worker roles. In such configuration scenarios, the sequential execution will not be applied as the
same commands will be executed by different processes.
Consequently, according to the worker execution type, event subscriptions are handled as follows.
• Failure management for event subscriptions in parallel workers:
• If an event handler fails during its execution, the event is considered handled and it will not be recovered
by any retry mechanism.
• If an event handler, which is subscribed to an event together with other event handlers, fails, the other
event handlers are executed regardless of the one that failed.
• If the worker process fails while executing one or more event handlers, the pending event handlers that
are marked as IsReliable are recovered and they will be executed again, the event handlers already
completed are not re-executed, the event handlers that are not yet executed will be executed later, and
the event handlers that were in progress during the failure will be re-executed again from the beginning.
• Failure management for event subscriptions in sequential workers:
• If an event handler fails during its execution, the event is considered handled and it will not be recovered
by any retry mechanism.
• If one out of more event handlers, which are subscribed to the same event type (multiple event handlers)
fails, the other event handlers are always executed in a 'reliable' way regardless of the one that failed,
always one at a time.
• If the worker process fails while executing an event handler, the pending (partially executed) event is
recovered and it will be executed again.
• If the worker process fails while executing an event handler belonging to a multiple handler subscription,
only the pending event handlers will be recovered and executed again, the event handlers that are
already completed will not be re-executed, the event handlers that are not yet executed will be executed
later and only the event handler that was in progress during the failure will be re-executed again from
the beginning.
Procedure
1. Click Create New.
2. Enter the following parameters and then click Save:
Parameter Description
Name Enter a meaningful name that allows other users to easily identify the
worker role.
Execution Mode Set the Execution Mode either to Parallel or Sequential, according to the
required execution logic (see Parallel vs. Sequential Command and Event
Handler Execution). If Sequential mode is selected, some other
configuration options are automatically set by the system and cannot be
modified (i.e. the retry number will be set to 0, and the number of
instances will be set to 1).
For more information, see Command Retry Management.
Deployable Select the Deployable check box to include the worker role in the
deployment package and make it ready for execution on the Runtime
hosts. If no commands or event subscriptions are assigned to the worker
role, it will not be included in the deployment package even if it has been
flagged as deployable.
Number of Instances Specify the number of instances to be created for each worker role, if the
worker role has been flagged as deployable.
Parameter Description
Target CPU (Only if you are creating the Worker Role from the Worker Roles page)
Select the Target CPU architecture type for the worker role from the drop
down list.
This option is not available if you are creating the Worker Role
either from the App Configuration page or from the Protected
Commands Configuration page. In these use cases, if you select
a command, the target CPU of its Command Handler will
drive the Target CPU of the created Worker Role (in particular,
if the selected commands have either anyCPU or x64, the created
Worker role will be x64, on the contrary if the selected commands
have either anyCPU or x86, the Worker Role will be x86). Be aware
that if you select commands with x86 and x64 CPU, it will not
be to possible create any Worker Roles for moving the
commands.
Retry Number Enter a retry number to specify the maximum number of times the
execution of a command will be retried before failing. Possible values
range from 0 to 5, the default value is 3. This behavior is then applied to all
commands assigned to the worker role, but this can be overridden for
specific commands in the commands tab.
Command Timeout Enter a command execution timeout value in seconds. Possible values
range from 10 seconds to 3 hours (10800 seconds), the default value is 30
seconds. This behavior is then applied to all commands assigned to the
worker role, but this can be overridden for specific commands in the
commands tab.
Workflow
1. Create the deployment package.
2. (Optional) View deployment package details.
3. Deploy the solution package.
4. (Optional) Check Troubleshooting Deployment Operations.
5. Access the UI Application or, if needed, debug Runtime UI Applications.
Procedure
1. Click Deployment in the sidebar and then select Package Management, a grid containing the solution
sub-packages is displayed.
The Build Number column displays the number associated with the last generated package. If no
packages have been generated, the column is empty. The Minification column displays whether
minification is applied or not. For more information on minification, see How to Configure Solution
Studio Settings.
2. Click .
Result
The system updates only the packages containing new or modified data and performs the following operations:
• increases the related version (Build Number column),
• sets the status to Updated,
• performs the minification of the UI Application package based on the Advanced settings configuration,
• increases the Solution semantic versioning depending on which sub-packages have been modified as described
below:
Modified Sub-Package Increased Solution Semantic Versioning
Apps major
Maintenance major
AuditTrail major
AppLog major
Warning Message:
When specifying a list of supported languages for your UI Application, it is necessary to provide the
respective resource files in the following path:
<setup drive>:\ProgramData\Siemens\SimaticIT\Unified\Engineering\Packages\Resources.
If the resource file is not present in the above path, then the system will display a warning message
reporting the list of missing resource files. Example, if you configure the UI Application to support German
and French languages and the same resource files are missing in the above location, then the following
warning message is displayed: “The <your UI Application name> ui application resource files for de-DE, fr-
FR are not available.”
For more information see, How to Use Opcenter Execution Foundation in Multilanguage.
Available Operations
Operation Description
Procedure
1. Click Deployment in the sidebar and then select Host Management.
2. To see the details of the deployment package, click , which is visible if there is at least one package. The
following information is provided on the latest package that has been built:
• solution build name, version and solution build number
• last package update
• detailed information on all the sub-packages (such as App packages and data source configuration) that
make up the solution package.
3. To see the details of the host, select the host tile and then click . The following information is provided:
• the host name
• the host status
• the solution name
• the version number of the last deployed package
• the date/time of the last deployment operation
• the license type in use
Only if you are deploying changes regarding either UI Applications or Role management (i.e. Solution
'patch' version, described at Creating the Deployment Package), you can deploy your solution without
stopping the runtime services.
All the other changes, which correspond to the Solution 'major' version changes, require you to stop the
runtime services (i.e. stop the hosts).
As a general rule, be aware that within the same environment there cannot be hosts that run a different
build number
Consequently, the following deployment order is permitted to minimize downtime in a multi host environment: if
you have host 1, 2 and 3, you can deploy the solution on host 1 and 2 firstly and leave the 3rd host running but host
1 and 2 can be restarted only after host 3 is also aligned.
Preliminary operations
In case of database update, we suggest that you create a backup of the Opcenter EX FN database before
proceeding.
Procedure
1. If you are not deploying the solution package for the first time, make a backup copy of the Opcenter EX
FN database.
2. Click Deployment in the sidebar and then select Host Management.
3. Only in case of Major solution versions, select the runtime host(s) on which you want to deploy the solution and,
if these hosts are running, click to stop any runtime service.
4. With the host(s) selected, click . The system automatically performs on each host the following operations:
• copies all .dll files related to commands, command handlers, events, event handlers and related
endpoints into the bin folder of the deployment root directory (%ProgramData%
\Siemens\SimaticIT\Unified\Deploy\bin).
• copies the files related to signals into the Signals folder of the deployment root directory
(%ProgramData%\Siemens\SimaticIT\Unified\Deploy\Signals).
• copies all .dll files related to the data models (Opcenter EX FN and any added third-party data model)
and updates the Information Layer governance in the governance registry.
• copies the configuration of the workers and the related commands and event subscriptions.
• if the package includes at least one UI Application:
• adds the new deployment location to the IIS Configuration.
• copies the generated UI application folder structure from the UI Applications engineering location
to the UI Applications deployment location.
• sets the UI Application status to Deployed.
• if the UI Application had been previously deployed, all its files are replaced.
5. Verify that no errors are displayed in the previously selected host tiles and then click : the system creates
(or updates) the data structures in the Opcenter EX FN database (with any available default initialization values)
and, only if properly configured, it also creates and updates the archiving database.
6. After verifying that no errors are displayed in the previously selected host tiles, select them and then click
to start runtime services.
What to do next
• Proceed with either Debugging Runtime UI Applications or Accessing the UI Application.
• In case of deployment errors, see Troubleshooting Deployment Operations.
• To monitor Commands, post-actions, signals and event subscriptions that have been assigned to the worker
roles, see Monitoring Worker Runtime Instances.
• To monitor the host status, see Monitoring Hosts with Host Monitoring
Available operations
Operation Description
To exclude the selected host from the runtime scenario: the host status is
set to Offline. This operation is possible only on stopped hosts.
To enable any previously disabled hosts, select the required hosts and
click .
To view the details of the selected host. See Viewing Deployment Package
Details.
Deployment notes
Take note of the following solution deployment details:
• Business Logic: The business logic is deployed through the Application Service Layer (for the available Service
Layers, see Configuring the Opcenter EX FN Service Layer Securely in the Opcenter Execution
Foundation Installation Guide).
• SWAC components: If your App includes a UI Module and/or UI Component which has been exposed as a SWAC
Component, the related files are saved after deployment in each UI Application within the
folder %SITUnifiedSystemData%\Deploy\UI\Apps\<UIApplicationName>\<Prefix.Appname>\swac. On each
host modify the source attribute within these files as follows:
• <UIApplicationName>/swac.html/#/home/component/<AppName>/<ComponentName> for UI
Components.
• <UIApplicationName>/swac.html/#/home/<UIModuleName>/<UIScreen> for UI Modules.
• Custom index management: If you have generated custom indexes directly on the database ('custom' indexes
are indexes that have not been created in Project Studio) and the columns affected by the custom indexes must
be modified during a database update operation (i.e. by means of drop and/or alter column operations),
Opcenter Execution Foundation temporarily removes the custom indexes to correctly perform the update
database operation and then recreates them, after columns have been modified.
Workflow
1. Open the UI Application in one of the following ways:
• from Solution Studio
• from IIS
• by typing the URL in browser
2. Logon to the UI Application.
Any customizations made on the maximum age for client cache will be reset to the default value every
time a Solution is deployed. See How To Manage Time To Live for Client Cache in the Opcenter Execution
Foundation User Manual.
Procedure
1. Navigate to the home page of the deployed UI Application (Ex.: "http://.../sit-ui/runtime/(name of the solution)/
index.html#/home/").
When clicking on the icon, the systems displays on a side-pane the details about the selected host or
subsystem.
Procedure
1. Click Deployment in the sidebar and then select Host Monitoring.
2. If needed, click the information details icon to view the subsystem detail properties.
3. If needed, click the column you want to highlight to perform comparative analysis operations.
Information details
The following information is available:
• Environment details, such as the environment name, the environment configuration mode (Stand-Alone or
Distributed) and the RabbitMQ configuration mode (Cluster or Active/Standby).
• Host details, such as host name and host status with the related details, host time, and a flag indicating whether
the host is the Engineering host.
• Availability Groups, such as active Signal Manager - Rules and Timers, Sequential Worker Roles and RabbitMQ
leader instance (only if RabbitMQ was configured in Active/Standby).
• Subsystem details related to the configurations returned from the scenario subsystems (see Retrieving
Information from Scenario Subsystems).
The time differences between the environment hosts (Host Time parameter) must not be greater than 5
seconds, otherwise you may encounter system malfunctioning.
See Functional Limitations in the Opcenter Execution Foundation Release Notes for the Host Monitoring
functional limitations.
If one of the following cases occur, runtime host can be run anyway:
• the License Server is not up and running; so, licenses cannot be verified because the License Server is
not responding
• no license has been activated
• the maximum number of seats has been reached
• the license validity has expired.
In these cases, the system will return you:
• a warning message traced with both Event Tracing for Windows and Windows Event Viewer every 20
minutes; in case of Event Tracing for Windows in verbose mode, the system displays the expiration
date
• a warning pop-up in any connected UI.
Deployment A failure occurred when Connection to the file store is 1. Restore the
uploading the solution interrupted or the database connection.
package server is down 2. Repeat the deploy
operation.
Deployment A failure occurred when Access to the database is 1. Check the security
uploading the solution denied configuration of the
package from the file store system database.
2. Repeat the deploy
operation.
Deployment A failure occurred when The solution package is 1. Recreate the solution
uploading the solution not consistent package.
package from the file store 2. Repeat the deploy
operation.
Deployment A failure occurred when Some files (dlls, UI files) are 1. Stop the SIMATIC IT
copying the files to the blocked UAF Service.
deploy folder 2. Restart the SIMATIC
IT UAF Service.
3. Repeat the deploy
operation.
Deployment A failure occurred when System error (full disk, ..) 1. Disable the host.
copying the files to the 2. Analyze the error in
deploy folder the tracer and try to
solve the problem
according to its cause.
3. Repeat the deploy
operation.
Deployment of A failure occurred when Different possible causes: 1. Stop the runtime
Signal Rules deploying the signal rules services on the host
• The system cannot
and the host returns one of that returns the error.
retrieve the files from the
the following errors: 2. Start the runtime
file store or it cannot
services on the host
• Deployment of the correctly write the files on
again.
Signal Rules on the host the target host (perhaps,
failed due to problems with the
• Signal Rules package is access rights).
not aligned • The system encountered
a network disconnection
while deploying signal
rules and one or more
hosts are misaligned after
the connection is
restored.
Database The database is not If you are deploying a solution • For more information
creation/update created/updated that has already been on the destructive
previously deployed, and that changes and the
contains procedure to
potentially destructive chang temporarily allow
es within the data model, the them, see:
system will return errors. • Modifying a
Deployed
Functional
Block.
• Enabling
Potentially
Destructive
Operations
Database The database is not The connection between the 1. Disable the host
creation/update created/updated host performing the operation 2. Restore the
and the database server is connection to
interrupted or the database the database server.
server is down. 3. Enable the host
4. Repeat the database
creation/update
operation.
Database The database is not The operation is not allowed 1. Disable the host
creation/update created/updated 2. Check the security
configuration of
the database server.
3. Enable the host
4. Repeat the database
creation/update
operation.
Services start During the Start operation, Several issues can cause this Stop runtime services and
one or more workers error then:
encountered a serious
• If this operation
problem, which prevented
completes
the process from starting.
successfully, restart
runtime services.
• If the problem
persists or the host
does not stop,
analyze the log for
more details.
Services start The solution correctly Several issues may cause this 1. Stop runtime services
started on the host but later error and if the operation
one or more workers then completes
encountered a serious successfully, restart
problem which caused the runtime services.
operation to terminate. 2. If the problem
persists or the host
does not stop,
analyze the log for
more details (see
Persisting System,
Security and
Application Messages
on Microsoft Event
Viewer), then stop the
SIMATIC IT UAF
Service and verify
that no other product
processes (e.g.
workers, Service
Layers) are running.
Any runtime The system returns The This error is returned if a 1. Stop runtime services
operation High Availability Group High-Availability group fails and if the operation
has been terminated on all repeatedly and rapidly within then completes
host because it has been a system-defined time frame. successfully, restart
reached the maximum runtime services.
number of failures in the 2. If the problem
allotted time. persists or the host
does not stop,
analyze the product
logs for more details
(see Persisting
System, Security and
Application Messages
on Microsoft Event
Viewer).
For more information on the applied licensing schema, see What Is the Opcenter Execution Foundation Licensing
Schema in the Opcenter Execution Foundation Product Overview.
Services start The system returns The The PLM License Server is for 1. Check the syntax used to
host is currently not some reason unavailable while specify the License Server
connected to the PLM the host is starting up and connection string by
License Server if the host cannot be reached. opening the Opcenter
is being automatically Execution
restarted after it was Foundation Configuratio
already running (typically, n tool in edit mode, and
after you have stopped apply the criteria
the SIMATIC IT UAF described in License
Service or you have Server Connection
shutdown the machine). Configuration of the
Opcenter Execution
Foundation Installation
Guide.
2. Check that the Siemens
PLM Licence Server can
be reached on the
network.
3. Check that the Siemens
PLM Licence Server is
running (for example,
from Task Manager >
Services tab).
4. If the previous checks are
successful, restart the
host.
Services start The system This warning occurs if the 1. Check that the license file
returns Unable to acquire system cannot acquire a valid is valid (e.g. the validity is
license for SIMATIC IT license (e.g. if the license validity not expired, the
UAF. is expired, the maximum maximum number of
number of seats has been seats has not been
reached, the license type is not reached, or the license
valid for the server type and so type is valid for the server
on) or if is being manually type and so on).
restarted and it encounters one 2. Repeat all steps
of the connection problems described above for The
described above (see The host host is currently not
is currently not connected to connected to the PLM
the PLM License Server). License Server error.
For more information on the applied licensing schema, see What is the Opcenter Execution Foundation licensing
schema in the Opcenter Execution Foundation Product Overview.
Available operations
• Load product and custom documentation into the Documentation Center
• Manage documentation releases.
• Search for information in documentation.
Prerequisites
You must be a member of the Administrators group on the Documentation Center machine.
Procedure
1. Select Opcenter Execution Foundation > Documentation Center Administration from Windows Apps to open
the Documentation Center Administrator Tool window.
Only documents with the Published check box selected will be visible in the Documentation Center.
Error log
If an error occurs you can obtain further information from the log available in the following folder:
%SITUnifiedSystemData%\Documentation.
Prerequisites
You must be a member of the Administrators group on the Documentation Center machine.
Procedure
1. Select Opcenter Execution Foundation > Documentation Center Administration from Windows Apps to open
the Documentation Center Administrator Tool window.
2. From the Documents in drop-down list box select the release of interest.
3. Select one of the following commands:
• Tools > Publish Release, to publish all the documents in the selected release. If you want to publish only
specific documents within a release, firstly select the release and then select the required document in
the Published column.
• Tools > Unpublish Release, to unpublish all the documents in the selected release. If you want to
unpublish only specific documents within a release, firstly select the release and then unselect the
required document in the Published column.
• Tools > Remove Release, to remove a selected release.
clicking on .
To access the available documents, click the tile of interest and then click the icon within the tile of the
document you want to read. The document is displayed together with the following sections:
• Contents
Security Information
(version number) etc. You can further narrow down your search results by clicking the and selecting
whether to filter by Release, Document, Category, Audience and Type.
• Click on the sidebar, select the Change Theme option and then select the required theme.
Workflow
1. Download the resources from Support Center. If the required package is not present, go to Generate custom
localization packages.
2. Localize the UI Application.
Procedure
1. Access the product download center at link https://support.sw.siemens.com/en-US/
2. Browse for Opcenter Execution Foundation within the My Products tile list and click the required tile.
3. Click the Downloads tile.
4. Click the Additional Downloads tab and select Opcenter Execution Foundation Localization Resources.
Here, in the left-hand pane, you can select the product major version number and the required language.
5. Download the required zip file.
6. Unzip the localization package in a temporary folder. The zip contains the following files:
• a localization zip for each App or Extension App (e.g.
Siemens.SimaticIT.<AppName>.Resources.<Language>.<VersionNumber>.zip or Siemens.Opcenter
EXFN.<AppName>.Resources.<Language>.<VersionNumber>.zip)
• a localization zip for Solution Studio (SolutionStudio.Resources.<Language>.zip)
• a localization zip for UI Framework
(UIFramework.Resources.<Language>.<ProductVersionNumber>.zip), containing the common files
required for Solution Studio and the UI Applications.
7. Extract the localization zip for Solution Studio and UI Framework.
Workflow
1. Do one of the following
• use case a) If you are localizing the Solution from scratch, copy the localized UI Framework Resources.
• use case b) If you are migrating from a previous version, and if you want to still use the old Master App
procedure (now deprecated), prepare the UI Framework Localization Master App Zip.
• use case c) if you are migrating from a previous version and you do not want to use the Master App
deprecated procedure, copy the localized UI Framework Resources.
2. Set the UI Application to a Default Language.
If you are passing from the Master App deprecated procedure to the new one (use case c), you must
remove the Master App from the UI Application configuration, otherwise the system will not all display
all translations correctly.
Procedure
1. Copy the UI Framework resource zip file into %SITUnifiedSystemData%\Engineering\Packages\Resources.
The UI Framework zip name must respect the following naming convention
UIFramework.Resources.<language>.V<product version>.
• If you are localizing the Solution for the first time, you must not follow this procedure as it will be
removed in future versions and it is substituted by the new Copying the localized UI Framework
Resources.
• If you are migrating from previous versions, you can still use it although we suggest that you perform
the new Copying the localized UI Framework Resources.
App localization packages contain the following folder hierarchy: UI folder > resources sub-folder.
This hierarchy is relevant for the localization procedure and UI resources must always be contained in
the resources sub-folder.
Procedure
1. Decide which App will be set as UI Framework Localization Master inside your UI Application.
2. Locate the files you have previously extracted from the UI Framework zip (or custom generated).
3. Extract files from the localization zip of the UI Framework Localization Master App.
4. Expand the UI folder and then the resources sub-folder.
5. Copy the UI Framework files to the resources sub-folder of the Localization Master App.
6. Zip the UI folder of the Localization Master App and name it exactly with the same name as the original
localization zip file.
7. Verify that the app zip contains the UI > resources folder structure with the just copied common files.
• Only if you are still following the deprecated UI Framework localization procedure, you must keep the
UI Framework Master Localization app below.
• If you are passing to the new UI Framework localization procedure, remove the selection from the
Master App.
The procedure applies only if the resource files are localized in one of the platform default languages:
German, French, Simplified Chinese, Spanish, Italian, Russian, Korean and Japanese.
Procedure
1. For each App (or Extension App) that is present in your UI Application, copy the localized zip package
to %ProgramData%\Siemens\SimaticIT\Unified\Engineering\Packages\Resources.
2. In Solution Studio, in the current manufacturing solution, click User Interface in the side bar and then
select UI Applications.
3. Select the required UI Application tile and click .
4. In the Languages edit box, type the required language code by adding it to the list of the available languages,
without removing en-US.
When mentioning the language code, we refer to the four-letter code (or two-letter code) used to
represent languages in the ISO 639 standard. E.g. zh-CN, fr-FR, de-DE, it-IT and so on.
Do not remove any language code and always leave at least en-US not to compromise the application
functionalities.
You must use the comma separator, without blank spaces. For example, to display Italian resources, the
string must be en-US,it-IT.
5. (Deprecated step) For compatibility reasons, you can still use the Master App list box to select the App that
includes the common UI Framework files. Note If the UI Framework Master App is selected, any files copied in
the UI Framework zip will be ignored (step Copying the localized UI Framework Resources).
6. Save changes.
Procedure
1. Click Deployment in the sidebar and then select Package Management.
2. If you have only changed the UI localization packages click , the UI applications will be set to ToBeUpdated.
3. Click to build solution packages according to the latest modifications (for details see Creating the
Deployment Package).
4. Deploy the solution packages to the solution hosts as described in Deploying the Solution Package to Hosts.
Procedure
1. Locate the Solution Studio localization files you have previously downloaded (or custom generated).
2. Copy the Solution Studio localization files to %ProgramFiles%
\Siemens\SimaticIT\Unified\UI\Apps\studio\studio\resources.
3. Copy UI Framework (loose) resource files to %ProgramFiles%
\Siemens\SimaticIT\Unified\UI\Apps\studio\common\resources.
By means of User Management Component, you can enable different login modes such as for example the
Integrated Windows Authentication (also called Autologin in UMC), PKI and so on.
To properly configure these authentication modes, you must refer to the UMC Web UI User Manual.
Preliminary operation
Do one of the following to set the default language:
• (a) in the UMC user settings, enter the language code in the Language and Data Language edit boxes, as
documented at How to Manage Users in the UMC Web User Interface Manual (e.g. add de-DE for German),
• (b) in the browser settings, choose the required default language (in this way you can avoid to configure each
user language),
• (c) none of these options: you will use the User Login dialog box.
Procedure
1. Open Solution Studio or the UI Application.
2. In the User Login dialog box, enter a properly authenticated UMC user.
3. Do one of the following according to the chosen preliminary operation:
• for option (a), leave the Default value and click Sign In.
• for option (b), leave the Default value and click Sign In.
• for option (c), select the language and click Sign In.
Workflow
1. Create and provide resource files with translations.
2. Add new languages.
Workflow
1. Generate custom localization packages.
2. Localize the UI Application into a custom language.
3. Localize Solution Studio into a custom language.
4. Set the runtime language.
5. Configure custom languages for Login page.
Procedure
1. Choose either of the following:
• In case of custom Apps or Extension Apps, localize the English resource files for Solution Studio, UI
Framework and Apps by referring to How to localize UI App and UI framework resources.
• In case of Solution Studio and Foundation Apps, translate the UI master English files into the required
language. Master English files can be found in the same Support Center section that contains the
translated UI resources, described at Downloading Resources from Support Center.
2. For each App to be localized, create a new empty folder and name it UI.
3. Inside the UI folder, create another empty folder and name it resources.
4. Copy the App localized resources to the resources folder.
5. Zip the newly created UI folder, maintaining the sub-folder hierarchy, and name it as follows:
where
• <prefix>, <app name>, <major version.minor version> must contain exactly the same values as the app
package. The <app name> used in the resource zip file name must be always the same as the app name used in
the app zip name. For example, if the app zip is Siemens.OpcenterEX.FN.DefectV01.00.00.zip, the related
resource zip file must be Siemens.OpcenterEX.FN.Defect.Resources.zh-CN.V01.00.00 (and not
Siemens.SimaticIT[...].zip as for the other Foundation Apps).
In case of Extension Apps, translation packages must be created separately. The convention is the same as the
one described for the app, but the the values must be congruent to the Extension app zip file name
(i.e.. <prefix>, <extension app name>, <major version.minor version> must be the same as the ones of the
Extension App).
• the patch version, the version for the resource package which is indicated in the app zip (e.g. V01.01.00). This
value can be different (greater , smaller or equal) in order to permit resource changes (or app changes) without
reloading the corresponding app (or resource) package.
For example, for app version V01.01.00 you can have the following resource versions:
V01.01.00, V01.01.01, V01.01.02 and so on.
If multiple resource packages for the same app are available in %SITUnifiedSystemData%
\Engineering\Packages\Resources with different patch version numbers, the package with the highest patch
version will be automatically used.
• the Resources.<language code> string must be manually added to the resource zip name. The language code
must be a four-letter code based on ISO 639 (e.g. ko-KR) and it must be the same everywhere: in locale files, in
the UI Application settings, in UMC, in browser options (if used) and so on. If you use the two-letter code system,
e.g. ko, the same code must be applied everywhere accordingly (and only if you are not using Foundation Apps).
If a resource package zip from Application Log localization already exists, then copy the UI folder to the
existing zip.
Examples
App Name Localization Zip Name
Siemens.OpcenterEX.FN.Def Siemens.OpcenterEX.FN.Defect.Resources.ko-KR.V01.01.00.zip
ectV01.01.00.zip
Siemens.SimaticIT.AuditTrail Siemens.SimaticIT.AuditTrail.Resources.ko-KR.V02.01.00.zip
V02.01.01.zip
Next Steps
Proceed in either of the following ways:
• If the localization language is one of the platform default languages, you must continue with step 2 at How to
Display Solution Studio and UI Applications in a Default Language.
• If the localization language is a custom language, proceed with step 2 at How to Display Solution Studio and UI
Applications in a Custom Language.
Workflow
1. Do one of the following
• use case a) If you are configuring the Solution from scratch, copy the Custom Translations for UI
Framework Resources.
• use case b) If you are migrating from a previous version, and if you want to still use the old Master App
procedure (now deprecated), prepare the UI Framework Localization Master app zip.
• use case c) if you are migrating from a previous version and you do not want to use the Master App
deprecated procedure, copy the Custom Translations for UI Framework Resources.
2. Set the UI Application to a custom Language.
If you are passing from the Master App deprecated procedure to the new one (use case c), you must
remove the Master App from the UI Application configuration, otherwise the system will not display all
translations correctly.
Procedure
1. Copy the UI Framework resource zip file into %SITUnifiedSystemData%\Engineering\Packages\Resources.
The UI Framework zip name must respect the following naming convention
UIFramework.Resources.<language>.V<product version>.
• If you are localizing the Solution for the first time, you must not follow this procedure as it will be
removed in future versions and it is substituted by the new Copying the Custom Translations for UI
Framework Resources.
• If you are migrating from previous versions, you can still use it although we suggest that you perform
the new Copying the Custom Translations for UI Framework Resources.
App localization packages contain the following folder hierarchy: UI folder > resources sub-folder.
This hierarchy is relevant for the localization procedure and UI resources must always be contained in
the resources sub-folder.
Procedure
1. Decide which App will be set as UI Framework Localization Master inside your UI Application.
2. Locate the files you have previously extracted from the UI Framework zip (or custom generated).
3. Extract files from the localization zip of the UI Framework Localization Master App.
4. Expand the UI folder and then the resources sub-folder.
5. Copy the UI Framework files to the resources sub-folder of the Localization Master App.
6. Zip the UI folder of the Localization Master App and name it exactly with the same name as the original
localization zip file.
7. Verify that the app zip contains the UI > resources folder structure with the just copied common files.
• Only if you are still following the deprecated UI Framework localization procedure, you must keep the
UI Framework Master Localization app below.
• If you are passing to the new UI Framework localization procedure, remove the selection from the
Master App.
Procedure
1. Download the locale files for the required languages from https://github.com/angular/bower-angular-i18n. For
each language, you have to download two files. For example, if you want to use Dutch, the following files are
required: angular-locale_nl.js, angular-locale_nl-nl.js.
2. Do either of the following:
• If you are planning to elect the Master Localization app, copy the just downloaded locale files to
%ProgramData%\Siemens\SimaticIT\Unified\Engineering\Packages\Locales.
• If you are not using the deprecated path, copy the downloaded locale files to %ProgramData%
\Siemens\SimaticIT\Unified\Engineering\UIFramework\common\scripts\i18n.
3. For each App that is present in your UI Application, copy the localized zip package to %ProgramData%
\Siemens\SimaticIT\Unified\Engineering\Packages\Resources.
4. In Solution Studio, in the current manufacturing solution, click User Interface in the side bar and then
select UI Applications.
When mentioning the language code, we refer to the four-letter code (or two-letter code) used to
represent languages in the ISO 639 standard. E.g. zh-CN, fr-FR, de-DE, it-IT and so on.
Do not remove any language code and always leave at least en-US not to compromise the application
functionalities.
You must use the comma separator, without blank spaces. For example, to display Dutch resources,
type en-US,nl-NL.
7. (Deprecated step) For compatibility reasons, you can still use the Master App list box to select the App that
includes the common UI Framework files. Note If the UI Framework Master App is selected, any files copied in
the UI Framework zip will be ignored (step Copying the custom localized UI Framework Resources).
8. Save changes.
The resource files available in the package will overwrite any resource files available in the App zip.
Procedure
1. Click Deployment in the sidebar and then select Package Management.
2. If you have only changed the UI localization packages click , the UI applications will be set to ToBeUpdated.
3. Click to build solution packages according to the latest modifications (for details see Creating the
Deployment Package).
4. Deploy the solution packages to the solution hosts as described in Deploying the Solution Package to Hosts.
Workflow
1. Localize Solution Studio screens.
2. Localize Solution Studio sidebar menu.
"containerMessages": {
"administration": "Administratie",
"appManagement": "Applicatiebeheer",
"account": "Account",
"auditTrail": "Audit trail",
"maintenance": "Onderhoud",
"userInterface": "Gebruikersinterface",
"settings": "Instellingen",
"deployment": "Implementatie",
"users": "Gebruikers",
"groups": "Groepen",
"role": "Rollen",
"registry": "Register",
"configuration": "Configuratie",
"swacComponents": "SWAC Components",
"mashups": "Mashups",
"uiApplications": "UI-toepassingen",
"dataSources": "Gegevensbronnen",
"workerRoles": "Worker Roles",
"packageManagement": "Pakketbeheer",
"hostManagement": "Hostbeheer",
"hostMonitoring": "Hostbewaking",
"general": "Algemeen",
"advanced": "Geavanceerd",
"logout": "Uitloggen",
"home": "Huis",
"about": "Over",
"help": "Helpen"
}
{
"installedLocales": [
"en_US",
"cs_CZ",
"de",
"es",
"fr",
"it",
"ja_JP",
"ko_KR",
"pl_PL",
"pt_BR",
"ru_RU",
"zh_CN",
"zh_TW",
"nl_NL"
]
}
Preliminary operation
Do either of the following to set the default language:
• (a) in the UMC user settings, enter the language code in the Language and Data Language edit boxes, as
documented How to Manage Users in the UMC Web User Interface Manual (e.g. add nl-NL for Dutch),
• (b) in the browser settings, choose the required default language (in this way you can avoid to configure each
user language).
Procedure
Workflow
1. Create and provide resource files with translations.
2. Add new languages.
Remote commands are always out of transaction. This means that, in case of error, no rollback is
automatically performed.
For this reason, we recommend that you use them in a non-transactional context (e.g. in Composite
commands), or in any situation where:
• it is not required an atomic execution of the involved business logic;
• it is possible to deal with the scenario where the same remote call is invoked more than once due to
the retry mechanism of a command handler execution in case of commit failure.
In future implementations, Foundation will provide compensation logics that are now in charge of the
user.
Compensation logic, which is now under the user responsibility, are planned for future implementations.
// SLOW WAY
var materialDefinition =
Platform.Create<Siemens.SimaticIT.MasterData.Foundation.DataModel.IMaterialDefinition
>();
materialDefinition.Name = "MyEntity";
// FAST WAY
var materialDefinition =
Platform.Create<Siemens.SimaticIT.MasterData.Foundation.DataModel.IMaterialDefinition
>();
materialDefinition.Name = "MyEntity";
Writing model
The writing model depends on the data the users want to write. There are two categories of data:
• Internal: no peripheral address is configured i.e. data is only kept in the Process Image
• External: peripheral address is configured e.g. OpcUa address
As shown in the figure below, when internal data is written, the request flows from the client to the Event Manager
that writes it to the Process Image and returns the control to the client. The whole chain (A, B1, B2) is synchronous.
When external data is written, the request flows from the client to the Event Manager that tries to queue it in the
target driver (e.g. OpcUa). As soon as the queueing operation succeeds, the control returns to the client (A, C1, C2),
without waiting for any feedback from the driver (D) about the writing operation. During this phase, the Process
Image is not updated until the driver completes the operation successfully and consequently any read operations
would return the old value.
Error management
The error management related to the writing requests is not easy and straightforward.
The table below aims to summarize all the possible scenarios and how you could handle different situations:
3 External Operation Asynchron As soon as the driver processes the request in the queue and it
data succeeds & ous completes the writing operation, the Event Manager updates
AutomationVa the Process Image. Data can be considered written only when
lue.Error is set the Process Image is updated.
equal to 0
If a subscription is active on the written data, the event will be
fired.
If a problem occurs while the driver is processing the element it
has removed from the queue (e.g. the OpcUa server has the
queue full or an out-of-range value and does not permit the
client to write the element) the write operation will fail and
consequently the Process Image will never be updated (and of
course no event will be fired).
To handle this situation, mostly in use cases where a TAKT time
must be guaranteed, the approach ‘write…wait(delta)…read’
can be applied.
The considerations explained above apply also when dealing with mixed data (i.e. writing requests that contain
both internal and external data together). In this case, all the explanations are still valid and in particular mode the
check on the AutomationValue.Error is mandatory, as shown in the following code example:
…
try {
AutomationWrite(entity);
foreach(var par in entity.AutomationParameters)
{
if (par.Value.AutomationValue.Error != 0)
{
string message = $"Failed writing parameter '{par.Key}'
[Error: {par.Value.AutomationValue.Error}]";
_tracer.Write("<provider>", Category.Error, message);
// Error management
}
}
}
catch(…)
{
// Error management
}
…
Golden rules
While implementing queries, keep in mind the following rules:
\\\bad example
platform.Query<IMyEntity>().Where(x => x.MyProperty == 10);
\\\good example
var value = 10;
platform.Query<IMyEntity>().Where(x => x.MyProperty == value);
The first code example is bad because the query is not cashed at database level (actually, only the query with value
10 is cashed, which will be presumably not required anymore) . This prevents Entity Framework from reusing the
execution plans whenever the query is invoked again. The parameterized query would save time and CPU resources
by reusing the execution plans.
Expression evaluations in lambda expressions make the code hard to debug, as it can lead to exceptions which are
not easy to understand.
In the second example, if myObject was null, the user would see a reflection-exception instead of a simple null-
reference.
In the first example the queries could be generated less efficiently.
Further guidelines
The Select operator must be used as soon as possible, and limited to the top-level projection of the
query. Consequently, the following code:
Avoid specifying conditions in the stream operators (such as First, FirstOrDefault, etc.) when they follow the select
operator. The following code:
platform.Query<IMaterial>()
.OrderBy(m => m.Name).Select(m => m.Quantity)
.FirstOrDefault(q => q > 10)
platform.Query<IMaterial>()
.OrderBy(m => m.Name).Where(m => m.Quantity > 10)
.Select(m => m.Quantity).FirstOrDefault()
Some filtering operations cannot be translated into server-side statements. Consequently, avoid using user-code in
filtering expressions such as:
platform.Query<IMaterial>()
.Where(m => ClientEvaluationMethod(m.Quantity))
Avoid specifying additional arguments, such as the comparison culture, on comparisons because they can produce
client-side evaluation. You cannot mix client-side and server-side evaluation when performing queries.
Consequently, avoid the following example:
platform.Query<IMaterial>()
.Where(m => string.Compare(m.Name, "Test",
StringComparison.CurrentCultureIgnoreCase))
Instead of the Last/LastOrDefault stream operator, use the First/FirstOrDefault operator with reverse ordering.
Moreover, queries materialized with stream operators like First, should always specify an ordering.
Wireframe
Filter The Filter is not available inside Small (360px) and Large (480px) panels.
Tile/Grid Both view modes should be always available and the Grid mode should be set as default.
mode
Quick The quick search should always filter by the NId entity property.
Search
Drill Down The Drill Down button ( Open) should be always present in:
• Tiles, Grids and vertical command bars of Master Layout screens
• Tiles and Grids of tabs in the Master Details screens
UI Element Description
User User Preferences should provide display preferences for all the available entity properties except
Preferences for GUIDs.
When the user clicks the Open button, the visualization will change from the Master Layout page only to the
Master and Details Layout.
All Master Layout pages are based on the Master template and contain a list of entities such as Materials, Lots,
Material Tracking Units and so on.
Master Layout pages should be implemented by keeping in mind the following guidelines:
UI Element Description
Screen Title The title must contain the entity name in plural (for example
Materials, Lots, Work Instruction Definitions and so on). The title
should not contain "management".
Filter The Filter should open a filter panel on the left of the page or a filter
builder below the contextual command bar.
The Filter should include all fields that have been configured as
visible in the grid, except for the Segregation Tags.
Tile/Grid Mode Data must available both in Grid and in Tile mode. If possible,
choose the Grid mode visualization as default.
Sort by The Sort by should include all fields that have been configured as
visible in the grid. By default, data should be sorted by the logical
key field (for example, the NId), and in Ascending order.
UI Element Description
Group by Use the fields that have not been designed to be unique (for
example, you should not use Id, Last Updated On, Created On and
so on). See note about revision entities.
Data Drill Down From the Master Layout page, it should be always possible to
navigate to the Master and Details Layout.
Multi selection Enabled. If the commands already support the multi selection, the
corresponding actions can be shown when multiple instances are
selected.
Data to be displayed Grids should display the following data, in the following order: Id,
Name, [...], any boolean fields (e.g. Is Frozen, Is Default and so
on), Created On, Last Updated On, Segregation Tags.
Tiles should display Id, Name, some few additional fields that you
consider important for the involved entity (maximum 2-3 fields, for
example Last Updated On) and boolean fields shown as indicators.
Revised Data to be displayed Grids should display the following data, in the following order: Id,
Name, Revision, Is Current, [...], any boolean fields (e.g. Is Frozen, Is
Default and so on), Created On, Last Updated On, Segregation Tags.
Tiles should display Id, Revision, some few additional fields that you
consider important for the involved entity (maximum 2-3 fields, for
example Last Updated On) and boolean fields shown as indicators.
Actions The screen should display all actions that have been defined to
manage the involved entity instances (e. g. Add, Edit, Delete, Freeze/
Unfreeze, Add new revision, Copy revision and so on).
Action buttons must be ordered in the command bar as follows:
• Add action
• Open action (Drill Down)
• Edit action
• Specific actions for the involved entity (for example Lock,
Freeze, Change Status, Release and so on)
• Delete action (always the last one).
The title of the side panel should contain the action verb and the
entity name (e. g. Add Material).
Export functionality The Export action should be available on the Contextual Command
bar for the supported entity types.
Segregation Tags The Segregation Tags button and the Segregation Tags column
should be present in the Master Layout page. In case of Tile display
mode, Segregation Tags chips will be automatically displayed
within the tiles.
UI Element Description
Breadcrumb In Master Layout screens, breadcrumbs are not displayed but they
must be configured providing only the screen title without
specifying any other field). In this way, the breadcrumb of the
Master Details screen will include the title of the Master Layout
screen.
UI Element Description
Filter The Filter is not available in the Master section of the Master-Details page. It could be present in
the tab grid where it should open a builder below the contextual command bar (not a filter
panel).
Tiles Tiles must contain a restricted set of properties, indicators for boolean values (for the indicators
you should use svg icons that start with 'indicator' in the file name).
Sort by The Sort by should include all fields that have been configured as visible in the grid or tile. By
default, data should be sorted by the logical key field (for example, the NId), and in Ascending
order.
Tile/Grid The Master side of the Master Details screen is only shown in Tile view mode.
mode
Tiles should display the minimal set of the properties (at least Id, Name, some very few
additional fields that you consider important for the involved entity) and boolean fields shown
as indicators.
Inside tabs, data must be shown both in Grid and in Tile view mode (Grid is the default).
UI Element Description
Actions If an action takes in input a value that must be retrieved from multiple items, the action field
input box should be an Entity Picker UI element, configured as server side, without pagination.
The Entity Picker should be configured with filter, sort by, search by NId. Created On and Last
Updated On should be shown in the grid as the last columns.
Action buttons must be ordered in the command bar as follows:
• Add action
• Edit action
• Specific actions for the involved entity (for example Lock, Freeze, Change Status, Release
and so on)
• Delete action (always the last one).
The Open (Drill Down) action is available inside grids (and tiles) within the tabs.
Segregation The Segregation Tags button should be present in the Master section of the Master-Details page
Tags and the Segregation Tags column should not be present in the page tabs.
Breadcrumb Breadcrumb must be configured providing the screen title, along with the entity NId. If the
breadcrumb has been configured also for the Master Layout screen, in the Master Details the
complete breadcrumb will be <Master Layout Title> + <Master Details title> + <selected Entity
NId>.
UI Element Description
Filter If the application needs to retrieve entities under revision, you should provide
a filter by Current Revision as possible filter.
Actions Actions for setting an entity revision to current, locking and unlocking entities
should be present.
The action for adding a new entity and adding a new entity revision should be
grouped together and configured as a group button. The group button should
provide the action for adding a new entity revision only if an entity is selected,
otherwise a simple create action should be provided.
Group by Only for revision entities, along with the fields that have not been designed to
be unique, it could be useful to provide the Id field (in order to group by items
with the same Id but with a different revision).
UI Element Description
UoM entities which are set as hidden will be filtered out from
the UoM list and will not be displayed.
• By referencing other Functional Blocks from Apps or Extension Apps via Reference Manager, you will populate
and enrich the Public Object Model (POM) importing entities, types, events and protected commands of the
Functional Blocks.
Patch Version You can update your reference to a new Patch version.
For example, if you referenced version 01.00.00 of the
Functional Block x, and 01.00.01 is available in Reference
manager you can update the reference. You could not
update to version 01.01.00 as this would imply a new
minor version.
Minor version You can update your reference to anew Patch or Minor
version. For example, if you referenced version 01.00.00
of
Functional Block x, and 01.01.00 is available in Reference
manager you can update the reference. You could not
update
to version 02.00.00 as this would imply a new major
version.
Reference Manager will load version 01.00.02 as this should not cause compatibility issues. If they differ by
major version an error is returned and the operation will not be possible.
• If a referenced Functional Block is missing in the file system repository (i.e. %ProgramData%
\Siemens\SimaticIT\Unified\Engineering\Packages\FunctionalBlocks), and the system prevents you from
building the solution, we suggest that you perform the procedure described in the document Troubleshooting:
How to fix a Project Studio Solution if a referenced Functional Block is missing available on GTAC site. The
article will help you to manually remove the missing references from the project and be able to install or restore
the packages you need.
• In case of migration from platform version 3.0 or previous, the .um file of the original Functional Block must be
deleted from the model project. If you double-click this file, a warning message will inform you that it is no
longer supported and needs to be removed. After deleting this file and building the solution, you can open the
model double-clicking the .dm file from the Diagrams sub-folder, containing the graphical representation of the
data model (see How to Migrate a Manufacturing Solution).
Artifact Deletion
If you have deleted artifacts (entities, events, commands, and so on) in your Functional Block, inconsistencies will
be created in the related App/Extension App. This occurs because in these projects artifacts will not automatically
deleted. In this case, the project compiling will fail. In the App/Extension App, in the Public Object Model,
these inconsistencies will be marked with a question mark. Hence, you can identify these inconsistencies and
remove them manually. Once performed this operation, you can correctly compile your projects.
In addition, we suggest that you delete artifacts selecting the Delete On Cascade option, otherwise any extension
of the deleted artifacts will not be deleted and you may encounter errors during the project compiling.
If you want to achieve the above mentioned goals, you can use the following indications as a guideline for
developing your solution.
1 [Handler(HandlerCategory.BasicMethod)]
2 public partial class StartOperationHandlerShell
3 {
4 /// <summary>
5 /// This is the handler the MES engineer should write
6 /// This is the ENTRY POINT for the user in VS IDE
7 /// </summary>
8 /// <param name="command"></param>
9 /// <returns></returns>
10 [HandlerEntryPoint]
11 private StartOperation.Response
StartOperationHandler(StartOperation command)
12 {
13 StartInputClass inputStart = new StartInputClass(command);
14
15 string xml =
RtStartClass.GenerateXmlInputForStartOperation(inputStart);
16
17 IOrderBread ordBread = new OrderBread();
18 bool res = false;
19 string errorMessage = string.Empty;
20 string infoMsg = string.Empty;
21
22 using (RtStartClass rtStartClass = new RtStartClass(ordBread))
23 {
24 PmRequestOutput outArgs;
25 res = rtStartClass.StartOperation(xml, ref errorMessage,
ref infoMsg);
26 }
27
28 StartOperation.Response response = new
StartOperation.Response();
29 response.ResponseMessage = infoMsg;
30 if (!res)
31 {
32 response.Error = new ExecutionError(errorMessage);
33 }
34
35 return response;
36 }
37 }
In this example, RtStartClass is the class that hosts the third-party functionality, StartOperation is the
functionality to be executed.
1 [HandlerEntryPoint]
2 private CreateDefect.Response CreateDefectHandler(CreateDefect command)
3 {
4 try
5 {
6 handlerTracer = Platform.Tracer;
7 handlerTracer.Write("Siemens-SimaticIT-Trace-BusinessLogic",
Category.Informational, "Starting CreateDefectHandler", "CreateDefect");
8 CreateDefect.Response response = new CreateDefect.Response();
9 //Get QIS-Webservice
10 IQISService client = QisModel.GetService();
11 //Create NcDefect
12 QISService.NcDefect defect = new QISService.NcDefect();
13 defect.DmlCommand = new NcDmlCommandField { Value = "I" };
14 defect.DefectId = new NcStringField { Value = command.DefectId };
15 defect.DefectDescription = new NcStringField { Value =
command.DefectDescription };
16 defect.PlantOfDefect = new NcStringField { Value =
command.PlantOfDefect };
17 defect.Classification = new NcStringField { Value =
command.Classification };
18 handlerTracer.Write("Siemens-SimaticIT-Trace-BusinessLogic",
Category.Informational, "Creating defect ({0}/{1}/{2}/{3})",
defect.DefectId.Value, defect.DefectDescription.Value,
defect.PlantOfDefect.Value, defect.Classification.Value, "CreateDefect");
19
20 response.Result =
client.NetComProcessObject(defect).EventId.ToString();
21 return response;
22 }
23 catch (Exception ex)
24 {
25 handlerTracer.Write("Siemens-SimaticIT-Trace-BusinessLogic",
Category.Error, ex.Message, "CreateDefect");
26
27 return new CreateDefect.Response(){Error = new ExecutionError(-2,
ex.Message)};
28 }
29 }
Opcenter Execution Foundation supports queries on entities imported from third-party data sources in the
following ways:
• through the standard $metadata OData syntax, if you are querying from consumer clients (such as single page
applications) through the Service Layer. When you query, you can add the required navigation properties to set
logical connections among entities that belong to different data models.
• through the ProjectionQuery() method available inside the command handler and event handler code,
or inside applications that use the IUnifiedSdkLean interface. In both cases you execute a LINQ query. This
method also reads cross domain inside Opcenter Execution Foundation data model.
• through Presentation Services listed in the Opcenter Execution Foundation Product Overview, and documented in
the UI Framework Reference.
To write on the third-party databases, create a manufacturing integration solution to execute third-party business
logic.
Call protected commands, belonging to the Functional (Not recommended. Use the public commands
Block namespace (if associated to a Worker role) exposed by Apps instead (see below).
<Prefix>.<DomainName>.<FunctionalBlockName>.<Acron
ym>Model.Commands)
Trigger events
EX FN product assemblies.
8. If you want to test your application, and you have not deployed your solution yet, you can
temporarily set the Copy Local build property to True of the referenced Functional Block assemblies
(e.g. MyFB.OperationalData.MyFB.Model.dll). Bear in mind that you must change it after you have deployed
the solution.
Before you execute your application, check that the assemblies you have copied belong to the last
available product version.
Code Examples
The following code snippets can be properly modified to be used in your project.
IUnifiedSdk interface methods are documented in the Platform Reference documentation. The following
code snippet contains only a subset of the functionalities that can be used.
using Siemens.SimaticIT.Runtime.Common;
using Siemens.SimaticIT.Unified.Lean;
[...]
public static void Main(string[] args)
{
try
{
LeanFactory.Initialize("MyApplication");
IUnifiedSdkLean unifiedSdkLean = LeanFactory.Create();
unifiedSdkLean.SetWindowsAuthentication();
var command = new CreatePS()
{
PSName = "My PS",
PSVersion = 02.01
};
var response = unifiedSdkLean.CallCommand<CreatePS,
CreatePS.Response>(command);
if (!response.Succeeded)
{
unifiedSdkLean.Tracer.Write("MyApplicationLog", Category.Error, "PS 1 Not
created");
}
unifiedSdkLean.Dispose();
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
LeanFactory.ShutDown();
}
using Siemens.SimaticIT.Runtime.Common;
using Siemens.SimaticIT.Unified.Lean;
[...]
public static void Main(string[] args)
{
try
{
LeanFactory.Initialize();
using (IUnifiedSdkLean unifiedSdkLean = LeanFactory.Create())
{
unifiedSdkLean.SetWindowsAuthentication();
var command = new CreatePS();
var response = unifiedSdkLean.CallCommand<CreatePS,
CreatePS.Response>(command);
if (!response.Succeeded)
{
unifiedSdkLean.Tracer.Write("MyApplicationLog", Category.Error,
string.Format("PS 1 Not created"));
}
}
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
LeanFactory.ShutDown();
}
Consequently, before executing commands, you should verify that the permissions have been correctly assigned
otherwise the operations will return an authorization error.
Queries can be implemented only on the entities that are present in the POM Model of the App. If you try to execute
queries on entities of the Functional Block ProjectionModel namespace, the system returns an authorization error.
If you are using another version of Entity Framework, you must update it to the version supported by
Opcenter Execution Foundation.
If you are implementing the Opcenter Execution Foundation project (functional block or App) that uses standard
IUnifiedSdk functionalities to access Opcenter EX FN database or external data sources, Microsoft Entity
Framework is automatically configured.
If you are implementing a project which only uses IUnifiedSdkLean functionalities and you want to directly use MS
Entity Framework to run queries or perform operations on a database without using Opcenter Execution
Foundation IUnifiedSdkLean APIs, you must manually configure Entity Framework in order to set the connections
required by Opcenter EX FN.
This configuration must be performed inside the configuration file of your project (app.config or web.config,
according to the project type).
If the file is already configured, verify that the <entityFramework> section contains the following mandatory
configurations, or add the entire configuration from scratch:
• <Section>, containing the Entity Framework name and details (for more information on Entity Framework
configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468:
<section name="entityFramework"
type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection,
EntityFramework, Version=6.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
• <Providers>, containing the details of the SQL provider (mandatory) and the Oracle provider (only if you want
to use Oracle):
<interceptor
type="Siemens.SimaticIT.Information.Common.EntityFramework.Interception.UnifiedComman
dInterceptor,
SimaticIT.Information.Common" />
<interceptor
type="Siemens.SimaticIT.Information.Common.EntityFramework.Interception.UnifiedTransa
ctionInterceptor,
SimaticIT.Information.Common" />
Prerequisites
The user that will run the application is a UMC user and is associated to the proper role.
Procedure
1. Create a C# project (for example, of WPF Application or Windows Forms type), by choosing the correct version
of .NET Framework as specified in Prerequisites of the Opcenter Execution Foundation Installation Guide.
2. Copy the %SITUnifiedSystemRoot%ClientLibrary folder from any Opcenter EX FN host to the client machine
(on which Opcenter Execution Foundation is not installed). This folder contains all the files that are required to
correctly use signalling functionalities.
3. Add the following assemblies to the project references by browsing to the copy folder:
• SimaticIT.Signalling.ClientModel.dll
• SimaticIT.Signalling.ClientSdk.dll
4. If needed, follow the provided examples to implement your code. An example for setting up a custom tracer is
also provided.
5. Copy the following files to the folder where your executable will run:
• SimaticIT.Signalling.ClientModel.dll
• SimaticIT.Signalling.ClientSdk.dll
• Newtonsoft.Json.dll
• System.Net.Http.Formatting.dll
• System.Net.Http.dll
<system.diagnostics>
<trace autoflush="false" indentsize="4">
<listeners>
<add name="monitorListener" type="System.Diagnostics.TextWriterTraceListener"
initializeData="YOUR_APPLICATION_NAME_OutputTrace.log" />
<remove name="Default" />
</listeners>
</trace>
</system.diagnostics>
Implementing a subscription
The following code snippet represents an example of library use within a console application:
using System;
using System.Linq;
using System.Security;
using System.Threading.Tasks;
using Siemens.SimaticIT.Signalling.ClientModel;
using Siemens.SimaticIT.Signalling.ClientModel.Remoting;
using Siemens.SimaticIT.Signalling.ClientSdk;
using Siemens.SimaticIT.Signalling.ClientSdk.Security;
namespace MyFirstSignalClient
{
public class Program
{
private static Action<object> onNext = t => Task.FromResult(0);
private static Action<Exception> onError = t => new Exception("Error");
private static Action onCompleted = () => Console.WriteLine("Done");
private static Uri ConfigUri = new Uri("http://localhost/sit-svc/config");
private static string username = "root";
private static string password = "root";
private static string clientId = "test";
private static string secret = "test";
private static string SignalName = "TankFillSignal";
//STEP 2.1: Prepare Secure Strings for managing security critical data
SecurityClient securityClient = null;
using (var securePwd = BuildSecureString(password))
{
using (var secureSecret = BuildSecureString(secret))
{
//STEP 3: Retrieve the endpoints for the signals and retrieve the
signals
var smc = new SignalMetadataClient(securityClient);
SignalsMetadata s = sm.Result;
//STEP 4: Retrieve specific endpoint for a specific Signal (e.g.
TankFillSignal)
SignalEndpoint se = s.GetSignalEndpoint(SignalName);
The following code snippet represents an example of library use within a Windows Form application:
using System;
using System.Linq;
using System.Security;
using System.Windows.Forms;
using Siemens.SimaticIT.Signalling.ClientModel;
using Siemens.SimaticIT.Signalling.ClientModel.Remoting;
using Siemens.SimaticIT.Signalling.ClientSdk;
using Siemens.SimaticIT.Signalling.ClientSdk.Security;
namespace MyFirstSignalClient
{
public partial class MainForm : Form
{
private static string Username = "root";
private static string Password = "root";
private static string ClientId = "test";
private static string ClientSecret = "test";
private static string AppName = "MyApp";
private static string SignalName = "TankFillSignal";
private SecurityClient _securityClient;
private EndpointsConfiguration _endpointConfig;
private SignalsMetadata _metadata;
private ISignalClient _signalClient;
private long _subscriptionId;
private async void MainForm_Load(object sender, EventArgs e)
{
//STEP 1: Retrieve dynamic configuration from /sit-svc/config
_endpointConfig = await new UafServiceDiscovery(new Uri("http://
localhost/sit-svc/config")).GetEndpoints();
// Insert your code here to manage the result and update the UI..
}
private async void AuthenticateBtn_Click(object sender, EventArgs e)
{
//STEP 2.1: Prepare Secure Strings for managing security critical data
using (var securePwd = BuildSecureString(Password))
{
using (var secureSecret = BuildSecureString(ClientSecret))
{
//STEP 2.2: Obtain Opcenter Foundation Execution security object
to use Platform functionalities
_securityClient = await new
SecurityClientFactory(_endpointConfig).Create(Username, securePwd, ClientId,
secureSecret);
}
}
// Insert your code here to manage the result and update the UI..
}
private async void GetMetadataBtn_Click(object sender, EventArgs e)
{
//STEP 3: Retrieve the endpoints for the signals and retrieve the signals
For more details on the IUnifiedSdkLean interface, refer to the IUnifiedSdkLean public interface in the
Opcenter Execution Foundation Platform Online Help.
GET https://localhost:9000/OAuth/Authorize?
response_type=token&client_id=MyApp&redirect_uri=https://localhost:44300/
callback.cshtml&scope=global&state=14553710.733142
• scope: a string (case insensitive, with space separator) that identifies the scope for which the access token will
be used. Once the scope is declared, it cannot be changed on the returned token. The currently accepted value
is global.
• state: this parameter represents the value used by the client to establish a correlation between the request and
the response. The authorization server includes this value in the response to the client.
The client will then be redirected to the Identity Provider login page, where the login will be executed.
After a successful login, the client will be redirected again to the URI specified in the redirect_uri parameter in the
first request. The access token will be attached as a fragment to the URI.
https://localhost:44300/
callback.cshtml#access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpX...&token_type=bearer&ex
pires_in=1200&state=14553710.733142
Be aware that for this type of clients, future versions of Opcenter Execution Foundation may require, for
security reasons, that you add a call to a new registration command containing an explicit declaration of
the application name.
In a distributed environment with more than one Opcenter Execution Foundation ready application node,
this flow is guaranteed if you configure the network load balancing in client affinity mode.
If an application is developed by using Project Studio and deployed with Solution Studio, it will be
automatically registered in the system. So this section only regards those custom client applications that
are developed outside Project Studio.
The actual implementation phase does not provide any endpoints that allow a Resource Owner to register/un-
register a client application.
Parameters described in the OAuth2 standards for a client registration
(i.e. Client_ID, Client_Secret and Client_RedirectionURI) must be set by the resource owner and provided to the
client.
Important
We recommend that you configure Authorization Server binding on HTTPS only.
The client uses the HTTP Basic authentication scheme to authenticate with the authorization server. The client
identifier must be encoded using the "application/x-www-form-urlencoded" encoding algorithm, and the encoded
value is used as the user name. In the same way client secret has to be encoded using the same algorithm and used
as the password.
For further details, see Section 2 of "HTTP Authentication: Basic and Digest Access Authentication" at http://
tools.ietf.org/html/rfc2617#section-2.
For example (with extra line breaks for display purposes only):
Authorization: Basic czZCaGRSa3F0Mzo3RmpmcDBaQnIxS3REUmJuZlZkbUl3
The client composes an Access Token request, which is compliant with OAuth2 specifications.
Clients make a request to the /OAuth/Token endpoint by adding the following parameters using the "application/x-
www-form-urlencoded" format with a UTF-8 character encoding in the entity-body of the HTTP request:
• grant_type (required): The value must be set to "password".
• username (required): The resource owner user name.
• password (required): The resource owner password.
• scope (required): The value must be set to "global".
Request Header
Request body
scope=global&grant_type=password&username=johndoe&password=A3ddj3w
If the outcome is successful, the client receives an Access Token response containing an Access Token that can be
used to send requests to resources exposed by the Service Layer or on the IUnifiedSdkLean.
Together with the response, the client also receives a refresh token that will be used to ask for a new access token
when the previous one has expired.
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Cache-Control: no-store
Pragma: no-cache
{
"access_token":"2YotnFZFEjr1zCsicMWpAA",
"token_type":"example",
"expires_in":3600,
"refresh_token":"tGzv3JOkF0XG5Qx2TlKWIA",
"example_parameter":"example_value"
}
Workflow
1. Generate a valid certificate and its private key.
2. Create a JWT Access Token and use the certificate private key to sign it.
3. Import the Certificate to the Opcenter EX FN Manufacturing Solution.
Time synchronization
Bear in mind that the machine on which you generate the certificate (client) and the machine on which the
certificate is validated (server) must be synchronized. If these machines are inside the same domain, time
synchronization is guaranteed by Active Directory. If machines are not in the same domain, you must
properly enable the Windows Time Service.
Here below you can find an example based on OpenSSL, which must be additionally installed on your
client machine, see https://www.openssl.org/.
Generate a file certificate and its private key by using the following commands:
All OpenSSL: The example generates the certificate inside the PFX container. The certificate
operating openssl can be either loaded directly from the PFX container as described at Creating a
systems JWT Access Token and using a certificate to sign it or it can be manually
imported to the Certificate Store.
Examples
PowerShell example
OpenSSL example
//Export the certificate to PFX file and associate the inserted password
.\openssl pkcs12 -inkey key.pem -in certificate.pem -export -out certificate.pfx
You can generate a self-signed certificate or sign it by using a specific certification authority, according to
the project requirements.
For security reasons it is recommended that you use self-signed certificates only for testing reasons and
that you do not use SHA-1 algorithm to generate certificates.
Workflow
1. Load the certificate you have previously created in either of the following ways:
• directly from the file system
• from the Certificate Store
2. Create the JWT access token and sign it with the loaded certificate
This example is compatible with Windows 10 and Windows Server 2016. On Windows 2012 R2 you
should refer to the manual import procedure below (Importing the PFX file with Wizard note).
2. Load the certificate from the Windows local machine certificate store. The following snippet represents only an
example and you can change the way you select the certificate from the Certificate Store depending on the
needed use case:
using System.Security.Cryptography.X509Certificates;
...
Creating the access token and signing it with the loaded certificate
Starting from the loaded certificate, your application can instantiate the Opcenter Execution Foundation access
token using the JwtSecurityTokenHandler class from the System.IdentityModel.Tokens.Jwt nuget package.
To correctly create an access token for Opcenter Execution Foundation, you must respect a set of rules:
• The token must contain the claim type with the certificate issuer name (ClaimType.Name).
• The token must contain the claim type with the certificate thumbprint (ClaimType.Thumbprint).
• The token must contain the "urn:realm" custom claim type, including the string "x.509".
• The TokenIssuerName attribute must be set to "urn:unifiedoauth".
• The AppliesToAddress attribute must be set to "urn:unified".
• The LifeTime attribute must be set to the life time of the chosen session. The LifeTime class has two
parameters: the first parameter indicates the time before which the JWT token must not be accepted for
processing. The second parameter indicates the expiration time after which the JWT token must not be
accepted for processing. Developers may add some leeway, usually no more than few minutes, to account for
clock skew.
• The SigningCredential attribute must be set using the X509SigningCredentials class built with the module
certificate.
A code example, which shows how to create the access token and sign it with the loaded certificate, is provided.
Compatibility
The following code example works with version 4.0.0 of the System.IdentityModel.Tokens.Jwt package.
If you have a more recent version, the code must be adapted accordingly.
If you are generating a token within the code of an application that uses the IUnifiedSdkLean interface,
you can only use the System.IdentityModel.Tokens.Jwt assembly version that is already installed by
Opcenter Execution Foundation.
Add the following references to your project:
• a reference to the System.IdentityModel.Tokens.Jwt NuGet package,
• a reference to the System.IdentityModel assembly (which can be found in the Assemblies system
folder).
using System.Security.Claims;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.IdentityModel.Protocols.WSTrust;
using System.IdentityModel.Tokens;
...
This procedure must be executed on all the Opcenter EX FN hosts (both on the Engineering host and on all
Runtime hosts).
For this operation you only need the .CER file containing the certificate public key:
1. Double click the .CER file to start the Certificate Import Wizard.
2. Select Local Machine as store location and click Next.
3. Enter the path of the certificate .CER file and click Next.
4. Select Place all certificates in the following store option and Personal as certificate store, and then
click Next.
5. Click Finish.
Note After you have run importcert.exe, the association between certificate and roles is immediately active.
A user can be associated to the Opcenter EX FN SysAdmin role either with the Opcenter Execution
Foundation Configuration tool, as described at Configuring the Engineering Host in the Opcenter Execution
Foundation Installation Guide, or by following procedure described at Assigning the SysAdmin Role in the
Opcenter Execution Foundation Installation Guide.
All code snippets are only examples and must be consequently adapted to your environment and data
model.
Prerequisites
For Windows, either of the following:
• Cygwin and cURL package
• The Windows Subsystem for Linux feature on Windows 10
For Linux:
• cURL
Preliminary operations
1. Manually create the following scripts in the Cygwing home, starting from the provided code snippets:
• getToken.sh
• getTokenFromRefresh.sh
• unifiedget.sh
• unifiedpost.sh
2. Using the Cygwin terminal, execute the following command to enable the execution of the scripts:
chmod +x *.sh
Note: Passwords might contain special characters that must be substituted by literal characters
introduced by single quotes (e.g. supersecret$1 would become 'supersecret$1') as exemplified in the
following snippet:
After the execution of the getToken.sh script, the home folder contains two new files containing the
access token and refresh token. These files are used from other scripts as input parameters.
If you need to refresh the token, execute the getTokenFromRefresh.sh script, and remember that an
access token expires after 10 minutes (so, when it expires you have to refresh it).
./getTokenFromRefresh.sh
If you need information on the utility, display the inline help by running the ./getToken.sh -h command.
./unifiedget.sh 'http://localhost/sit-svc/application/odata/$metadata'
To retrieve the $metadata, the unifiedget.sh utility sends its requests in JSON format, while the $metadata URL is
structured in XML format. Consequently, you must appropriately modify the script by entering the following cURL
command invocation:
{
command:
{
}
}
{command:{Id:"4C45FD6F-D0ED-4B01-8BAD-45FE24520012", Name:"SampleName",
Description:"SampleDescription"}}
./unityPost.sh 'http://localhost/sit-svc/application/odata/testcommand'
Code snippets
getToken.sh
#!/bin/bash
##
# getToken.sh
#
# Implement a Grant Resource Owner Credentials OAUTH scheme.
# Usage: getToken "OAUTH Host" "User" "password"
# or
# Usage: getToken "OAUTH Host" "User"
# and input the password interactively (hidden)
# Revision 01/09/2016:
# change the interactive input of the password to enclose the literal string for
special characters escaping in the urlencoded form
##
: ${1?"Usage: $0 \"<OAUTH Host IP or name> <user> [password]\" remember to escape \$
in user and password or enclosing the string with single ' char in the command line.
Es: 'super\$ecret'"}
SITAUTH_HOST=$1
: ${2?"Usage: $0 \"<OAUTH Host IP or name> <user> [password]\" remember to escape \$
in user and password and enclosing the string with single ' char in the command line.
Es: 'super\$ecret'"}
USER=$2
if [ -z "$3" ]
then
echo -n Password: 1>&2
read -s PASSWORD
echo
else
PASSWORD=$3
fi
rm response.txt > /dev/null 2>&1
shopt -s extglob # Required to trim whitespace; see below
CLIENT_ID="1234"
CLIENT_SECRET="kijcdsnfdsknjucd"
SCOPE="global"
AUTHORIZE="$CLIENT_ID:$CLIENT_SECRET"
AUTHORIZEB64=$(echo $AUTHORIZE | base64)
CURL='curl -X POST -is "http://'$SITAUTH_HOST'/sit-auth/OAuth/Token" -H "Content-
Type: application/x-www-form-urlencoded" --data-urlencode "client_id='$CLIENT_ID'" --
data-urlencode "client_secret='$CLIENT_SECRET'" --data-urlencode "scope='"$SCOPE"'"
--data-urlencode "grant_type=password" --data-urlencode "username='$USER'" --data-
urlencode ''password="$PASSWORD"'' --connect-timeout 5 2>/dev/null'
echo $CURL
eval $CURL > response.txt
#
# Request to QoS OAUTH Authentication Provider...
#
while IFS=':' read key value; do
# trim whitespace in "value"
value=${value##+([[:space:]])}; value=${value%%+([[:space:]])}
case "$key" in
Content-Type) CT="$value"
;;
HTTP*) read PROTO STATUS MSG <<< "$key{$value:+:$value}"
;;
esac
done < response.txt
if [ -z "$STATUS" ]; then
echo "Host Connection failed: " "$SITAUTH_HOST" 1>&2
echo "Invalid Token" > access_token
echo "Invalid Token" > refresh_token
exit -1
fi
getTokenFromRefresh.sh
#!/bin/bash
##
# getTokenFromRefresh.sh
#
# Implement a Grant Resource Owner Credentials OAUTH scheme.
# Refresh token request
# Return a new valid token (and a refresh token) from a previous refresh token,
# This can be used when the access_token expires in order to prolong the already
validated credentials.
# Usage: getTokenFromRefresh
# Note: the refresh token must be available in file refresh_token and acquired by
getToken.sh previously
##
if [ -z "$STATUS" ]; then
echo "Host Connection failed: " "$SITAUTH_HOST" 1>&2
exit -1
fi
unifiedget.sh
#!/bin/bash
# Generate a single request to the Service Layer runtime (or engineering) URI using
the test token (see UnityStress if you need a login token)
# Input is the URL of the request.
# Output is the response to stdout and resonse.txt
RED='\033[1;31m'
YELLOW='\033[1;33m'
GREEN='\033[1;32m'
NOCOL='\033[0m' # No Color
TOKEN=$(cat access_token)
echo
#echo $1
URL="${1:?Usage $0 \'Service Layer Request URL\'; -h for help}"
CURL='curl -X GET '"'$URL'"' -H "Authorization: Bearer '$TOKEN'" -H "Accept:
application/json, text/plain, */*" -D header.txt'
echo $CURL
if [ "$1" = "-h" ]
then
echo "Usage:" $0 " 'Service Layer URL'"
echo "example: $0 '"'http://127.0.0.1/runtime/odata/$metadata'"'"
echo BEWARE of quoting URL with single quote \(like the example above\) to avoid
'"$metadata"' expansion!!!
exit -1
fi
fi
echo Error messages are:
echo -en ${RED}
cat response.txt | grep -o -P "\"message\":\".[^\"]*"\" | uniq
echo -en ${NOCOL}
exit -1
fi
unifiedpost.sh
#!/bin/bash
# Generate a single request to the Service Layer runtime (or engineering) URI using
the test token (see UnityStress if you need a regular login token)
# Input is the URL of the request and input.json.txt (the json object to send as a
body of the POST).
# Output is the response to stdout and response.txt
RED='\033[1;31m'
YELLOW='\033[1;33m'
GREEN='\033[1;32m'
NOCOL='\033[0m' # No Color
TOKEN=$(cat access_token)
echo
#echo $1
URL="${1:?Usage $0 \'Service Layer Request URL\'; -h for help}"
CURL='curl -X POST '"'$URL'"' -H "Authorization: Bearer '$TOKEN'" -H "Content-Type:
application/json" -H "Accept: application/json, text/plain, */*" --data-binary
@input.json.txt'
echo $CURL
if [ "$1" = "-h" ]
then
echo "Usage:" $0 " 'Service Layer URL'"
echo "example: $0 '"'http://127.0.0.1/runtime/odata/$metadata'"'"
echo BEWARE of quoting URL with single quote \(like the example above\) to avoid
'"$metadata"' expansion!!!
exit -1
fi
Prerequisite
The user who runs the Worker Monitor:
• belongs to the SIT_UNIFIED_LOW Windows group, both on the Opcenter EX FN hosts and, in case of separate
database server, on the SQL Server host.
• is a User Management Component user (for more information on how to import users to UMC, see Import
Windows Local Users in the UMC UMX User Manual).
• The Hosts tab shows the list of environment hosts with the related workers.
• The Worker Roles tab shows the configured Worker Roles, the assigned workers and for each selected worker
the following information:
• the worker type (Engineering, Administration, Application and Signal Manager),
• the running CPU type (x64 bit or x32 bit),
• the configured retries' number (see Creating a New Worker Role),
• the execution mode (either parallel or sequential),
• the parallel executions admitted, which are automatically set to 1 for the sequential worker roles and are
automatically calculated by the system for parallel workers (as explained at page Parallel vs. Sequential
Command and Event Handler Execution).
• The HA Groups tab shows the list of the of the High Availability Groups, which are currently used for Signal Rules
and Timers, for Sequential Worker Roles and for the RabbitMQ leader instance. This tab shows where each
group is active and the status on each host.
The HA Groups status returns an error (and the system switches to another HA group, if available) if the HA
Group fails repeatedly and rapidly within a system-defined time frame. See Deploying the Solution
Package to Hosts.
Host
Worker Role
Worker
Protected command
Private command
Public command, visible on the Service Layer, which can be either Protected or Composite
Composite command
Signal
Event
Signal Rule. Colors are used to indicate the rule execution status:
• : Rule error
• : Rule loaded
• : Rule running
• : Rule unknown
Placed on the bottom left corner of the dashboard, it indicates the presence of critical errors. Click on it to
see the list of errors.
The Worker Monitor displays the states of the elements that can have an error and a descriptive string.
{
"Environment": {
"Name": "Opcenter EX FN Environment",
"Hosts": [
{
"Name": "VM-OpcenterEXFN-1",
"InternalStatus": "Run",
"LogicalStatus": "Started",
"LastUpdate": "2019-09-04T14:41:51.9828876+00:00",
"HostUpdateTime": "2019-09-04T14:39:59.5447192+00:00",
"Workers": [
{
"Type": "Administration",
"Name": "VM-OpcenterEXFN-1.ADM.0",
"Role": "ADM",
"Status": "Ready",
"PID": 15628,
"LastUpdate": "2019-09-04T16:41:52.5952863+02:00",
"Statistics": {
"Runtime": {
"Name": "Runtime",
"Counters": {
"RunningHandlers": {
"Id": "RunningHandlers",
"Name": "RunningHandlers",
"Value": 0.0,
"AggregationType": "None"
},
"RunningRootCommands": {
"Id": "RunningRootCommands",
"Name": "RunningRootCommands",
"Value": 0.0,
"AggregationType": "None"
}
}
}
}
},
{
"Type": "Application",
"Name": "VM-OpcenterEXFN-1.Default WorkerRoleDefinition (x64).0",
"Role": "Default WorkerRoleDefinition (x64)",
"Status": "Ready",
"PID": 19852,
"LastUpdate": "2019-09-04T16:41:48.7021088+02:00",
"Statistics": {
"Runtime": {
"Name": "Runtime",
"Counters": {
"RunningHandlers": {
"Id": "RunningHandlers",
"Name": "RunningHandlers",
"Value": 0.0,
"AggregationType": "None"
},
"RunningRootCommands": {
"Id": "RunningRootCommands",
"Name": "RunningRootCommands",
"Value": 0.0,
"AggregationType": "None"
}
}
}
}
},
{
"Type": "Application",
"Name": "VM-OpcenterEXFN-1.SignalManager.0",
"Role": "SignalManager",
"Status": "Ready",
"PID": 18196,
"LastUpdate": "2019-09-04T16:41:49.6563591+02:00",
"Statistics": {
"Runtime": {
"Name": "Runtime",
"Counters": {
"RunningHandlers": {
"Id": "RunningHandlers",
"Name": "RunningHandlers",
"Value": 0.0,
"AggregationType": "None"
},
"RunningRootCommands": {
"Id": "RunningRootCommands",
"Name": "RunningRootCommands",
"Value": 0.0,
"AggregationType": "None"
}
}
}
}
},
{
"Type": "Engineering",
"Name": "VM-OpcenterEXFN-1.ENG.0",
"Role": "ENG",
"Status": "Ready",
"PID": 17156,
"LastUpdate": "2019-09-04T16:41:52.626541+02:00",
"Statistics": {
"Runtime": {
"Name": "Runtime",
"Counters": {
"RunningHandlers": {
"Id": "RunningHandlers",
"Name": "RunningHandlers",
"Value": 0.0,
"AggregationType": "None"
},
"RunningRootCommands": {
"Id": "RunningRootCommands",
"Name": "RunningRootCommands",
"Value": 0.0,
"AggregationType": "None"
}
}
}
}
}
],
"Statistics": {
"System": {
"Name": "System",
"Counters": {
"NumberOfCPUCores": {
"Id": "NumberOfCPUCores",
"Name": "NumberOfCPUCores",
"Value": 4.0,
"AggregationType": "None"
}
}
}
},
"License": {
"Expiration": "0001-01-01T00:00:00+00:00",
"ProductName": "SIT UAF",
"ProductVersion": "3.0",
"Type": "Entry server"
},
"Solution": {
"Name": "MonitoringTests",
"Version": null,
"Build": 2
},
"Warnings": [],
"Errors": [],
"AvailabilityGroups": [
{
"Name": "SignalManager-Timers",
"HostLeader": "",
"AliveTime": "2019-09-04T14:39:59.1608717+00:00",
"UpdateAliveTime": false,
"ErrorDescription": "",
"ErrorId": 0,
"LastUpdate": "2019-09-04T14:41:54.0642628+00:00",
"CheckTime": null,
"Status": "Active",
"ResourceGroup": []
},
{
"Name": "SignalManager-Rules",
"HostLeader": "",
"AliveTime": "2019-09-04T14:39:59.1784467+00:00",
"UpdateAliveTime": false,
"ErrorDescription": "",
"ErrorId": 0,
"LastUpdate": "2019-09-04T14:41:54.0642628+00:00",
"CheckTime": null,
"Status": "Active",
"ResourceGroup": []
}
],
"Subsystems": [
{
"Name": "Archiving DB",
"Status": "Fail",
"Properties": [
{
"Id": "ArchivingStatus",
"Displayname": "Archiving Status",
"Value": "Active",
"Description": ""
},
{
"Id": "CommandTimeout",
"Displayname": "Command Timeout",
"Value": "30000",
"Description": ""
},
{
"Id": "ConnectionTimeout",
"Displayname": "Connection Timeout",
"Value": "15000",
"Description": ""
},
{
"Id": "DataSource",
"Displayname": "Data Source",
"Value": "VM-OpcenterEXFN-1\\MES",
"Description": ""
},
{
"Id": "DatabaseType",
"Displayname": "Database Type",
"Value": "SqlServer",
"Description": ""
},
{
"Id": "Enabled",
"Displayname": "Enabled",
"Value": "True",
"Description": ""
},
{
"Id": "InitialCatalog",
"Displayname": "Initial Catalog",
"Value": "MonitoringTestsArchiving",
"Description": ""
},
{
"Id": "NumberOfRetries",
"Displayname": "Number Of Retries",
"Value": "500",
"Description": ""
},
{
"Id": "RetriesDelay",
"Displayname": "Retries Delay",
"Value": "500",
"Description": ""
},
{
"Id": "Schema",
"Displayname": "Schema",
"Value": "dbo",
"Description": ""
}
],
"Id": "MOMArchive",
"Description": "Archiving database",
"StatusDescription": "",
"LastUpdate": "2019-09-04T14:41:51.7357795+00:00"
},
{
"Name": "Automation Gateway",
"Status": "Fail",
"Properties": [],
"Id": "AGW",
"Description": "",
"StatusDescription": "HmiRuntimeService Startup failed.",
"LastUpdate": "2019-09-04T14:41:51.6859783+00:00"
},
{
"Name": "Engineering DB",
"Status": "Pass",
"Properties": [
{
"Id": "CommandTimeout",
"Displayname": "Command Timeout",
"Value": "90000",
"Description": ""
},
{
"Id": "ConnectionTimeout",
"Displayname": "Connection Timeout",
"Value": "15000",
"Description": ""
},
{
"Id": "DataSource",
"Displayname": "Data Source",
"Value": "VM-OpcenterEXFN-1\\MES",
"Description": ""
},
{
"Id": "DatabaseType",
"Displayname": "Database Type",
"Value": "SqlServer",
"Description": ""
},
{
"Id": "InitialCatalog",
"Displayname": "Initial Catalog",
"Value": "SIT_UA_Eng",
"Description": ""
},
{
"Id": "NumberOfRetries",
"Displayname": "Number Of Retries",
"Value": "50",
"Description": ""
},
{
"Id": "RetriesDelay",
"Displayname": "Retries Delay",
"Value": "500",
"Description": ""
},
{
"Id": "Schema",
"Displayname": "Schema",
"Value": "dbo",
"Description": ""
}
],
"Id": "EngineeringRepository",
"Description": "Engineering database",
"StatusDescription": "",
"LastUpdate": "2019-09-04T14:41:51.7162444+00:00"
},
{
"Name": "RabbitMQ",
"Status": "Pass",
"Properties": [
{
"Id": "cluster_name",
"Displayname": "Cluster Name",
"Value": "[email protected]",
"Description": ""
},
{
"Id": "configuration_mode",
"Displayname": "Configuration Mode",
"Value": "Cluster",
"Description": ""
},
{
"Id": "platform",
"Displayname": "Platform Version",
"Value": "Erlang/OTP 20.2",
"Description": ""
},
{
"Id": "version",
"Displayname": "RabbitMQ Version",
"Value": "3.6.14",
"Description": ""
}
],
"Id": "RabbitMQ",
"Description": "RabbitMQ Messaging Broker",
"StatusDescription": "",
"LastUpdate": "2019-09-04T14:41:52.2104677+00:00"
},
{
"Name": "Runtime DB",
"Status": "Pass",
"Properties": [
{
"Id": "CommandTimeout",
"Displayname": "Command Timeout",
"Value": "30000",
"Description": ""
},
{
"Id": "ConnectionTimeout",
"Displayname": "Connection Timeout",
"Value": "15000",
"Description": ""
},
{
"Id": "DataSource",
"Displayname": "Data Source",
"Value": "VM-OpcenterEXFN-1\\MES",
"Description": ""
},
{
"Id": "DatabaseType",
"Displayname": "Database Type",
"Value": "SqlServer",
"Description": ""
},
{
"Id": "InitialCatalog",
"Displayname": "Initial Catalog",
"Value": "MonitoringTests",
"Description": ""
},
{
"Id": "NumberOfRetries",
"Displayname": "Number Of Retries",
"Value": "500",
"Description": ""
},
{
"Id": "RetriesDelay",
"Displayname": "Retries Delay",
"Value": "500",
"Description": ""
},
{
"Id": "Schema",
"Displayname": "Schema",
"Value": "dbo",
"Description": ""
}
],
"Id": "MOM",
"Description": "Runtime database",
"StatusDescription": "",
"LastUpdate": "2019-09-04T14:41:51.7162444+00:00"
},
{
"Name": "System DB",
"Status": "Pass",
"Properties": [
{
"Id": "CommandTimeout",
"Displayname": "Command Timeout",
"Value": "30000",
"Description": ""
},
{
"Id": "ConnectionTimeout",
"Displayname": "Connection Timeout",
"Value": "15000",
"Description": ""
},
{
"Id": "DataSource",
"Displayname": "Data Source",
"Value": "VM-OpcenterEXFN-1\\MES",
"Description": ""
},
{
"Id": "DatabaseType",
"Displayname": "Database Type",
"Value": "SqlServer",
"Description": ""
},
{
"Id": "InitialCatalog",
"Displayname": "Initial Catalog",
"Value": "SIT_UA_sys",
"Description": ""
},
{
"Id": "NumberOfRetries",
"Displayname": "Number Of Retries",
"Value": "50",
"Description": ""
},
{
"Id": "RetriesDelay",
"Displayname": "Retries Delay",
"Value": "500",
"Description": ""
},
{
"Id": "Schema",
"Displayname": "Schema",
"Value": "dbo",
"Description": ""
}
],
"Id": "SystemFileStore",
"Description": "System database",
"StatusDescription": "",
"LastUpdate": "2019-09-04T14:41:51.7162444+00:00"
},
{
"Name": "Temporary DB",
"Status": "Pass",
"Properties": [
{
"Id": "CommandTimeout",
"Displayname": "Command Timeout",
"Value": "30000",
"Description": ""
},
{
"Id": "ConnectionTimeout",
"Displayname": "Connection Timeout",
"Value": "15000",
"Description": ""
},
{
"Id": "DataSource",
"Displayname": "Data Source",
"Value": "VM-OpcenterEXFN-1\\MES",
"Description": ""
},
{
"Id": "DatabaseType",
"Displayname": "Database Type",
"Value": "SqlServer",
"Description": ""
},
{
"Id": "InitialCatalog",
"Displayname": "Initial Catalog",
"Value": "SIT_UA_tmp",
"Description": ""
},
{
"Id": "NumberOfRetries",
"Displayname": "Number Of Retries",
"Value": "50",
"Description": ""
},
{
"Id": "RetriesDelay",
"Displayname": "Retries Delay",
"Value": "500",
"Description": ""
},
{
"Id": "Schema",
"Displayname": "Schema",
"Value": "dbo",
"Description": ""
}
],
"Id": "TemporaryFileStore",
"Description": "Temporary database",
"StatusDescription": "",
"LastUpdate": "2019-09-04T14:41:51.717228+00:00"
},
{
"Name": "User Management Component",
"Status": "Pass",
"Properties": [
{
"Id": "Connected to",
"Displayname": "Connected to",
"Value": "VM-OpcenterEXFN-1",
"Description": "The ring master machine."
},
{
"Id": "Electronic Log",
"Displayname": "Electronic Log",
"Value": "Running",
"Description": "Electronic Log server status."
},
{
"Id": "Resource Authenticator",
"Displayname": "Resource Authenticator",
"Value": "Running",
"Description": "Resource Authenticator server status."
},
{
"Id": "Role",
"Displayname": "Role",
"Value": "ring",
"Description": "The machine role."
},
{
"Id": "Safemode",
"Displayname": "Safemode",
"Value": "0",
"Description": "It is equal to 1 if the machine is a UM ring server
in safe mode, 0 otherwise."
},
{
"Id": "Status",
"Displayname": "Status",
"Value": "master",
"Description": "Umc Workstation status."
},
{
"Id": "UM Authenticator",
"Displayname": "UM Authenticator",
"Value": "Running",
"Description": "UM Authenticator server status."
},
{
"Id": "UM Broker Server",
"Displayname": "UM Broker Server",
"Value": "Running",
"Description": "",
"StatusDescription": null,
"LastUpdate": "2019-09-04T14:41:51.8871698+00:00"
}
]
}
],
"WorkerRoles": [
{
"Name": "ADM",
"Description": "",
"WorkerType": "ADM",
"TargetCPU": "x64",
"Retries": 5,
"ExecutionMode": "Parallel",
"NumberOfParallelExecutions": 0
},
{
"Name": "SignalManager",
"Description": "",
"WorkerType": "APP",
"TargetCPU": "x64",
"Retries": 0,
"ExecutionMode": "Parallel",
"NumberOfParallelExecutions": 0
},
{
"Name": "ENG",
"Description": "",
"WorkerType": "ENG",
"TargetCPU": "x64",
"Retries": 5,
"ExecutionMode": "Parallel",
"NumberOfParallelExecutions": 1
},
{
"Name": "Default WorkerRoleDefinition (x86)",
"Description": "",
"WorkerType": "APP",
"TargetCPU": "x86",
"Retries": 3,
"ExecutionMode": "Parallel",
"NumberOfParallelExecutions": 0
},
{
"Name": "maz",
"Description": "",
"WorkerType": "APP",
"TargetCPU": "x64",
"Retries": 3,
"ExecutionMode": "SequentialHA",
"NumberOfParallelExecutions": 1
},
{
"Name": "Default WorkerRoleDefinition (x64)",
"Description": "",
"WorkerType": "APP",
"TargetCPU": "x64",
"Retries": 3,
"ExecutionMode": "Parallel",
"NumberOfParallelExecutions": 0
}
],
"AvailabilityGroups": [
{
"Name": "SignalManager-Rules",
"HostLeader": "VM-OpcenterEXFN-1",
"AliveTime": "2019-09-04T14:39:59.1784467+00:00",
"UpdateAliveTime": false,
"ErrorDescription": "",
"ErrorId": 0,
"LastUpdate": "2019-09-04T14:41:54.0642628+00:00",
"CheckTime": null,
"Status": "Active",
"ResourceGroup": []
},
{
"Name": "SignalManager-Timers",
"HostLeader": "VM-OpcenterEXFN-1",
"AliveTime": "2019-09-04T14:39:59.1608717+00:00",
"UpdateAliveTime": false,
"ErrorDescription": "",
"ErrorId": 0,
"LastUpdate": "2019-09-04T14:41:54.0642628+00:00",
"CheckTime": null,
"Status": "Active",
"ResourceGroup": []
}
],
"Subsystems": [
{
"Name": "Archiving DB",
"Status": "Failed",
"Properties": [],
"Id": "MOMArchive",
"Description": "Archiving database",
"StatusDescription": "",
"LastUpdate": "2019-09-04T14:41:51.7357795+00:00"
},
{
"Name": "Automation Gateway",
"Status": "Failed",
"Properties": [],
"Id": "AGW",
"Description": "",
"StatusDescription": "",
"LastUpdate": "2019-09-04T14:41:51.6859783+00:00"
},
{
"Name": "Engineering DB",
"Status": "Running",
"Properties": [],
"Id": "EngineeringRepository",
"Description": "Engineering database",
"StatusDescription": "",
"LastUpdate": "2019-09-04T14:41:51.7162444+00:00"
},
{
"Name": "RabbitMQ",
"Status": "Running",
"Properties": [
{
"Id": "cluster_name",
"Displayname": "Cluster Name",
"Value": "[email protected]",
"Description": ""
},
{
"Id": "configuration_mode",
"Displayname": "Configuration Mode",
"Value": "Cluster",
"Description": ""
},
{
"Id": "platform",
"Displayname": "Platform Version",
"Value": "Erlang/OTP 20.2",
"Description": ""
},
{
"Id": "version",
"Displayname": "RabbitMQ Version",
"Value": "3.6.14",
"Description": ""
}
],
"Id": "RabbitMQ",
"Description": "RabbitMQ Messaging Broker",
"StatusDescription": "",
"LastUpdate": "2019-09-04T14:41:52.2104677+00:00"
},
{
"Name": "Runtime DB",
"Status": "Running",
"Properties": [],
"Id": "MOM",
Request examples
The following PowerShell example queries the endpoint by performing a request with a valid token and getting
environment information (such as the status host, or workers' status).
param (
[parameter(mandatory=$true, HelpMessage="The username of the Opcenter Execution
Foundation user")]
[string] $Username,
[parameter(ValueFromPipeline=$true, mandatory=$false, HelpMessage="Password")]
#The User Password
[securestring] $SecurePassword,
[parameter(mandatory=$false, HelpMessage="The base url for Opcenter Execution
Foundation")]
[string] $base_url
)
<#
.DESCRIPTION
Perform a [user,password] authentication and returns an object containing
the OAuth access_token and refresh_token
#>
function Get-UA-Token
{
param (
[parameter(mandatory=$true, HelpMessage="The protocol://host[:port] base url")]
#The protocol://host[:port] base url
[string] $Base_url,
[parameter(mandatory=$true, HelpMessage="User Name")] #The User Name to
authenticate
[string] $User,
[parameter(ValueFromPipeline=$true, mandatory=$true, HelpMessage="Password")] #The
User Password
[securestring] $SecurePassword
)
process {
$url = "$($Base_url)/sit-auth/OAuth/Token"
$UnsecurePassword = (New-Object PSCredential "user",
$SecurePassword).GetNetworkCredential().Password
$creds = @{
username = $User
password = $UnsecurePassword
grant_type = "password"
client_id = "pws_scripting_client"
client_secret = [string][guid]::NewGuid()
scope = "global"
}
$headers = @{
ContentType = "application/x-www-urlencoded"
}
$Token = ""
$RefreshToken = ""
try {
}
catch
{
if ($_.Exception.Response)
{
$http_error = $_.Exception.Response.StatusCode.value__
$http_error_msg = $_.Exception.Response.StatusCode
try {
$stream = $_.Exception.Response.GetResponseStream();
$reader = New-Object System.IO.StreamReader($stream);
$reader.BaseStream.Position = 0;
$reader.DiscardBufferedData();
return $Auth
}
}
<#
.DESCRIPTION
Get Monitoring information
#>
function Get-UA-Info
{
param (
[parameter(mandatory=$true, HelpMessage="The protocol://host[:port] base url")]
#The protocol://host[:port] base url
[string] $Base_url,
[parameter(mandatory=$true, HelpMessage="The OAuth Token to use")] #The OAuth Token
to use
[string] $Token
)
$url = "$($Base_url)/sit-svc/monitoring"
$headers = @{
"Authorization" = "Bearer $($Token)"
"Accepts" = "application/json"
}
$result = $null
try {
$result = Invoke-RestMethod -Uri $url -Method Get -Headers $headers
-SessionVariable Session 2>$null
}
catch
{
if ($_.Exception.Response)
{
$http_error = $_.Exception.Response.StatusCode.value__
$http_error_msg = $_.Exception.Response.StatusCode
$host.UI.WriteErrorLine("Http Error: $($_.Exception.message), Http error $
($http_error) - $($http_error_msg) " )
}
else {
$host.UI.WriteErrorLine("Generic Error: $($_.Exception.message)" )
}
return $null
}
return $result
}
if ($SecurePassword) {
# Retrieve token from the authorization server
$TokenResp = Get-UA-Token -Base_url "http://$base_url" -User $Username
-SecurePassword $SecurePassword
}else{
$TokenResp = Get-UA-Token -Base_url "http://$base_url" -User $Username
}
# Print the status of the first host of the Opcenter EX FN cluster configuration
Write-Output ("Status of the host " +$result.Environment.Hosts[0].Name+ ": "+
$result.Environment.Hosts[0].InternalStatus)
# Print the status of all the workers related to the first host
Write-Output "Workers"
foreach ($worker in $result.Environment.Hosts[0].Workers)
{
("Name: " + $worker.Name + ", Status: " + $worker.Status)
}
RabbitMQ subsystem
The information returned from the RabbitMQ subsystem is:
LastUpdate The date time (in UTC format) of the last poll
cycle for the subsystem. The value is
calculated by the Monitoring endpoint
automatically.
Id DisplayName Value
The properties will be environment relevant only for the leader host of the RabbitMQ subsystem.
{
"Id": "RabbitMQ",
"Name": "RabbitMQ",
"Description": "RabbitMQ Messaging Broker",
"Properties": [
{
"Id": "cluster_name",
"Displayname": "Cluster Name",
"Value": "rabbit@my-host-full-name"
},
{
"Id": "configuration_mode",
"Displayname": "Configuration Mode",
"Value": "Cluster"
},
{
"Id": "platform",
"Displayname": "Platform Version",
"Value": "Erlang/OTP 20.2"
},
{
"Id": "version",
"Displayname": "RabbitMQ Version",
"Value": "3.6.14"
}
],
"Status": "Pass",
"StatusDescription": "",
"LastUpdate": "0001-01-01T00:00:00+00:00"
}
LastUpdate Timestamp The date time (in UTC format) of the last poll
cycle for the subsystem. The value is calculated
by the Monitoring endpoint automatically.
Id DisplayName Value
{
"Id": "AGW",
"Name": "Automation Gateway",
"Description": "",
"Properties": [
{
"Id": "ActiveNode",
"Displayname": "Active node",
"Value": "NODE-A"
}
],
"Status": "Pass",
"StatusDescription": null,
"LastUpdate": "2019-07-17T16:20:30.2225437+00:00"
}
UMC subsystem
The returned information from the UMC subsystem is:
StatusDes string The description of the status. The description is an empty string if the status
cription is equal to Pass otherwise it will return the error description.
Properties Array The specific properties of the UMC subsystem. See below for further details.
LastUpdat Timestamp The date time (in UTC format) of the last poll cycle for the subsystem. The
e value is calculated by the Monitoring endpoint automatically.
Id DisplayNa Value
me
Machine Machine The number of days before the certificate expires. If 0 is returned, the certificate is
Certificat Certificat expired. If the property is empty, the certificate is missing.
e e
Expiratio Expiration
n
Network Network The number of days before the certificate expires. If 0 is returned, the certificate is
Certificat Certificat expired. If the property is empty, the certificate is missing.
e e
Expiratio Expiration
n
Safemod Safemode It is equal to 1 if the machine is a UM ring server in safe mode, 0 otherwise.
e
Id DisplayNa Value
me
{
"Name": "User Management Component",
"Status": "Pass",
"Properties": [
{
"Id": "Connected to",
"Displayname": "Connected to",
"Value": "vm-vdip37-069",
"Description": "The ring master machine."
},
{
"Id": "Electronic Log",
"Displayname": "Electronic Log",
"Value": "Running",
"Description": "Electronic Log server status."
},
{
"Id": "Resource Authenticator",
"Displayname": "Resource Authenticator",
"Value": "Running",
"Description": "Resource Authenticator server status."
},
{
"Id": "Role",
"Displayname": "Role",
"Value": "ring",
"Description": "The machine role."
},
{
"Id": "Safemode",
"Displayname": "Safemode",
"Value": "0",
"Description": "It is equal to 1 if the machine is a UM ring server
in safe mode, 0 otherwise."
},
{
"Id": "Status",
"Displayname": "Status",
"Value": "master",
"Description": "Umc Workstation status."
},
{
"Id": "UM Authenticator",
"Displayname": "UM Authenticator",
"Value": "Running",
"Description": "UM Authenticator server status."
},
{
"Id": "UM Broker Server",
"Displayname": "UM Broker Server",
"Value": "Running",
"Description": "UM Broker Server server status."
},
{
"Id": "UM File Server",
"Displayname": "UM File Server",
"Value": "Running",
"Description": "UM File Server server status."
},
{
"Id": "UM Join Server",
"Displayname": "UM Join Server",
"Value": "Running",
"Description": "UM Join Server server status."
},
{
"Id": "UM Key Server",
"Displayname": "UM Key Server",
"Value": "Running",
"Description": "UM Key Server server status."
},
{
"Id": "UM Remote IPC Service",
"Displayname": "UM Remote IPC Service",
"Value": "Running",
"Description": "UM Remote IPC Service server status."
},
{
"Id": "UM Ring Server",
"Displayname": "UM Ring Server",
"Value": "Running",
"Description": "UM Ring Server server status."
},
{
"Id": "UM Secure Communication Service",
"Displayname": "UM Secure Communication Service",
"Value": "Running",
"Description": "UM Secure Communication Service server status."
},
{
"Id": "UM Server Proxy",
"Displayname": "UM Server Proxy",
"Value": "Running",
"Description": "UM Server Proxy server status."
},
{
"Id": "Version",
"Displayname": "Version",
"Value": "206.0.402.7",
"Description": "Installed UMC version."
}
],
"Id": "UMC",
"Description": "",
"StatusDescription": null,
"LastUpdate": "2019-08-06T10:21:32.6273893+00:00"
}
StatusDe The description of the status. The description is an empty string if the status
scription is equal to Pass otherwise it will return the error description.
Propertie An array containing the specific properties of the Data Source subsystem.
s See below for further details.
LastUpda The date time (in UTC format) of the last poll cycle for the subsystem. The
te value is calculated by the Monitoring endpoint automatically.
Id DisplayName Value
ConnectionTimeout Connection Timeout The timeout for the database connection (in
milliseconds).
RetriesDelay Retries Delay The delay (in milliseconds) after which a new
command retry will start.
Id DisplayName Value
{
"Name": "Archiving DB",
"Status": "Ignore",
"Properties": [
{
"Id": "ArchivingStatus",
"Displayname": "Archiving Status",
"Value": "NotConfigured",
"Description": ""
},
{
"Id": "CommandTimeout",
"Displayname": "Command Timeout",
"Value": "30000",
"Description": ""
},
{
"Id": "ConnectionTimeout",
"Displayname": "Connection Timeout",
"Value": "15000",
"Description": ""
},
{
"Id": "DataSource",
"Displayname": "Data Source",
"Value": "VM-VDIP37-046\\MES",
"Description": ""
},
{
"Id": "DatabaseType",
"Displayname": "Database Type",
"Value": "SqlServer",
"Description": ""
},
{
"Id": "Enabled",
"Displayname": "Enabled",
"Value": "False",
"Description": ""
},
{
"Id": "InitialCatalog",
"Displayname": "Initial Catalog",
"Value": "MySolArchiving",
"Description": ""
},
{
"Id": "NumberOfRetries",
"Displayname": "Number Of Retries",
"Value": "500",
"Description": ""
},
{
"Id": "RetriesDelay",
"Displayname": "Retries Delay",
"Value": "500",
"Description": ""
},
{
"Id": "Schema",
"Displayname": "Schema",
"Value": "dbo",
"Description": ""
}
],
"Statistics": null,
"Id": "MOMArchive",
"Description": "Archiving database",
"StatusDescription": "",
"LastUpdate": "2019-09-06T08:19:01.621901+00:00"
},
{
"Name": "Engineering DB",
"Status": "Pass",
"Properties": [
{
"Id": "CommandTimeout",
"Displayname": "Command Timeout",
"Value": "90000",
"Description": ""
},
{
"Id": "ConnectionTimeout",
"Displayname": "Connection Timeout",
"Value": "15000",
"Description": ""
},
{
"Id": "DataSource",
"Displayname": "Data Source",
"Value": "VM-VDIP37-046\\MES",
"Description": ""
},
{
"Id": "DatabaseType",
"Displayname": "Database Type",
"Value": "SqlServer",
"Description": ""
},
{
"Id": "InitialCatalog",
"Displayname": "Initial Catalog",
"Value": "SIT_UA_Eng",
"Description": ""
},
{
"Id": "NumberOfRetries",
"Displayname": "Number Of Retries",
"Value": "50",
"Description": ""
},
{
"Id": "RetriesDelay",
"Displayname": "Retries Delay",
"Value": "500",
"Description": ""
},
{
"Id": "Schema",
"Displayname": "Schema",
"Value": "dbo",
"Description": ""
}
],
"Statistics": null,
"Id": "EngineeringRepository",
"Description": "Engineering database",
"StatusDescription": "",
"LastUpdate": "2019-09-06T08:19:10.3270881+00:00"
},
{
"Name": "Runtime DB",
"Status": "Pass",
"Properties": [
{
"Id": "CommandTimeout",
"Displayname": "Command Timeout",
"Value": "30000",
"Description": ""
},
{
"Id": "ConnectionTimeout",
"Displayname": "Connection Timeout",
"Value": "15000",
"Description": ""
},
{
"Id": "DataSource",
"Displayname": "Data Source",
"Value": "VM-VDIP37-046\\MES",
"Description": ""
},
{
"Id": "DatabaseType",
"Displayname": "Database Type",
"Value": "SqlServer",
"Description": ""
},
{
"Id": "InitialCatalog",
"Displayname": "Initial Catalog",
"Value": "MySol",
"Description": ""
},
{
"Id": "NumberOfRetries",
"Displayname": "Number Of Retries",
"Value": "500",
"Description": ""
},
{
"Id": "RetriesDelay",
"Displayname": "Retries Delay",
"Value": "500",
"Description": ""
},
{
"Id": "Schema",
"Displayname": "Schema",
"Value": "dbo",
"Description": ""
}
],
"Statistics": null,
"Id": "MOM",
"Description": "Runtime database",
"StatusDescription": "",
"LastUpdate": "2019-09-06T08:19:10.3270881+00:00"
},
{
"Name": "System DB",
"Status": "Pass",
"Properties": [
{
"Id": "CommandTimeout",
"Displayname": "Command Timeout",
"Value": "30000",
"Description": ""
},
{
"Id": "ConnectionTimeout",
"Displayname": "Connection Timeout",
"Value": "15000",
"Description": ""
},
{
"Id": "DataSource",
"Displayname": "Data Source",
"Value": "VM-VDIP37-046\\MES",
"Description": ""
},
{
"Id": "DatabaseType",
"Displayname": "Database Type",
"Value": "SqlServer",
"Description": ""
},
{
"Id": "InitialCatalog",
"Displayname": "Initial Catalog",
"Value": "SIT_UA_sys",
"Description": ""
},
{
"Id": "NumberOfRetries",
"Displayname": "Number Of Retries",
"Value": "50",
"Description": ""
},
{
"Id": "RetriesDelay",
"Displayname": "Retries Delay",
"Value": "500",
"Description": ""
},
{
"Id": "Schema",
"Displayname": "Schema",
"Value": "dbo",
"Description": ""
}
],
"Statistics": null,
"Id": "SystemFileStore",
"Description": "System database",
"StatusDescription": "",
"LastUpdate": "2019-09-06T08:19:09.5292215+00:00"
},
{
"Name": "Temporary DB",
"Status": "Pass",
"Properties": [
{
"Id": "CommandTimeout",
"Displayname": "Command Timeout",
"Value": "30000",
"Description": ""
},
{
"Id": "ConnectionTimeout",
Available operations
You can log and analyze application traces by referring to the following available operations, and logging options,
listed below.
• Functional options:
• Starting Trace Viewer
• Choosing trace providers
• Splitting ETL Files
• Setting the Logging Mode
• Exporting Traces to a Persistent Storage
• Exporting Traces To Windows Performance Monitor
• Generating Custom Trace Providers
Traces all actions Traces only application level Trace Viewer logs all the actions carried out by
messages the platform (such as command execution,
authentication, queries on the database), while
Application Log traces only application level
messages.
Is more development Is more end-user oriented Trace Viewer is more suitable for advanced
oriented troubleshooting issues since it is highly verbose
and technical. Moreover it can contain logs
generated by the business logic, in terms of
command/event handlers, if the code uses them.
On the other hand Application Log is more
functional and end-user oriented. Consequently,
its messages are also more readable, and they
can be translated.
Stores logs in a database Stores logs in a database Both applications can store logs in a database,
but database maintenance and database maintenance but while Application Log can apply standard
is custom is standard provided maintenance procedures to clean old messages,
for Trace Viewer the database maintenance is
custom.
Logs can be filtered and Logs can be filtered by level, In Trace Viewer, logs are classified in levels (from
sorted out by level and business command and verbose to critical), and in providers (representing
provider source Functional Block or the "component" which has generated a certain
App log). Levels and providers can be used to filter
messages, both in view mode and in storage
mode (to avoid that logs let the database grow in
uncontrolled way). In Application Log, logs can be
defined as different levels (from verbose to
critical as in Trace Viewer), return the name of the
business command that generated them, as well
as the "owners" of the commands (typically
Functional Blocks, Apps or Extension Apps).
For more information on Application logs, refer to How To Manage Application Logs and Application Log App in the
Opcenter Execution Foundation User Manual.
• Viewing options:
• Choosing Columns
• Sorting Events
• Grouping Correlated Messages
• Applying Filters and Highlights
• Setting the Display Configuration
• Setting the Display Options in the Main Panel
If you only want to analyze application traces in a local machine, you can use the Trace Viewer Stand-Alone.
Prerequisites
• No Opcenter EX FN version is installed in the local machine.
• Visual Studio 2017 run-time Redistributable is installed.
• .NET framework 4.7.2 or 4.8.
• Windows 10, Windows Server 2016, or Windows Server 2019.
Procedure
1. From an already installed system, open the bin folder located in %SITUnifiedSystemRoot% and copy
the EtwViewer.exe file.
2. From the local machine, paste the EtwViewer.exe file in a dedicated folder.
3. Double-click EtwViewer.exe to open the application.
Available Operations
• Splitting ETL Files
• Choosing Columns
• Applying Filters and Highlights
• Setting the Display Configuration
• Sorting Events
The following operations are described in Setting the Logging Mode:
• Opening recorded ETL files
• Converting ETL files
• Opening an ETZ file
Prerequisite
You must be logged on with a Windows administrator user. If you use the tool with a non-administrative user, you
can read and save ETZ files, but you cannot access real time functionalities.
Procedure
1. From %SITUnifiedSystemRoot%bin run the EtwViewer.exe file with administrative rights.
2. Choose only the required providers whose traces you want to monitor and set the verbosity level.
3. Set the limit of the displayed messages by using the spin buttons in the Max Messages list box. The maximum
accepted number is 500.000 and you cannot change it. Once this number is reached, any older messages will no
longer be displayed.
4. Select one of the available logging modes and start analysis.
Make sure that each session does not remain open for too long or you might encounter problems with the
new incoming messages.
If you need long tracing sessions, consider non real-time logging modes or any export to a persistent
storage.
Operation Description
Tools > Check Opcenter Execution It allows you to check which providers are installed on the current
Foundation providers Installed node. If required, you can specify the machine to which you want to
connect.
This window is read-only and can be used to check whether all
SIMATIC IT providers have been correctly installed.
Tools > ETW Sessions Monitor It allows you to monitor and troubleshoot the state of the active
sessions. If required, you can specify the node you want to
monitor.
This functionality allows you to see if any sessions are open (for
example, after an error occurred a session may remain open).
All sessions have a name. SIMATIC IT sessions start with
"SIMATICIT" inside the session name.
If the number of open sessions is too large, you can either
• close all sessions by clicking Clean SIMATIC Sessions or
• close only the selected one by clicking Close Selected
Sessions.
After this operation, you must always restart Trace Viewer.
Tools > Options It allows you to set the visualization options for all traces, by
choosing the column separator, the timestamp format and the
message color in order to create the default schema.
Double-click the element You can see the details of each single trace by double-clicking on
the required row.
Procedure
1. In the main Trace Viewer window, select the Providers > Choose providers command: the Trace Viewer loads a
default list of platform providers (be aware that User Management Component providers are not included in the
default list).
2. To reduce the providers list, select the providers you want to exclude and click Remove Selected.
3. Select the Default Level of verbosity that will be applied to all providers. You can also set the verbosity level for
each provider by selecting the provider in the grid and then the required filter level from the Level drop-
down list.
4. Only for the Microsoft-Windows-DotNETRuntime provider, select the Enable Exception Listening check box
to capture exceptions.
5. Set the Keyword filtering level for each provider and click OK. If you do not apply any filter, all keywords are
applied (for keyword explanation, see below).
Available Operations
Click ... To...
Restore Default Restore the default providers configuration and other settings.
Settings
Undo Last Changes Restore the settings to the active configuration (the one set at the moment in which the
window open).
Filter by process Filter by a specific process by entering the name of the required process (e.g.
name WorkerMonitor.exe, LogRouterService.exe, etc...)
Note If you do not save the provider configuration to an XML file, the given provider
configuration will only be used for the current Trace Viewer instance.
Setup Input Events Set a filter on the incoming events. This filter will be applied before inserting events in
Filter the buffer, thus reducing the memory usage when the user knows in advance which
events are not useful.
Note: When an input filter is active, the text color of the button is red.
Import from Import and export a template to be used for Performance Monitor.
PerfMon Template
Siemens- Execution of the Command and Event Handlers inside the execution engine (execution pipeline) of
SimaticIT all Worker types (Application, Administration and Engineering Workers).
-Trace-
Runtime
Siemens- Execution of Command Handlers related to previous versions of the Unified Data Model
SimaticIT component.
-Trace-
The platform offers providers that are dedicated to UDM (see below).
Business
Logic
If you retrieve traces from this provider in verbose mode, you will receive personal data
configured in the Personnel App.
The principles of data protection are important to Siemens and out affiliates. Our
products, including Opcenter Execution Foundation, are designed with privacy in mind
and adhere to Siemens’ data protection requirements. Please visit our privacy statement
for more details.
The product processes / stores the following personal data: FirstName, LastName, Email
Addresses, Phone Numbers, Date Of Birth, Nationality, State, City, Address, ZipCode,
UserName.
It is essential to collect this information to identify the authorized operators. We only
store the data for as long as necessary. Please contact customer support with any
questions.
Siemens- Authentication operations at several levels (Workers, Service Layers, Authorization Server),
SimaticIT authorization operations executed by Workers and Service Layer, and cryptography.
-Trace-
Security
Siemens- Reading and writing operations at Event and Command Handler level, reading operations
SimaticIT performed by applications that use IUnifiedSdkLean interface, reading operations performed via
-Trace- OData, and reading or writing operations executed on the system file store databases.
Informati
on
Siemens- Internal debugging operations of engineering logic execution, which is used to manage the
SimaticIT Manufacturing Solution.
-Trace-
Engineeri
ng
Siemens- Operations executed by the Opcenter EX FN Service Layer, i.e. all the requests for entities and
SimaticIT commands that arrive from clients. The traces contain the name of the App to which the requested
-Trace- command or entity belong. The traces also provide you with initialization information. The
ServiceLa initialization takes place when a client invokes the Service Layer for the first time. The traces refer
yer to all Service Layer applications: Administration, Engineering and Application.
Siemens- The operations executed by the SIMATIC IT UAF Service (which is used internally to launch the
SimaticIT platform Workers).
-Trace-
Launcher
Siemens- The operations executed by the Worker Monitor: loading data from the Governance Registry and
SimaticIT errors that might be returned during this operation.
-Trace-
WorkerM
onitor
Siemens- The operations executed by the Authorization Server, which is the component that generates
SimaticIT authorization tokens.
-Trace-
Authoriza
tionServe
r
Siemens- The operations traced by SQL Profiler. These operations refer to the SQL or PL/SQL statements
SimaticIT regarding the reading operations (Query and ProjectionQuery) and the writing operations (Submit/
-Trace- Delete) involving either the Opcenter EX FN database or any external databases.
SQLProfil
ing
Siemens- The operations executed by the Signal Manager and the SignalRuleStatusChangedEvent event.
SimaticIT
-Trace-
Signallin
g
Siemens- Execution of Command and Event Handlers related to generic operations in UDM.
SimaticIT
-Trace-
UDM
Siemens- Execution of Commands and Event Handlers related to Application Log in UDM.
SimaticIT
The main entities involved are ApplicationLog, Rule, Schedule and CleaningCondition.
-Trace-
UDM-
Applicati
onLog
Siemens- Execution of Command and Event Handlers related to Equipment management in UDM.
SimaticIT
The main entities involved are Machine and Storage in the Master Data and Operational Data
-Trace-
domains.
UDM-
Equipme
nt
Siemens- Execution of Command and Event Handlers related to Material management in UDM.
SimaticIT
The main entities involved are:
-Trace-
UDM- • Material Group, Bill of Materials and Material in the Master Data domain.
Material • Material Tracking Unit, Material Lot and Material Tracking Unit Aggregate in the Operational
Data domain.
Siemens- Execution of Command and Event Handlers related to Operation management in UDM.
SimaticIT
The main entities involved are Bill of Operations, Operation and Work Procedure in the Master Data
-Trace-
domain.
UDM-
Operatio
n
Siemens- Execution of Command and Event Handlers related to Production Rule management in UDM.
SimaticIT
The main entities involved are Product-driven Production Rule and Process-driven Production Rule
-Trace-
in the Master Data domain.
UDM-
Producti
onRule
Siemens- Execution of Command and Event Handlers related to State Machine management in UDM.
SimaticIT
The main entities involved are State Machine and Status Definition in the Reference Data domain.
-Trace-
UDM-
StateMac
hine
Siemens- Execution of Command and Event Handlers related to Task management in UDM.
SimaticIT
The main entities involved are:
-Trace-
UDM- • Task Types and Task Definitions in the Master Data domain.
Task • Tasks in the Operational Data domain.
If the verbosity level is set to Verbose, the input and output parameters of commands are also
logged.
Siemens- Execution of Command and Event Handlers related to Unit of Measure management in UDM.
SimaticIT
The main entities involved are UoM Group and UoM in the Reference Data domain.
-Trace-
UDM-
UnitOfMe
asure
Siemens- Execution of Command and Event Handlers related to Work Calendar management in UDM.
SimaticIT
The main entities involved are Time Slice, Time Period, Working Pattern, Work Calendar Rule and
-Trace-
Work Calendar in the Master Data domain.
UDM-
WorkCale
ndar
Siemens- Execution of Command and Event Handlers related to Work Order management in UDM.
SimaticIT
The main entities involved are Work Order, Work Order Operation and Work Order Operation Task
-Trace-
in the Operational Data domain.
UDM-
WorkOrd
er
Siemens- The authentication operations and the database modifications related to users or groups, traced
SimaticIT by User Management Component.
-Trace-
UMC-
If you retrieve traces from this provider, you will receive personal data configured in the
Authentic User Management Component.
ation
The principles of data protection are important to Siemens and out affiliates. Our
products, including Opcenter Execution Foundation, are designed with privacy in mind
and adhere to Siemens’ data protection requirements. Please visit our privacy statement
for more details.
The products processes / stores the following personal data: FirstName, LastName,
Description, Phone Number, Email Address, Email SID, Initials, and Associated Groups.
It is essential to collect this information to identify the authorized users. We only store the
data for as long as necessary. Please contact customer support with any questions.
Siemens- The communication layer (server and client) operations traced by User Management Component.
SimaticIT
-Trace-
If you retrieve traces from this provider, you will receive personal data configured in the
UMC- User Management Component.
Commun
ication The principles of data protection are important to Siemens and out affiliates. Our
products, including Opcenter Execution Foundation, are designed with privacy in mind
and adhere to Siemens’ data protection requirements. Please visit our privacy statement
for more details.
The products processes / stores the following personal data: FirstName, LastName,
Description, Phone Number, Email Address, Email SID, Initials, and Associated Groups.
It is essential to collect this information to identify the authorized users. We only store the
data for as long as necessary. Please contact customer support with any questions.
Siemens- The configuration operations traced by User Management Component (e.g. UMConf traces).
SimaticIT
-Trace-
If you retrieve traces from this provider, you will receive personal data configured in the
UMC- User Management Component.
Conf
The principles of data protection are important to Siemens and out affiliates. Our
products, including Opcenter Execution Foundation, are designed with privacy in mind
and adhere to Siemens’ data protection requirements. Please visit our privacy statement
for more details.
The products processes / stores the following personal data: FirstName, LastName,
Description, Phone Number, Email Address, Email SID, Initials, and Associated Groups.
It is essential to collect this information to identify the authorized users. We only store the
data for as long as necessary. Please contact customer support with any questions.
Siemens- The operations traced by User Management Component applications that are not managed by
SimaticIT other UMC Providers.
-Trace-
UMC-
If you retrieve traces from this provider, you will receive personal data configured in the
Default User Management Component.
The principles of data protection are important to Siemens and out affiliates. Our
products, including Opcenter Execution Foundation, are designed with privacy in mind
and adhere to Siemens’ data protection requirements. Please visit our privacy statement
for more details.
The products processes / stores the following personal data: FirstName, LastName,
Description, Phone Number, Email Address, Email SID, Initials, and Associated Groups.
It is essential to collect this information to identify the authorized users. We only store the
data for as long as necessary. Please contact customer support with any questions.
Siemens- The engineering operations related to users/groups traced by User Management Component.
SimaticIT
-Trace-
If you retrieve traces from this provider, you will receive personal data configured in the
UMC- User Management Component.
Engineeri
ng The principles of data protection are important to Siemens and out affiliates. Our
products, including Opcenter Execution Foundation, are designed with privacy in mind
and adhere to Siemens’ data protection requirements. Please visit our privacy statement
for more details.
The products processes / stores the following personal data: FirstName, LastName,
Description, Phone Number, Email Address, Email SID, Initials, and Associated Groups.
It is essential to collect this information to identify the authorized users. We only store the
data for as long as necessary. Please contact customer support with any questions.
Siemens- The operations traced by User Management Component Provisioning Service (import and
SimaticIT alignment of domain users).
-Trace-
UMC-
If you retrieve traces from this provider, you will receive personal data configured in the
Provision User Management Component.
ing
The principles of data protection are important to Siemens and out affiliates. Our
products, including Opcenter Execution Foundation, are designed with privacy in mind
and adhere to Siemens’ data protection requirements. Please visit our privacy statement
for more details.
The products processes / stores the following personal data: FirstName, LastName,
Description, Phone Number, Email Address, Email SID, Initials, and Associated Groups.
It is essential to collect this information to identify the authorized users. We only store the
data for as long as necessary. Please contact customer support with any questions.
The following trace providers are for testing internal use, and can be disabled if not required for internal
testing:
• Siemens-SimaticIT-Trace-Log1
• Siemens-SimaticIT-Trace-Log2
• Siemens-SimaticIT-Trace-Test
In the box Do To
Source ETL File Browse for the ETL file Select the ETL file to convert.
Target file Browse for the converted ETZ file Create the ETZ file with the
suffix _progressivenumber.etz and locate
it in the desired folder.
Number of files Click the spin button Set the number of ETZ files that will
contain the converted ETL file.
3. Click OK: the newly-converted ETZ file is displayed in the selected location in order to perform the same
operations of the ETL file.
Analyzing messages
On ETL files, ETZ files or messages displayed in runtime (in Pause mode), you can execute display operations on
messages, such as changing the sorting order, grouping correlated messages, choosing columns to view,
highlighting messages.
Reducing the size of the ETL files saves the disk capacity but does not affect the memory and the runtime
working time.
Suggestions
• Split the ETL file if its size is greater than 1GB.
• Set the number of split files between 2 and 30 files.
Procedure
1. In Trace Viewer, select either of the following commands:
• File > Split ETL File
• Tools/Export > Split ETL File
2. In the Split ETL file dialog box, do the following:
In the box Do To
Source ETL File Browse for the ETL file Select the ETL file to split.
In the box Do To
Target file Browse for the target files Select the destination directory that will
contain the split ETL files, and enter the base
name.
The split files will be created in this directory,
and their names will be generated with a
progressive number starting from zero.
E.g. if you enter the base name "XYZ.etl" and
set Number of files to 3, the generated files
will be named "XYZ_0.etl", "XYZ_1.etl",
"XYZ_2.etl".
Number of files Click the spin button Set how many files will contain the source
split ETL file.
Compress Target file Select the check box Reduce the size of the split ETL files.
(Optional)
3. Click OK.
Procedure
1. In Starting Trace Viewer Session, select the Tools > Choose Columns command.
2. Select (or unselect) the check boxes corresponding to the columns you want to display and click OK to confirm.
Note that the columns Event Name, Time Stamp, Level and Provider Name are selected by default and cannot
be unselected since they are the message identifiers.
3. If you want to restore the default settings, click the Restore Default button and return to the post-setup
configuration.
Column Description
Column Description
Process ID Identifier of the process inside the system (assigned by the operating
system).
Thread ID Identifier of the thread inside the system (assigned by the operating
system).
Op Code Name Information details about the executed operation (defined by each
provider).
Task Name Information details about the executed operation (defined by each
provider).
Generic Payload String containing all the trace information (that can be used when the
providers do not send the formatted message).
Verbosity The highest keyword among the ones that have been associated with
the trace. If you have set a keyword in the Choose Provider dialog box
(only for SIMATIC IT providers), this column shows that keyword. For
external providers this column remains empty.
Call Stack Information details that are specific for exceptions and that are only
traced by Microsoft-Windows-DotNETRuntime provider. You can
enable Trace Viewer to show a specific trace when a process, which
originated some message, throws an exception. Exceptions can be
captured and displayed by selecting the Enable Exception
Listening check box inside the Choose Providers dialog box. If you add
the Call Stack column from within the Choose Columns dialog box and
then you click on the exception message you can see the sequence of
operations that the program was executing before throwing the
exception.
Opcenter EX FN Context Information details about the SIMATIC IT provider. Select this check box
to show its related columns, otherwise remove the selection and click
the desired column you want to show in the message.
Column Description
Host Name The name of the machine that sends the trace.
AppName Identifier of the target application that will receive the command
request exposed by the backend application.
Artifact Type Filled in only for the beginning and ending messages of a Handler in the
Siemens-SimaticIT-Trace-Execution-Engine provider. Its possible
values
are: CommandHandler, CompositeCommandHandler, EventHandler
, PreCheckHandler, PostActionHandler, ReadingFunctionHandler.
Column Description
From Name of the host sending the message. It is useful to determine the
exact node and application which is sending the message. The string
contains the host name, the host logical name and PID.
Host name is the computer name of the originator node. Logical name
is the name of the application passed by the user application. PID is the
process ID of the sending process.
CorrelationId ID that groups a set of traces that follow the same execution logic. This
field is useful to set filters and view related traces.
CurrentId Identifier of the current event or command. This identifier can be used
to select the traces related to a particular command or event.
ParentId Identifier of the parent command within the command chain. This
identifier represents the relationship in the command execution chain.
RootRequestId Identifier of the root command inside the command chain. This
identifier is used to group the same command execution chain, from
the logical root where it is originated and for all related children.
By default, the displayed events are arranged by columns and sorted chronologically in ascending order, so the first
column displayed is the Time Stamp, but you can change the visualization order of the columns and its content as
explained below.
Procedure
1. In Trace Viewer, select the Edit > Sort command.
2. From the First drop-down list, select the column whose events you want to sort and then set its content order
(Ascending, Descending, NoSort).
3. From the Then drop-down list, select the column whose events you want to sort afterwards, and set its content
order. Optionally, you can sort another 3 columns.
4. Click OK.
Additional operations
• Click the column's header to change the visualization order of the column: the column selected is the first
displayed and the Time Stamp the second.
• Click Unsort to reset the sorting order.
• Click the column's header to change the order of the event content (Ascending, Descending).
CurrentId is the current GUID of a single command or event. It can be used to select the current context of
execution for a particular command or to follow the event to its handlers for a fired event on the bus.
Command execution chains must be intended as nested calls to local commands except for
the CorrelationId use case, whose value is propagated also when the called command is remote.
To have an example of the correlation logic, consider the following use cases for command and event execution.
Send Command0:
CommandHandler0:
Command1:
SubCommand11:
SubCommand112:
Command2:
SubCommand21:
SubCommand22:
Fire EventA:
Fire EventA:
EventHandlerA:
Command1:
SubCommand11:
SubCommand112:
Command2:
SubCommand21:
SubCommand22:
Fire EventB:
CompositeCommand0:
CompositeCommandHand
ler0:
CompositeCommand1:
CompositeCommandHand
ler1:
CompositeCommand0:
CompositeCommandHand
ler0:
Command1:
CommandHandler1:
CompositeCommand0:
CompositeCommandHand
ler0:
FireEventA:
EventHandlerA
FireEventA:
EventHandlerA:
CompositeCommand1:
CompositeCommandHa
ndler1
Procedure
To filter and highlight messages, apply condition rules as follows:
1. In Starting Trace Viewer Session, select either of the following commands:
• Edit > Highlight
• Edit > Filter
2. Set a value inside the Field drop-down list to filter by certain fields (such as time stamp, provider name, thread
Id etc)
3. Select the logical operator of the condition and set the value to filter by (such as the date time for the time
stamp, provider name ,thread Id).
4. (Only for highlighting) Set the color to highlight the messages that match the previously set condition.
5. Optionally, you can select the analysis type by clicking Advanced and then choose one of the following analysis
functions:
• Host Process
• All Host Process Thread
• UAF relevant Host Process Thread
• Process Thread
6. Repeat steps 1-5 for each additional condition.
These rules can be saved as a filter and loaded afterwards.
Removing conditions
• Click Clear All Rules to remove any active conditions for highlights and filters. Trace Viewer updates the
displayed traces and resets any condition.
• Click Highlight or Filter to display the previously defined conditions.
• Select the red cross icon to directly remove a single filter or highlight condition.
• Select the toggle button to temporarily disable a single filter or highlight condition.
• Select an empty option inside a condition to delete all subsequent rules.
• Click Restore Initial Rules to reset any modified or removed conditions.
Procedure
1. In Starting Trace Viewer Session, select the Tools > Options command.
2. In the Column Separator area, select either of the following check boxes:
• System to use the system default separator (set in Regional Settings).
• Semicolon (selected by default)
• Tab
• Other, and enter the desired separator in the adjacent box.
The box below displays an example of the data visualization in the exported file.
3. In the TimeStamp Format area, modify the date and time format of the event messages to display.
The box below displays an example of the timestamp visualization.
4. Optionally, do either of the following:
• Click Revert to Initial to keep the previous timestamp.
• Click Restore to Default to reset the default timestamp.
5. In the Message Color Schema, set the color for each information level, otherwise click Restore Default
Schema.
6. In the Font Name combo box, set the font to be used in the whole user interface. Available fonts are: Microsoft
Sans Serif, Arial, Tahoma, Calibri, Segoe UI, Trebuchet MS, Verdana, Consolas.
7. In the Text Size combo box, set the size of the text. Available values are: Small, Medium, Large.
8. In the Zoom combo box, set the zoom level to apply to the whole user interface. Available values are: 100%,
125%, 150%, 175%.
9. In the Max Messages list box, set the default value of the limit of the displayed messages, by using the spin
buttons (the maximum limit is 500.000).
10. Select the Show enum with numeric Values check box to display the information levels together with the
equivalent number to better filter the messages.
11. Click Ok.
View > Show Action Panel You can select or unselect this option to increase the available view
space during Real Time Monitoring.
In Real Time mode, when the Action Panel is hidden, some
additional buttons, such as for example Start, Pause/Resume, Stop
or Choose Providers, are still visible to perform the required actions.
View > Show Full Message When this option is selected, the main area is split in two panels: in
the upper panel you have the list of the incoming events and in the
lower panel you have a multi-line text box containing the message.
In this way you can see all relevant data at the same time and can
set the size of the list view pane and message box.
Operation Description
Break on Error If you are receiving many events at the same time, you might miss
errors. If this check box is selected, when an error is inserted in the
list view, the Trace Viewer goes automatically in Pause. In this way,
you can better analyze the messages.
Adjust font size as described In order to adjust the font size of the list view panel and the
message text box, place the focus on the list view panel and use the
combination [Ctrl] + [Mouse Wheel].
This combination is the same used to set the zoom on Chrome or
Visual Studio.
The allowed font size is in the range [4 - 64].
Prerequisites
The Trace Viewer is properly configured: providers are chosen and logging modes are selected.
Procedure
1. In the Choose Providers page in Trace Viewer, click Export.
2. Select the Persistent Storage option to export the traces generated from the selected providers to a SQL Server
database.
3. Insert the required connection string details (Data Source and Initial Catalog), including the credentials
required to perform the SQL Server database Authentication (User ID and Password) on the SQL Server
database instance.
4. Do one of the following:
• Select the Start logging to Persistent Storage check box to enable the provided configuration and
make it ready for writing on the database after the first SIMATIC IT UAF Log Router service restart (i.e.
with the element <SqlServerEntityFrameworkDatabaseSink ….. mode="writeMsgByID" in the
configuration file).
• Leave the Start logging to Persistent Storage check box unselected in order to only save the provided
configuration, without writing on the database (i.e. with the
element <SqlServerEntityFrameworkDatabaseSink ….. mode="listeningOnly"> in the configuration
file).
5. Click OK.
6. Restart the SIMATIC IT UAF Log Router service to make any configuration change effective (i.e. if you have just
selected the start logging mode option, or if you have disabled a previously active session and you want to stop
writing on the database).
For further details on these parameters, as well as on the parameters that can be manually modified in an
xml configuration file (LogRouterService.TraceEventService.xml), see Modifying Trace Viewer Persistent
Logging Parameters.
When Persistent Storage is configured and the Start logging to Persistent Storage is enabled, the Log
Router will continuously write traces to the specified database, even when the Trace Viewer is stopped or
not executing at all.
To stop it, run Trace Viewer, go to the Choose Providers page, click Export, select the Persistent
Storage option, disable the Start logging to Persistent Storage check box, click OK, restart the SIMATIC
IT UAF Log Router service.
Troubleshooting migration
Databases generated by the Persistent Storage functionality in previous versions are not compatible with
Opcenter Execution Foundation 4.1. Before migrating, if Persistent Storage is enabled, you should disable it
and drop the related database. If you forget to drop the database, after the migration you will get errors in
Trace Viewer and Event Viewer, such as:
• Opcenter EX FN Log Router - service for ETW Log Routing and Remoting started and running with error:
Exception: The model backing the 'LogModel' context has changed since the database was created.
• [SqlServerEntityFrameworkDatabaseSink::BulkCopyDataTable] for sink = PersistentLogs receive an
exception
Exception: The given ColumnMapping does not match up with any column in the source or destination.
In this case, you can follow this procedure:
• stop the SIMATIC IT UAF Log Router service
• drop the Persistent Storage database (since all logged messages will be lost you should create a
backup before dropping it)
• start the SIMATIC IT UAF Log Router service. A new empty database with the same name will be
generated, and the Log Router will start writing log events into it.
Prerequisites
The Trace Viewer is properly configured: providers are chosen and logging modes are selected.
Procedure
1. In the Choose Providers page in Trace Viewer, click Export.
2. Select the Performance Monitor option to export the provider configuration to Windows Performance Monitor.
3. Select the required export mode:
Option Description
Export as User Select this mode if you want to export your provider configuration to Windows
Defined Data Performance Monitor and define the ETL file where traces will be persisted. Provide a
Collector Set name and a description for the data collector, and then browse to the directory where you
want to save the ETL file. If you choose this option, the tracing activity must be either
manually started in the Performance Monitor, or scheduled at predefined times, and you
can also modify previous configurations (file name, directory location, tracing duration) .
Exported data will be displayed in the Data Collector Sets > User Defined node in the
Performance tree view in Windows Performance Monitor.
Export as Select this mode if you want to automatically start the trace recording after the first
Startup Event available machine startup. Provide a name and a description for the data collector, and
Trace Session then browse to the directory where you want to save the ETL file. Browse to the directory
where you want to save the ETL file and click Save. Exported data will be displayed in the
Data Collector Sets > Startup Event Trace Sessions node in the Performance tree view
in Windows Performance Monitor.
This option is preferable if you want to debug problems that may occur at the
machine startup, when it is impossible to activate interactive applications such
as the Trace Viewer.
4. (Optional) Select the Save as XML Template File check box to save the export settings as an XML file and then
browse to a proper location.
Note To import a previously saved XML template, either click the Import from PerfMon Template button or
right-click the providers table and then select Import from PerfMon Template from the Choose Providers
page in the Trace Viewer.
5. Click OK.
Prerequisites
You have already configured the required export settings in Trace Viewer.
Procedure
1. Stop the SIMATIC IT Log Router Windows service.
2. Browse to %SITUnifiedSystemRoot%bin\etw.
3. Open the LogRouterService.TraceEventService.xml configuration file.
4. Modify only the customizable parameters or the connection string details (except for user ID and password) as
described in the following table:
Property Description
Data Source The database server instance that will host the database.
user ID The user name used for the database server authentication.
This value cannot be edited in the XML file, but only via Trace
Viewer interface.
Result
The providers that you export in the Trace Viewer are automatically added to the XML file as a child of the
<SqlServerEntityFrameworkDatabaseSink> element.
Note
The xml file must contain at least one provider otherwise improper event logging will be caused.
Prerequisites
Project Studio is required for installing the providers.
Procedure
1. Stop the SIMATIC IT Log Router Windows service.
2. Browse to %SITUnifiedSystemRoot%bin\etw.
3. Run Uninstall ETW providers.bat as Administrator to uninstall all the Trace Providers.
4. Browse to %SITUnifiedSystemRoot%bin.
5. Run cmd as Administrator and navigate to cd %SITUnifiedSystemRoot%bin.
6. Execute the required command:
Command Description
generatetraceprovider This command creates the custom Trace Provider with name "Siemens-
-n <CustomTrace SimaticIT-Trace-<CustomTrace Provider Name>".
Provider Name>
7. Browse to %SITUnifiedSystemRoot%bin\etw.
8. Run Install ETW providers with Path.bat as Administrator for installing all the Trace Providers.
9. Restart the SIMATIC IT UAF Log Router Windows service.
Result
The Trace Viewer can listen to the providers that you created or updated.
You can only view these messages inside Microsoft Event Viewer (they cannot be displayed in Trace
Viewer).
The service can be manually started and stopped from Windows Services environment.
In a development environment you can use the script UnistallETWProviders.bat to fix provider issues.
This operation reverts the configuration and the size of log files to their initial values but it does not delete
stored traces.
Provider [Siemens-SimaticIT-SystemLogger]
Timestamp [2016/02/17 15:31:42.397] - Level [Critical]
Id: 31 - Task [1512 - Write] - OpCode [31 - LogRouterError]
Keywords [0x0000000000000200 - LogRouter]
SIMATIC IT UAF Log Router - service in not able to Write Information to Event Log
- error writing message with id SIMATIC IT UAF Log Router
- with Payload
appName=SIMATIC IT UAF Log Router
msgId=26
Provider [Siemens-SimaticIT-SystemLogger]
Timestamp [2016/02/17 15:31:42.413] - Level [Informational]
Id: 26 - Task [1001 - Start] - OpCode [29 - LogRouterSucess]
Keywords [0x0000000000000200 - LogRouter]
SIMATIC IT UAF Log Router - service for SIMATIC IT UAF Log Router started
- with Payload
appName=SIMATIC IT UAF Log Router
system logs
1 The '%1' service has been started. (%1) Informatio Start LauncherSucces
componentId nal s
--
(Launcher)
UnicodeString
2 The '%1' service has been stopped. (%1) Informatio Stop LauncherSucces
componentId nal s
--
(Launcher)
UnicodeString
3 The '%1' service has been restarted. (%1) Informatio Restart LauncherSucces
componentId nal s
--
(Launcher)
UnicodeString
4 The '%1' service has got a failure with (%1) Error Check LauncherFailure
this message: '%2' componentId
(Launcher)
--
UnicodeString
(%2) exception
--
UnicodeString
5 Fatal Exit of the Worker Process '%1'. (%1) Informatio Check WorkerFailure
This process has raised the following componentId nal
(Worker)
exception: '%2' --
UnicodeString
(%2) exception
--
UnicodeString
14 Application '%1': load app '%2' failed (%1) Informatio Check AppFailure
with error: '%3' componentId nal
(App)
--
UnicodeString
(%2) appName
–
UnicodeString
(%3)
failureExplanat
ion
-- :UnicodeStri
ng
16 The runtime system on host '%2' has (%1) Informatio Start StateMachine
started successfully. componentId nal Success
--
(NodeState)
UnicodeString
(Machine)
(%2)
computerNam
e --
UnicodeString
17 The host '%2' has changed its status (%1) Informatio Change StateMachine
to '%3'. componentId nal d Success
--
(NodeState)
UnicodeString
(Machine)
(%2)
computerNam
e–
UnicodeString
(%3)
statusSymbolic
Name –
UnicodeString
19 The host '%2' is in status '%3' with the (%1) Warning Restart StateMachine
following errors: '%4'. componentId Warning
A recovery procedure is in progress. --
(NodeState)
UnicodeString
(Machine)
(%2)
computerNam
e --
UnicodeString
(%3)
statusSymbolic
Name –
UnicodeString
(%4)
expandedReas
onsIdStrings --
UnicodeString
20 The host '%2' has changed its status (%1) Error Change StateMachine
to '%3' componentId d Failure
with the following reason: '%4' --
(NodeState)
UnicodeString
(Machine)
(%2)
computerNam
e --
UnicodeString
(%3)
statusSymbolic
Name --
UnicodeString
(%4)
expandedReas
onsIdString --
UnicodeString
22 The Worker Process '%1' has been (%1) Informatio Comple LauncherProces
started successfully. workerName -- nal ted s
UnicodeString Sucess
(Launcher)
23 The Worker Process '%1' has died (%1) Warning Check LauncherProces
unexpectedly. workerName -- s
A restart action is underway to recover UnicodeString Warning
from the problem.
(Launcher)
24 The Worker Process '%1' has failed (%1) Error Check LauncherProces
with error: '%2'. workerName -- s
UnicodeString Error
(%2) reason --
(Launcher)
UnicodeString
25 The Worker Process '%1' has been (%1) Informatio Stop LauncherProces
stopped successfully. workerName -- nal s
UnicodeString Sucess
(Launcher)
26 SIMATIC IT UAF Log Router - service (%1) appName Informatio Start LogRouterSuces
for %1 started -- nal s
UnicodeString
(LogRouter)
27 SIMATIC IT UAF Log Router - service (%1) appName Informatio Stop LogRouterSuces
for %1 stopped -- nal s
UnicodeString
(LogRouter)
28 SIMATIC IT UAF Log Router - service (%1) appName Critical Start LogRouterError
for %1 --
(LogRouter)
cannot start due to error: %2 UnicodeString
(%2)
description --
UnicodeString
29 SIMATIC IT UAF Log Router - service (%1) appName Error Process LogRouterWarin
for %1 -- g
started and running with error: %2 UnicodeString
(LogRouter)
(%2)
description --
UnicodeString
30 SIMATIC IT UAF Log Router - service (%1) appName Error Start LogRouterWarin
for %1 started -- g
and running with error in Sink/Worker: UnicodeString
(LogRouter)
%3 - sink or (%2)
worker may not work properly - error description --
details: %2 UnicodeString
(%3) name --
UnicodeString
31 SIMATIC IT UAF Log Router - service in (%1) appName Critical Write LogRouterError
not able to Write --
(LogRouter)
Infomation to Event Log - error writing UnicodeString
message with id %1 (%2) msgId --
Int32
32 SIMATIC IT UAF Log Router - service (%1) appName Warning Stop LogRouterWarin
for %1 -- g
stopped with error UnicodeString
(LogRouter)
%2 (%2)
description
-- :UnicodeStri
ng
36 The host '%2' cannot change its status (%1) Warning Start StateMachine
to '%3' for the componentId Warning
following reason: '%4' --
(NodeState)
UnicodeString
(Machine)
(%2)
computerNam
e --
UnicodeString
(%3)
statusSymbolic
Name --
UnicodeString
(%4) reason --
UnicodeString
37 The host '%2' is in status '%3' and all (%1) Informatio Restart StateMachine
errors have been componentId nal Success
successfully recovered --
(NodeState)
UnicodeString
(Machine)
(%2)
computerNam
e–
UnicodeString
(%3)
statusSymbolic
Name --
UnicodeString
39 An error has occurred during the (%1) path -- Error Start LauncherFailure
start of service layer of '%1', reason: UnicodeString
(Launcher)
'%2' (%2) reason --
UnicodeString
40 An error has occurred during the (%1) path -- Error Stop LauncherFailure
stop of service layer of '%1', reason: UnicodeString
(Launcher)
'%2' (%2) reason --
UnicodeString
41 An error has occurred during the (%1) path -- Error Write LauncherFailure
creation of the state runtime file UnicodeString
(Launcher)
'%1', (%2) reason --
reason: '%2' UnicodeString
51 The Worker Process '%1' has been (%1) Informatio Info LauncherProces
recovered workerName -- nal s
successfully. Recovered
UnicodeString
(Launcher)
52 The Rule '%1' '%2' on Host '%3' has (%1) ruleId -- Informatio Start SignalManagerR
been UnicodeString nal ule
successfully started. (%2) revision -- Started
UnicodeString
(SignalManager)
(%3) hostName
--
UnicodeString
53 The Rule '%1' '%2' on Host '%3' has (%1) ruleId -- Informatio Stop SignalManagerR
been UnicodeString nal ule
successfully stopped. (%2) revision -- Stopped
UnicodeString
(SignalManager)
(%3) hostName
--
UnicodeString
54 The Rule '%1' '%2' on Host '%3' has (%1) ruleId -- Error Load SignalManagerR
terminated with failure UnicodeString ule
due to this error: '%4' (Error Code: (%2) revision -- Failed
%5). UnicodeString
(SignalManager)
The rule is now stopped. (%3) hostName
--
UnicodeString
(%4)
errorDescriptio
n --
UnicodeString
(%5) errorCode
-- Int32
55 The Rule '%1' '%2' on Host '%3' has (%1) ruleId -- Error Process SignalManagerR
raised this error during UnicodeString ule
the processing of block '%4': (%2) revision -- ExecutionError
'%5' (Error Code: %6). UnicodeString
(SignalManager)
The rule is still running. (%3) hostName
--
UnicodeString
(%4)
blockType --
UnicodeString
(%5)
errorDescriptio
n --
UnicodeString
(%6) errorCode
-- Int32
89 The Rule '%1' '%2' is going to be (%1) ruleId -- Informatio Start AttemptStartRul
started on Host '%3'. UnicodeString nal e
(%2) revision --
(SignalManager)
UnicodeString
(%3) hostName
--
UnicodeString
90 The Rule '%1' '%2' is going to be (%1) ruleId -- Informatio Stop AttemptStopRul
stopped on Host '%3'. UnicodeString nal e
(%2) revision --
(SignalManager)
UnicodeString
(%3) hostName
--
UnicodeString
91 The Rule '%1' '%2' is going to updated (%1) ruleId -- Informatio Restart AttemptUpdate
and UnicodeString nal Rule
restarted on Host '%3'. (%2) revision --
(SignalManager)
UnicodeString
(%3) hostName
--
UnicodeString
92 The Rule '%1' '%2' on Host '%3' has (%1) ruleId -- Warning Process SignalManagerR
raised this UnicodeString ule
warning during the processing of (%2) revision -- Warning
block '%4': '%5' UnicodeString
(SignalManager)
(Error Code: %6). The rule is still (%3) hostName
running. --
UnicodeString
(%4)
blockType --
UnicodeString
(%5)
errorDescriptio
n --
UnicodeString
(%6) errorCode
-- Int32
93 The Rule '%1' '%2' on Host '%3' has (%1) ruleId -- I Process SignalManager
raised this informational UnicodeString nformatio RuleInformation
message during the processing of (%2) revision -- nal al
block '%4': '%5'. UnicodeString Message
(%3) hostName
(SignalManager)
--
UnicodeString
(%4)
blockType --
UnicodeString
(%5)
description --
UnicodeString
100 Failure to connect to the configured (%1) checks – Error Check GatewayError
address/port. Perform with fail the UnicodeString
(DataIntegration
follow checks: %1
)
101 A generic error occured during http (%1) Error Stop Failure
request. Error message: %1 errMessage –
(DataIntegration
UnicodeString
)
105 Module already acquired, {0} {0} Module Informatio Process LicenseAlready
description nal Acquired
106 Timers Engine status updated to {1}. {0} Identifier of Informatio Change TimersStatusUp
(ComponentId={0}) the component nal d date
{1} status
107 Timers Engine {1} routine has stopped {1} routine Error Stop TimersRoutineEr
with the following error {2}. name ror
(ComponentId={0}).
{2} error
{0}) identifier of
the component
108 The '{%1}' service cannot be started. {%1} simatic it Critical Check LauncherFailure
There is configuration version service name
mismatch. Open SIMATIC IT
UAConfiguration tool and perform the
migration.
109 The '{%1}' service has got a critical {%1} simatic it Critical Check LauncherFailure
failure and has been closed. The service name
reason is: '{%2}'
{%2} message
of the
exception
113 The local Host has been correctly Informatio Start ErrorHostInfo
started. nal
(
GovernanceLaye
r)
114 The local Host has been correctly Informatio Start ErrorHostInfo
stopped. nal
(
GovernanceLaye
r)
115 The local Host has been correctly {%1} Warning Start ErrorHostInfo
stopped, but services %1 has/have killedservices -
(
been killed due to timeout exceeded. Unicode String
GovernanceLaye
r)
Tasks Value
Start 1001
Tasks Value
Stop 1002
Restart 1004
Deploy 1008
Load 1016
Check 1032
Completed 1064
Process 1128
Changed 1256
Write 1512
Wait 2024
Info 3048
EventSourceMessage 65534
OpCodes Value
LauncherFailure 11
LauncherSuccess 12
WorkerFailure 13
WorkerSuccess 14
SolutionFailure 15
SolutionSuccess 16
AppFailure 17
AppSuccess 18
OpCodes Value
LocalDeploymentFailure 19
LocalDeploymentSuccess 20
StateMachineSuccess 21
StateMachineWarning 22
StateMachineFailure 23
GatewayError 24
GatewayWarning 25
LauncherProcessSucess 26
LauncherProcessWaring 27
LauncherProcessError 28
LogRouterSucess 29
LogRouterWaring 30
LogRouterError 31
LicenseServerConnected 32
LicenseServerConnectionFailed 33
LicenseServerDisconnected 34
LicenseServerDisconnectionFailed 35
LicenseAcquired 36
LicenseAcquireFailed 37
LicenseReleased 38
LicenseReleaseFailed 39
LauncherPreshutdown 40
LauncherProcessRecovered 41
SignalManagerRuleStarted 42
SignalManagerRuleStopped 43
OpCodes Value
SignalManagerRuleFailed 44
SignalManagerRuleExecutionError 45
WorkerUserException 46
AutomationUpdate 47
AutomationIOWAUpdate 48
AutomationConnectionsUpdate 49
AutomationConfigurationReset 50
AutomationEnvironmentReset 51
AutomationNewProject 52
AutomationSubscribeByType 53
AutomationSubscribeByNode 54
AutomationSubscribeClosed 55
AutomationTriggerChanged 56
AutomationSelectedPropertiesChanged 57
AutomationSubscribeDisconnected 58
AutomationSubscribe 59
AutomationGateway 60
AutomationReadNodes 61
AutomationWriteNodes 62
AutomationWriteNodesFiltered 63
AutomationQueryNodes 64
AutomationQueryNodesByType 65
AttemptStopRule 66
AttemptStartRule 67
AttemptUpdateRule 68
OpCodes Value
SignalManagerRuleWarning 69
SignalManagerRuleInformationalMessage 70
HighAvailabilityMessage 71
HighAvailabilityMessageInternal 72
ConfigurationError 73
FailureAndCheck 74
AutomationMessageQueuingExceedLimit 75
AutomationMessageQueuingNotExceedsLimit 76
ErrorHostInfo 82
Failure 100
Success 101
The values corresponding to the keywords are as follows:
KeyWord Value
Laucher 0x1
Worker 0x2
SolutionDeployment 0x4
LocalDeployment 0x8
App 0x10
InformationLayer 0x20
IntegrationLayer 0x40
GovernanceLayer 0x80
NodeStateMachine 0x100
LogRouter 0x200
Generic 0x400
License 0x800
KeyWord Value
SignalManager 0x1000
Automation 0x2000
DataIntegration 0x4000
Session3 0x100000000000
Session2 0x200000000000
Session1 0x400000000000
Session0 0x800000000000
Session3, Session2, Session1, Session0 are system Keywords that are not relevant for Opcenter Execution
Foundation.
security logs
Security logs are stores in the Siemens-SimaticIT-Security-Admin file.
provider Name : Siemens-SimaticIT-Security
provider guid: {395037a1-c886-5860-caed-d589e34eea6a}
resource file: SimaticIT.Security.Lean.Siemens-SimaticIT-Security.etwManifest.dll
The following events are logged in the file:
1 User '%1' does not (%1) user -- Error CommandAuth Failure AuditFailure
have the UnicodeString orization Command
authorization to (%2) operation -- Check
perform operation UnicodeString
'%2' on object '%3' (%3) secObj –
UnicodeString
3 User '%1' does not (%1) user -- Error EventAuthoriz Failure AuditFailure
have the UnicodeString ationCheck Event
authorization to (%2) operation --
perform operation UnicodeString
'%2' on object '%3' of (%3) secObj --
Event category. UnicodeString
5 User '%1' does not (%1) user -- Error EntityAuthoriz Failure AuditFailure
have the UnicodeString ationCheck Entity
authorization to (%2) operation --
perform operation UnicodeString
'%2' on object '%3' (%3) secObj --
UnicodeString
Tasks Value
CommandAuthorizationCheck 101
EventAuthorizationCheck 102
EntityAuthorizationCheck 103
TokenValidationCheck 104
AccountValidationCheck 105
EncryptionCheck 106
MasterKeyExpired 65524
EventSourceMessage 65534
The values corresponding to the OpCodes are as follows:
OpCodes Value
Failure 101
Success 102
The values corresponding to the keywords are as follows:
KeyWord Value
AuditSuccess 0x1
AuditFailure 0x2
Command 0x4
Event 0x8
Entity 0x10
Token 0x20
KeyWord Value
Account 0x40
Encryption 0x80
Session3 0x100000000000
Session2 0x200000000000
Session1 0x400000000000
Session0 0x800000000000
Session3, Session2, Session1, Session0 are system Keywords that are not relevant for Opcenter Execution
Foundation.
Application Logs
Application logs are stores in the Siemens-SimaticIT-Application-Admin file.
• provider Name : Siemens-SimaticIT-Application
• provider guid: {581e9f3a-620f-416f-b1e3-962676a46a8d}
• resource file: SimaticIT.Integration.Diagnostics.Core.Siemens-SimaticIT-Application.etwManifest.dll
The following events are logged in the file:
1 The %1 %2 '%3' on host '%4' failed (%1) appName -- Error Stop HandlerUser Work
due to this error: %5. UnicodeString Exception er
Stack tace: %6 (%2) handlerType --
UnicodeString
(%3) name --
UnicodeString
(%4) host --
UnicodeString
(%5) message --
UnicodeString
(%6) fullStack --
UnicodeString
The values corresponding to the tasks used are as follows:
Tasks Value
Start 1001
Stop 1002
Restart 1004
Deploy 1008
Load 1016
Check 1032
Completed 1064
Process 1128
Changed 1256
Write 1512
Wait 2024
Info 3048
EventSourceMessage 65534
The values corresponding to the OpCodes are as follows:
OpCodes Value
HandlerUserException 103
The values corresponding to the keywords are as follows:
KeyWord Value
Worker 0x2
Generic 0x400
License 0x800
SignalManager 0x1000
Session3 0x100000000000
Session2 0x200000000000
Session1 0x400000000000
KeyWord Value
Session0 0x800000000000
Session3, Session2, Session1, Session0 are system Keywords that are not relevant for Opcenter Execution
Foundation.
6.4.2 Configuring the SIMATIC IT UAF Log Router Service via Script
The SIMATIC IT UAF Log Router service is a platform service that allows you to permanently save security, system
and application related messages to file repository. This operation can be performed via script through the file
LogRouterConf.exe.
LogRouterService Configuration
The LogRouterConf.exe configuration is based on sinks and persisted in the file
LogRouterService.TraceEventService.xml located in the folder %SITUnifiedSystemRoot%bin\ETW.
It contains global parameters and one entity for each sink , that is, a destination to which LogRouterService writes
ETW traces.
Each sink is composed by parameters to manage the destination and a list of sources (ETW providers to be
subscribed) with its own level and keywords; both parameters and sources are used to collect ETW traces.
The LogRouterService.TraceEventService.xml file contains the following system sinks that write Windows Event
logs (see Persisting System, Security and Application Messages on Microsoft Event Viewer) and must not be
modified:
• SecurityAudit
• SystemLog
• ApplicationLog
Adding Sinks
This operation allows you to add in the LogRouterService.TraceEventService.xml file two types of sinks:
• simaticEventLogSink : writes to Windows Event Log
• SqlServerEntityFrameworkDatabaseSink : Persistent Log Sink to write to SQL database
Procedure
1. In the %SITUnifiedSystemRoot%bin folder, execute the command
providerfile (Mandatory) The provider file name generated by ETWViewer (see Choosing
Trace Providers). It defines the sources for the sink to be added.
Log (Mandatory) The value of the Log attribute (see Opcenter EX FN System,
Security and Application Traces) valid for sinks of type EventLogSinkType,
PersistentLogSinkType.
mode (Mandatory) The value of the mode attribute is valid for sinks of type
EventLogSinkType, PersistentLogSinkType. Possible attribute values:
• listeningOnly
• in case of persistent log, it does not write in the database.
Sink is prepared but not active.
• in case of event log, the traces are not saved in the
Windows Log except for the providers registered
according to Microsoft documentation (see https://
docs.microsoft.com/en-us/previous-versions/
aa385225(v=vs.85)?redirectedfrom=MSDN).
• writeMsgByID
• in case of persistent log, it writes all traces to the
database. Sink is prepared and active.
• in case of event log, it writes all traces for all providers.
datasource (Mandatory) The value of the datasource attribute valid only for sinks of
type PersistentLogSinkType
catalog (Mandatory) The value of the catalog attribute valid for sinks of type
PersistentLogSinkType
user (Mandatory) The value of the user attribute valid for sinks of type
PersistentLogSinkType
password (Mandatory) The value of the password attribute for sinks of type
PersistentLogSinkType
bufferingCount The value of the bufferingCount attribute valid for sinks of type
PersistentLogSinkType
maxBufferSize The value of the maxBufferSize attribute valid for sinks of type
PersistentLogSinkType
Parameter Description
bufferingIntervalInSeconds The value of the bufferingIntervalInSeconds attribute valid for sinks of type
PersistentLogSinkType
Updating Sinks
Procedure
1. in the %SITUnifiedSystemRoot%bin folder, execute the command
Parameter Description
providerfile The provider file name generated by ETWViewer. It defines the sources for
the sink to be updated.
Log The value of the Log attribute (see Opcenter EX FN System, Security and
Application Traces) valid for sinks of type EventLogSinkType,
PersistentLogSinkType.
Parameter Description
mode The value of the mode attribute valid for sinks of type EventLogSinkType,
PersistentLogSinkType. Possible attribute values:
• listeningOnly
• in case of persistent log, it does not write in the database.
Sink is prepared but not active.
• in case of event log, the traces are not saved in the
Windows Log except for the providers registered
according to Microsoft documentation (see https://
docs.microsoft.com/en-us/previous-versions/
aa385225(v=vs.85)?redirectedfrom=MSDN).
• writeMsgByID
• in case of persistent log, it writes all traces to the
database. Sink is prepared and active.
• in case of event log, it writes all traces for all providers.
datasource The value of the datasource attribute valid only for sinks of type
PersistentLogSinkType
catalog The value of the catalog attribute valid for sinks of type
PersistentLogSinkType
user The value of the user attribute valid for sinks of type PersistentLogSinkType
password The value of the password attribute valid for sinks of type
PersistentLogSinkType
bufferingCount The value of the bufferingCount attribute valid for sinks of type
PersistentLogSinkType
bufferingIntervalInSeconds The value of the bufferingIntervalInSeconds attribute valid for sinks of type
PersistentLogSinkType
datasource (Mandatory) The value of the datasource attribute valid only for sinks of type
PersistentLogSinkType.
catalog (Mandatory) The value of the catalog attribute valid for sinks of type
PersistentLogSinkType
user (Mandatory) The value of the user attribute valid for sinks of type
PersistentLogSinkType
password (Mandatory) The value of the password attribute for sinks of type
PersistentLogSinkType
Parameter Description
bufferingCount The value of the bufferingCount attribute valid for sinks of type
PersistentLogSinkType
maxBufferSize The value of the maxBufferSize attribute valid for sinks of type
PersistentLogSinkType
bufferingIntervalInSeconds The value of the bufferingIntervalInSeconds attribute valid for sinks of type
PersistentLogSinkType
Deleting Sinks
Procedure
1. in the %SITUnifiedSystemRoot%bin folder, execute the command
Parameter Description
It is possible to view this service for each machine in the cluster from one machine in the scenario, in order to
analyze all the event messages together.
For further information see Microsoft documentation: https://technet.microsoft.com/en-us/library/cc722010.aspx
Prerequisites
• The same version of Opcenter Execution Foundation is installed on each machine.
• The machines must be part of the same domain.
• Administrator status for each machine in the cluster is required to perform this operation.
• The SIMATIC IT UAF Log Router service and Windows Event Collector Service must be running.
Procedure
1. Open Microsoft Event Viewer by accessing Windows Administrative Tools environment and then
selecting Event Viewer.
2. Inside the Event Viewer application, right click Subscriptions and select Create Subscription.
3. In Subscription name provide a unique name for the subscription.
9. Click Specific User and specify a user that has Administrator status.
Result
If the connection has been successfully made a green row is displayed in the Subscriptions table, with details on
your connection.
To check the status of the connection, right-click the row and select Runtime Status.
Example
PS C:\Program Files\Siemens\SimaticIT\Unified\bin\PreConf\Fragments\unified> . .
\UnifiedHelp.ps1
PS C:\Program Files\Siemens\SimaticIT\Unified\bin\PreConf\Fragments\unified> Set-WerE
nabled -?
NAME
Set-WerEnabled
SYNTAX
Set-WerEnabled [-dump_folder] <string> [[-count] <int>] [<CommonParameters>]
ALIASES
None
REMARKS
None
User permissions
If the Windows user running Opcenter EX FN processes is not a local administrator or does not belong to any
Opcenter EX FN Windows groups, the dumps will not be generated.
Parameter Description
Name
@minFragme In percentage. The stored procedure will not perform the defragmentation, if the
ntation fragmentation is lower than the specified value.
The default value is 10%.
@rebuildThr In percentage. A value greater than this threshold will result in a rebuild instead of a
eshold reorganization.
The default value is 30%, as recommended by Microsoft.
@defragOrde Defines how to prioritize the order of defragmentation. Only used if @executeSQL = 1.
rColumn
Valid options are:
• range_scan_count = cumulative count of range and table scans started on the index or
heap. This option is recommended.
• fragmentation = amount of fragmentation in the index; the higher the number, the worse
it is.
• page_count = number of pages in the index; affects how long it takes to defrag an index.
The default value is range_scan_count.
@timeLimit Limits how much time can be spent in performing index defragmentation. The value is
expressed in minutes.
Note: The time limit is checked BEFORE an index defragmentation is begun, thus a long index
defragmentation can exceed the time limitation.
The default value is 720 minutes (12 hours).
Parameter Description
Name
@tableName Specifies if you only want to defrag indexes for a specific table. This parameter must be
provided by using the following format: database_name.schema.table_name
If not specified, all tables will be defragged.
The default value is NULL (i. e. all tables in the current database will be defragged).
@scanMode Specifies which scan mode you want to use to determine fragmentation levels.
Valid options are:
• LIMITED = scans the parent level; quickest mode, recommended for most cases.
• SAMPLED = samples 1% of all data pages; if less than 10k pages, performs a DETAILED
scan.
• DETAILED = scans all data pages. This option must be used carefully because it can cause
performance issues.
The default value is LIMITED.
@minPageCo Specifies how many pages must exist in an index in order to be considered for a
unt defragmentation.
The default value is 8, as Microsoft recommends only defragging indexes with more than 1
extent (8 pages).
@maxPageC Specifies the maximum number of pages that can exist in an index and that must be
ount considered for a defragmentation.
This option is useful for scheduling a rebuild of small indexes during business hours and a
rebuild of large indexes for non-business hours.
Note: The @maxPageCount will restrict the indexes that are defragged during the current
operation.
The default value is NULL (no limit).
Parameter Description
Name
@excludeMa If an index is partitioned, this option specifies whether to exclude the right-most populated
xPartition partition. Typically, this is the partition that is currently being written to in a sliding-window
scenario. Enabling this feature may reduce contention. This may not be applicable in other
types of partitioning scenarios. Non-partitioned indexes are unaffected by this option.
Valid options are:
• 1 = excludes right-most populated partition
• 0 = does not exclude the right-most populated partition
The default value is 0.
@onlineRebu When online rebuild mode is active, users can continue to work on underlying data. When
ild offline rebuild mode is active, tables/indexes are locked for the duration of the action.
The offline rebuild is supported only by Enterprise versions of Microsoft SQL Server.
@sortInTemp Specifies whether to defrag the index in TEMPDB or in the database the index belongs to.
DB Enabling this option may result in faster defragmentations and prevents database file size
inflation.
Valid options:
• 1 = performs sort operation in TEMPDB
• 0 = performs sort operation in the index's database
The default value is 1.
@maxDopRe Specifies the number of processors for the index rebuild operation.
striction
The offline rebuild is supported only by Enterprise versions of Microsoft SQL Server.
Parameter Description
Name
@debugMod For debugging purpose. If enabled, the stored procedure displays some useful comments to
e help determine if or where issues occur.
Valid options are:
• 1 = displays debug comments (helps you with troubleshooting)
• 0 = does not display debug comments
The default value is 0.
@SkipReorg Specifies if the stored procedure needs to execute also indexes reorganization.
Valid options are:
• 1 = performs also reorganize
• 0 = performs only rebuild
The default value is 0.
@LockTimeo Specifies the number of seconds a command waits for a lock. After timeout elapsed, the
ut command returns an error.
The default value is NULL.
@DataCompr Specifies if the data compression is enabled and the related type.
essionType
If not set, the stored procedure does not perform data compression.
Valid options are:
• '' = no data compression
• PAGE = compression at page level
• ROW = compression at row level
The default value is ''.
The stored procedure should be executed either by a SQL Server Job or by a DBA.
EXECUTE dbo.Index_Maintenance
@executeSQL = 1
, @printCommands = 1
, @debugMode = 1
, @printFragmentation = 1
, @forceRescan = 1
, @maxDopRestriction = 1
, @minPageCount = 8
, @maxPageCount = NULL
, @minFragmentation = 1
, @rebuildThreshold = 30
, @defragDelay = '00:00:10'
, @defragOrderColumn = 'page_count'
, @defragSortOrder = 'DESC'
, @excludeMaxPartition = 1
, @timeLimit = NULL
Oracle
Avoid settings less than 72 hours (3 days): the stored procedure deletes even the timer instances still
marked as Planned. So, if you set a very low number of hours, you may end up with deleting instances that
were Planned but not executed for some reason (e.g. the Worker was down) so the system will not try to
re-execute them.
The stored procedure should be executed either by a SQL Server/Oracle Job or by a DBA.
EXECUTE [dbo].[PurgeTimeLineInstance]
@hours = 24,
@chunkSize = 5000
exec "MyDb_sys"."PurgeTimeLineInstance"(24);
start_time Specify the start date of the job (expressed in local time).
SET @day_freq = 1
SET @hoursToPreserve = 72
SET @chunkSize = 10000
SET @start_time = '2021-03-30 03:00'
EXECUTE [dbo].[UAF_CREATE_TIMER_PURGING_JOB]
@day_freq
,@hoursToPreserve
,@chunkSize
,@start_time
,@iRet OUTPUT
GO
Oracle
On Oracle, the job named <schema>_TimerPurge (e.g. SIT_UA_sys_TimerPurge) is already provided inside
Opcenter EX FN system databases.
This job is created in a disabled state, and by default it is activated every day at midnight (local time), purging the
timer tables preserving data for the last 72 hours.
You can activate it or change its time scheduling. Please check the Oracle documentation for the required steps.
Be aware that the __MTLog table and the __SynchronizationLog table (and in general any table whose
name starts with ‘__’) are system tables. Any custom logic that you may implement is under your
responsibility as their compatibility is not ensured.
To prevent this table size from growing over time, you can invoke the PurgeMaintenanceLog stored procedure,
which is provided inside all Foundation databases.
You can execute it either by using the default input parameter values, or by specifying the following parameters:
PurgeBehavior Specify which logs to remove from table based on msg column.
Valid options are:
• 0 = remove all logs from table
• 1 = remove only logs with an empty msg column
The default value is 0.
The stored procedure should be executed either by a SQL Server/Oracle Job or by a DBA.
EXECUTE[dbo].[PurgeMaintenanceLog]
@PurgeBehavior = 1,
@PurgeUntil = '2020-02-09',
@Verbose = 1
declare
StartTime TIMESTAMP WITH TIME ZONE;
begin
DBMS_OUTPUT.ENABLE();
StartTime := SYSTIMESTAMP AT TIME ZONE 'UTC';
"MyDatabase"."PurgeMaintenanceLog" (1, StartTime, 1);
end;
The stored procedure should be executed either by a SQL Server/Oracle Job or by a DBA.
EXECUTE[dbo].[PurgeSynchronizationLog]
@PurgeUntil = '2020-02-09',
@Verbose = 1
declare
StartTime TIMESTAMP WITH TIME ZONE;
begin
DBMS_OUTPUT.ENABLE();
StartTime := SYSTIMESTAMP AT TIME ZONE 'UTC';
"MyDatabase"."PurgeSynchronizationLog" (StartTime, 1);
end;
Prerequisites
The prerequisites vary according to the installation type:
• Over installation; after installing Opcenter Execution Foundation 4.1 on top of one of the previously mentioned
product versions, you must perform the post-installation migration tasks described in the Opcenter Execution
Foundation Installation Manual.
• Fresh installation; after installing Opcenter Execution Foundation 4.1 on a clean machine, you must configure
the whole environment as described in the Opcenter Execution Foundation Installation Manual.
Workflow
The migration process is made up of the following steps:
1. If needed, update the model in Project Studio. This step is required if you want to include any new feature in the
data model / business logic of your Functional Blocks and Apps or if the version of any referenced packages
changed.
2. Update the Solution in Solution Studio. This step is required to update/reload Apps and UIs to the current
platform version.
3. Build and deploy the updated solution in Solution Studio. This step is required to deploy and start the updated
solution.
4. Complete the migration by performing some post-migration steps for some specific Apps.
Compatibility
We strongly recommend that you check the compatibility notes at Version Compatibility in the Opcenter
Execution Foundation Release Notes.
Moreover, keep in mind that In previous product versions, SWAC Components used earlier versions of the
SWAC Manifest (1.2.0 and 1.0). The manifest is automatically migrated for new SWAC Components,
whereas an icon is displayed on migrated SWAC Components indicating that manual manifest migration is
required. Although compatibility with previous versions in provided, it is advisable to migrate the
manifest to avoid problems occurring in the future.
If your old packages do not reference any system functionalities, and your Solution does not contain any
Foundation Apps, you can still use old packages on a 4.1 version, without recompiling them.
This allows you to also use the old UDM App, and the related UDM Functional Blocks (if your solution does
not contain any other Foundation Apps).
2.1 or 2.1 Update 1 Updating SIMATIC IT UAF 2.1 or 2.1 Update 1 Projects in Project
Studio
What to do next
In Solution Studio, update/reload the Solution Apps.
Prerequisites
• You must perform the Rebuild operation in the SIMATIC IT UAF 2.0 Project before proceeding with the migration
procedure to avoid misalignments between .um/.umd files and .ul files.
• You must restore any references to other Functional Blocks before proceeding with the following migration
procedure.
• You must verify if any Functional Block needs to be updated before proceeding with the following migration
procedure and, if needed, update the involved Functional Blocks.
• We recommend you create a back-upof your Functional Blocks before migrating them.
• Do not modify the data model, such as adding new entities, during the migration procedure.
• If you are working under source control with several machines, the migration procedure should be performed
on one machine only. You can successively align the other machines using the Get Latest function once the first
machine has checked-in the migrated model.
Procedure
1. In Project Studio (in Opcenter Execution Foundation 4.1), open and then close each 2.0 Functional Block and
App included in your final solution.
2. As the Model Project has been reviewed to improve usability when modelling Functional Blocks and Apps,
perform the following steps:
• Build your solution.
• Delete the .um file from the model project. If you double-click this file, a warning message will inform
you that it is no longer supported and needs to be removed.
• Build your solution again. Now you can open the model double-clicking the .dm file from the Diagrams
sub-folder, containing the graphical representation of the data model.
3. In Project Studio (in Opcenter Execution Foundation 4.1), open each App you want to make extensible, and
then:
• right-click its Installer project, select Properties and set the Can be Extended option to True.
• build the POMModel project.
4. If you want to migrate signals, delete them and recreate them and create new filter subscriptions.
5. Since the feature Data Segregation has been implemented to limit data access to users or user groups that
satisfy specific criteria, if you have used the name SegregationTag (reserved for data segregation) for an entity
in your App, you must open the App and modify this name before deploying it.
6. If you want to implement Reading Functions right-click the top level solution in the Solution Explorer pane,
click Add > New Project, select the Reading Functions Handler Project Class Library project in the Simatic
IT folder and click OK.
7. In order to migrate User Interfaces:
• In case of code-based UI screens (without using Model Driven UI Editor), to integrate the new Data
Segregation functionality that allows you to modify the list of segregation tags assigned to entity
instances (see Modifying the List of Segregation Tags Assigned to Entity Instances in the Opcenter
Execution Foundation User Manual), specify entityName and appName in the Item Collection Viewer
(unless you have configured the widget for server-side pagination).
• Right-click the AppUserInterface project and click Generate UI Application Files.
• Right-click the App UserInterface project and click Migrate to migrate the UI Component and UI Module
manifest.
• Verify the versions of the supported third-party software you have used to develop UIs.
• Verify that the AngularJS dependencies specified in the file module.js still correspond to your
requirements.
8. Manually delete the references from your Handler projects to all the dlls whose name contains
"EndPoints". Starting from SIMATIC IT UAF 2.1, these dlls are not in use anymore. Consequently, it is advisable
to manually remove their references even if the project compilation is not affected. These dlls are named as
follows:
• <Prefix>.<DomainName>.<FunctionalBlockName>.<Acronym>Model.EndPoints.dll
• <Prefix>.<AppName>.<AppName>POMModel.EndPoints.dll
9. Build the solution in Project Studio.
What to do next
Perform the final step in Solution Studio, which will allow you to deploy your updated solution.
Prerequisites
• You must perform the Rebuild operation in the SIMATIC IT UAF 2.1 or 2.1 Update 1 Project before proceeding
with the migration procedure to avoid misalignments between .um/.umd files and .ul files.
• You must restore any references to other Functional Blocks before proceeding with the following migration
procedure.
• You must verify if any Functional Block needs to be updated before proceeding with the following migration
procedure and, if needed, update the involved Functional Blocks.
• We recommend you create a back-up of your Functional Blocks before migrating them.
• Do not modify the data model, such as adding new entities, during the migration procedure.
• If you are working under source control with several machines, the migration procedure should be performed
on one machine only. You can successively align the other machines using the Get Latest function once the first
machine has checked-in the migrated model.
Procedure
1. In Project Studio (in Opcenter Execution Foundation 4.1), open and then close each Functional Block and App
included in your final solution.
2. As the Model Project has been reviewed to improve usability when modelling Functional Blocks and Apps,
perform the following steps:
• Build your solution.
• Delete the .um file from the model project. If you double-click this file, a warning message will inform
you that it is no longer supported and needs to be removed.
• Build your solution again. Now you can open the model double-clicking the .dm file from the Diagrams
sub-folder, containing the graphical representation of the data model.
3. In order to make an App extensible:
• open the App in Project Studio
• right-click its Installer project and select Properties.
• set the Can be Extended option to True
• build the POMModel project.
4. If you have migrated signals, modify the filter subscriptions according to the new data structure.
5. Since the feature Data Segregation has been implemented to limit data access to users or user groups that
satisfy specific criteria, if you have used the name SegregationTag (reserved for data segregation) for an entity
in your App, you must open the App and modify this name before deploying it.
6. In order to migrate User Interfaces:
• In case of code-based UI screens (without using Model Driven UI Editor), to integrate the new Data
Segregation functionality that allows you to modify the list of segregation tags assigned to entity
instances (see Modifying the List of Segregation Tags Assigned to Entity Instances in the Opcenter
Execution Foundation User Manual), specify entityName and appName in the Item Collection Viewer
(unless you have configured the widget for server-side pagination).
• Right-click the App UserInterface project and click Generate UI Application Files.
• Right-click the App UserInterface project and click Migrate to migrate the UI Component and UI Module
manifest.
• Verify the versions of the supported third-party software you have used to develop UIs.
• Verify that the AngularJS dependencies specified in the file module.js still correspond to your
requirements.
7. Build the solution in Project Studio.
What to do next
Perform the final step in Solution Studio, which will allow you to deploy your updated solution.
Prerequisites
• You must perform the Rebuild operation in the SIMATIC IT UAF 2.2 Project before proceeding with the migration
procedure to avoid misalignments between .um/.umd files and .ul files.
• You must restore any references to other Functional Blocks before proceeding with the following migration
procedure.
• You must verify if any Functional Block needs to be updated before proceeding with the following migration
procedure and, if needed, update the involved Functional Blocks.
• We recommend you create a back-up of your Functional Blocks before migrating them.
• Do not modify the data model, such as adding new entities, during the migration procedure.
• If you are working under source control with several machines, the migration procedure should be performed
on one machine only. You can successively align the other machines using the Get Latest function once the first
machine has checked-in the migrated model.
Procedure
1. Open your solution in Project Studio (in Opcenter Execution Foundation 4.1).
2. As the Model Project has been reviewed to improve usability when modelling Functional Blocks and Apps,
perform the following steps:
• Build your solution.
• Delete the .um file from the model project. If you double-click this file, a warning message will inform
you that it is no longer supported and needs to be removed.
• Build your solution again. Now you can open the model double-clicking the .dm file from the Diagrams
sub-folder, containing the graphical representation of the data model.
3. Since the feature Data Segregation has been implemented to limit data access to users or user groups that
satisfy specific criteria, if you have used the name SegregationTag (reserved for data segregation) for an entity
in your App, you must open the App and modify this name before deploying it.
4. In order to migrate User Interfaces:
• In case of code-based UI screens (without using Model Driven UI Editor), to integrate the new Data
Segregation functionality that allows you to modify the list of segregation tags assigned to entity
instances (see Modifying the List of Segregation Tags Assigned to Entity Instances in the Opcenter
Execution Foundation User Manual), specify entityName and appName in the Item Collection Viewer
(unless you have configured the widget for server-side pagination).
• Right-click the App UserInterface project and click Generate UI Application Files.
• Right-click the App UserInterface project and click Migrate to migrate the UI Module manifest.
• Verify the versions of the supported third-party software you have used to develop UIs.
• Verify that the AngularJS dependencies specified in the file module.js still correspond to your
requirements.
5. Build the solution in Project Studio.
What to do next
Perform the final step in Solution Studio, which will allow you to deploy your updated solution.
Prerequisites
• You must perform the Rebuild operation in the SIMATIC IT UAF 2.3 Project before proceeding with the migration
procedure to avoid misalignments between .um/.umd files and .ul files.
• You must restore any references to other Functional Blocks before proceeding with the following migration
procedure.
• You must verify if any Functional Block needs to be updated before proceeding with the following migration
procedure and, if needed, update the involved Functional Blocks.
• We recommend you create a back-up of your Functional Blocks before migrating them.
• Do not modify the data model, such as adding new entities, during the migration procedure.
• If you are working under source control with several machines, the migration procedure should be performed
on one machine only. You can successively align the other machines using the Get Latest function once the first
machine has checked-in the migrated model.
Procedure
1. Open your solution in Project Studio (in Opcenter Execution Foundation 4.1).
2. As the Model Project has been reviewed to improve usability when modelling Functional Blocks and Apps,
perform the following steps:
• Build your solution.
• Delete the .um file from the model project. If you double-click this file, a warning message will inform
you that it is no longer supported and needs to be removed.
• Build your solution again. Now you can open the model double-clicking the .dm file from the Diagrams
sub-folder, containing the graphical representation of the data model.
3. In order to migrate User Interfaces:
• In case of code-based UI screens (without using Model Driven UI Editor), to integrate the new Data
Segregation functionality that allows you to modify the list of segregation tags assigned to entity
instances (see Modifying the List of Segregation Tags Assigned to Entity Instances in the Opcenter
Execution Foundation User Manual), specify entityName and appName in the Item Collection Viewer
(unless you have configured the widget for server-side pagination).
• Right-click the App UserInterface project and click Generate UI Application Files.
• Right-click the App UserInterface project and click Migrate to migrate the UI Module manifest.
• Verify the versions of the supported third-party software you have used to develop UIs.
• Verify that the AngularJS dependencies specified in the file module.js still correspond to your
requirements.
4. Build the solution in Project Studio.
What to do next
Perform the final step in Solution Studio, which will allow you to deploy your updated solution.
This step is required only if you want to incorporate new features, otherwise you can deploy your old packages (if
they do not reference any system functionalities and the Solution does not contain Foundation Apps).
Prerequisites
• You must perform the Rebuild operation in the SIMATIC IT UAF 2.4 Project before proceeding with the migration
procedure to avoid misalignments between .um/.umd files and .ul files.
• You must restore any references to other Functional Blocks before proceeding with the following migration
procedure.
• You must verify if any Functional Block needs to be updated before proceeding with the following migration
procedure and, if needed, update the involved Functional Blocks.
• We recommend you create a back-up of your Functional Blocks before migrating them.
• Do not modify the data model, such as adding new entities, during the migration procedure.
• If you are working under source control with several machines, the migration procedure should be performed
on one machine only. You can successively align the other machines using the Get Latest function once the first
machine has checked-in the migrated model.
Procedure
1. Open your solution in Project Studio (in Opcenter Execution Foundation 4.1).
2. As the Model Project has been reviewed to improve usability when modelling Functional Blocks and Apps,
perform the following steps:
• Build your solution.
• Delete the .um file from the model project. If you double-click this file, a warning message will inform
you that it is no longer supported and needs to be removed.
• Build your solution again. Now you can open the model double-clicking the .dm file from the Diagrams
sub-folder, containing the graphical representation of the data model.
3. In order to migrate User Interfaces:
• In case of code-based UI screens (without using Model Driven UI Editor), to integrate the Data
Segregation functionality that allows you to modify the list of segregation tags assigned to entity
instances (see Modifying the List of Segregation Tags Assigned to Entity Instances in the Opcenter
Execution Foundation User Manual), specify entityName and appName in the Item Collection Viewer
(unless you have configured the widget for server-side pagination).
• Right-click the App UserInterface project and click Generate UI Application Files.
• Right-click the App UserInterface project and click Migrate to migrate the UI Module manifest.
• Verify the versions of the supported third-party software you have used to develop UIs.
• Verify that the AngularJS dependencies specified in the file module.js still correspond to your
requirements.
4. Build the solution in Project Studio.
What to do next
Perform the final step in Solution Studio, which will allow you to deploy your updated solution.
Prerequisites
• You must perform the Rebuild operation in the SIMATIC IT UAF 2.5 Project before proceeding with the migration
procedure to avoid misalignments between .um/.umd files and .ul files.
• You must restore any references to other Functional Blocks before proceeding with the following migration
procedure.
• You must verify if any Functional Block needs to be updated before proceeding with the following migration
procedure and, if needed, update the involved Functional Blocks.
• We recommend you create a back-up of your Functional Blocks before migrating them.
• Do not modify the data model, such as adding new entities, during the migration procedure.
• If you are working under source control with several machines, the migration procedure should be performed
on one machine only. You can successively align the other machines using the Get Latest function once the first
machine has checked-in the migrated model.
Procedure
1. Open your solution in Project Studio (in Opcenter Execution Foundation 4.1).
2. As the Model Project has been reviewed to improve usability when modelling Functional Blocks and Apps,
perform the following steps:
• Build your solution.
• Delete the .um file from the model project. If you double-click this file, a warning message will inform
you that it is no longer supported and needs to be removed.
• Build your solution again. Now you can open the model double-clicking the .dm file from the Diagrams
sub-folder, containing the graphical representation of the data model.
3. In order to migrate your Command Handler / Event Handler / Reading Function Handler / Composite Command
Handler projects, if the ES_SD Functional Block (referenced by default in the Audit Trail App) is used in your
application, you must replace the occurrences of ScenarioConfigurationId with
ScenarioConfigurationId.Value within the code to properly access the actual value of the
property ScenarioConfigurationId belonging to the ScenarioInstance entity.
4. In order to migrate User Interfaces:
• In case of code-based UI screens (without using Model Driven UI Editor), to integrate the Data
Segregation functionality that allows you to modify the list of segregation tags assigned to entity
instances (see Modifying the List of Segregation Tags Assigned to Entity Instances in the Opcenter
Execution Foundation User Manual), specify entityName and appName in the Item Collection Viewer
(unless you have configured the widget for server-side pagination).
• Right-click the App UserInterface project and click Generate UI Application Files.
• Right-click the App UserInterface project and click Migrate to migrate the UI Module manifest.
• Verify the versions of the supported third-party software you have used to develop UIs.
• Verify that the AngularJS dependencies specified in the file module.js still correspond to your
requirements.
• If you are using SWAC components and the SWAC version has been updated (as documented at Using
Third-Party Components), execute the procedure described at Migrating the SWAC Component Manifest.
5. Build the solution in Project Studio.
What to do next
Perform the final step in Solution Studio, which will allow you to deploy your updated solution.
Prerequisites
• You must perform the Rebuild operation in the Opcenter Execution Foundation 3.0 Project before proceeding
with the migration procedure to avoid misalignments between .um/.umd files and .ul files.
• You must restore any references to other Functional Blocks before proceeding with the following migration
procedure.
• You must verify if any Functional Block needs to be updated before proceeding with the following migration
procedure and, if needed, update the involved Functional Blocks.
• We recommend you create a back-up of your Functional Blocks before migrating them.
• Do not modify the data model, such as adding new entities, during the migration procedure.
• If you are working under source control with several machines, the migration procedure should be performed
on one machine only. You can successively align the other machines using the Get Latest function once the first
machine has checked-in the migrated model.
Procedure
1. Open your solution in Project Studio (in Opcenter Execution Foundation 4.1).
2. As the Model Project has been reviewed to improve usability when modelling Functional Blocks and Apps,
perform the following steps:
• Build your solution.
• Delete the .um file from the model project. If you double-click this file, a warning message will inform
you that it is no longer supported and needs to be removed.
• Build your solution again. Now you can open the model double-clicking the .dm file from the Diagrams
sub-folder, containing the graphical representation of the data model.
3. In order to migrate your Command Handler / Event Handler / Reading Function Handler / Composite Command
Handler projects, if the ES_SD Functional Block (referenced by default in the Audit Trail App) is used in your
application, you must replace the occurrences of ScenarioConfigurationId with
ScenarioConfigurationId.Value within the code to properly access the actual value of the
property ScenarioConfigurationId belonging to the ScenarioInstance entity.
4. In order to migrate User Interfaces:
• In case of code-based UI screens (without using Model Driven UI Editor), to integrate the Data
Segregation functionality that allows you to modify the list of segregation tags assigned to entity
instances (see Modifying the List of Segregation Tags Assigned to Entity Instances in the Opcenter
Execution Foundation User Manual), specify entityName and appName in the Item Collection Viewer
(unless you have configured the widget for server-side pagination).
• Right-click the App UserInterface project and click Generate UI Application Files.
• Right-click the App UserInterface project and click Migrate to migrate the UI Module manifest.
• Verify the versions of the supported third-party software you have used to develop UIs.
• Verify that the AngularJS dependencies specified in the file module.js still correspond to your
requirements.
• If you are using SWAC components and the SWAC version has been updated (as documented at Using
Third-Party Components), execute the procedure described at Migrating the SWAC Component Manifest.
5. Build the solution in Project Studio.
What to do next
Perform the final step in Solution Studio, which will allow you to deploy your updated solution.
This step is required only if you want to incorporate new features, otherwise you can deploy your old packages (if
they do not reference any system functionalities and the Solution does not contain Foundation Apps).
Prerequisites
• You must perform the Rebuild operation in the Opcenter Execution Foundation 3.1 Project before proceeding
with the migration procedure to avoid misalignments between .um/.umd files and .ul files.
• You must restore any references to other Functional Blocks before proceeding with the following migration
procedure.
• You must verify if any Functional Block needs to be updated before proceeding with the following migration
procedure and, if needed, update the involved Functional Blocks.
• We recommend you create a back-up of your Functional Blocks before migrating them.
• Do not modify the data model, such as adding new entities, during the migration procedure.
• If you are working under source control with several machines, the migration procedure should be performed
on one machine only. You can successively align the other machines using the Get Latest function once the first
machine has checked-in the migrated model.
Procedure
1. Open your solution in Project Studio (in Opcenter Execution Foundation 4.1).
2. As the Model Project has been reviewed to improve usability when modelling Functional Blocks and Apps,
perform the following steps:
• Build your solution.
• Delete the .um file from the model project. If you double-click this file, a warning message will inform
you that it is no longer supported and needs to be removed.
• Build your solution again. Now you can open the model double-clicking the .dm file from the Diagrams
sub-folder, containing the graphical representation of the data model.
3. In order to migrate your Command Handler / Event Handler / Reading Function Handler / Composite Command
Handler projects, if the ES_SD Functional Block (referenced by default in the Audit Trail App) is used in your
application, you must replace the occurrences of ScenarioConfigurationId with
ScenarioConfigurationId.Value within the code to properly access the actual value of the
property ScenarioConfigurationId belonging to the ScenarioInstance entity.
4. In order to migrate User Interfaces:
• In case of code-based UI screens (without using Model Driven UI Editor), to integrate the Data
Segregation functionality that allows you to modify the list of segregation tags assigned to entity
instances (see Modifying the List of Segregation Tags Assigned to Entity Instances in the Opcenter
Execution Foundation User Manual), specify entityName and appName in the Item Collection Viewer
(unless you have configured the widget for server-side pagination).
• Right-click the App UserInterface project and click Generate UI Application Files.
• Right-click the App UserInterface project and click Migrate to migrate the UI Module manifest.
• Verify the versions of the supported third-party software you have used to develop UIs.
• Verify that the AngularJS dependencies specified in the file module.js still correspond to your
requirements.
• If you are using SWAC components and the SWAC version has been updated (as documented at Using
Third-Party Components), execute the procedure described at Migrating the SWAC Component Manifest.
5. Build the solution in Project Studio.
What to do next
Perform the final step in Solution Studio, which will allow you to deploy your updated solution.
Prerequisites
• You must perform the Rebuild operation in the Opcenter Execution Foundation 3.2 Project before proceeding
with the migration procedure to avoid misalignments between .um/.umd files and .ul files.
• You must restore any references to other Functional Blocks before proceeding with the following migration
procedure.
• You must verify if any Functional Block needs to be updated before proceeding with the following migration
procedure and, if needed, update the involved Functional Blocks.
• We recommend you create a back-up of your Functional Blocks before migrating them.
• Do not modify the data model, such as adding new entities, during the migration procedure.
• If you are working under source control with several machines, the migration procedure should be performed
on one machine only. You can successively align the other machines using the Get Latest function once the first
machine has checked-in the migrated model.
Procedure
1. Open your solution in Project Studio (in Opcenter Execution Foundation 4.1).
2. As the Model Project has been reviewed to improve usability when modelling Functional Blocks and Apps,
perform the following steps:
• Build your solution.
• Delete the .um file from the model project. If you double-click this file, a warning message will inform
you that it is no longer supported and needs to be removed.
• Build your solution again. Now you can open the model double-clicking the .dm file from the Diagrams
sub-folder, containing the graphical representation of the data model.
3. In order to migrate your Command Handler / Event Handler / Reading Function Handler / Composite Command
Handler projects, if the ES_SD Functional Block (referenced by default in the Audit Trail App) is used in your
application, you must replace the occurrences of ScenarioConfigurationId with
ScenarioConfigurationId.Value within the code to properly access the actual value of the
property ScenarioConfigurationId belonging to the ScenarioInstance entity.
4. In order to migrate User Interfaces:
• In case of code-based UI screens (without using Model Driven UI Editor), to integrate the Data
Segregation functionality that allows you to modify the list of segregation tags assigned to entity
instances (see Modifying the List of Segregation Tags Assigned to Entity Instances in the Opcenter
Execution Foundation User Manual), specify entityName and appName in the Item Collection Viewer
(unless you have configured the widget for server-side pagination).
• Right-click the App UserInterface project and click Generate UI Application Files.
• Right-click the App UserInterface project and click Migrate to migrate the UI Module manifest.
• Verify the versions of the supported third-party software you have used to develop UIs.
• Verify that the AngularJS dependencies specified in the file module.js still correspond to your
requirements.
• If you are using SWAC components and the SWAC version has been updated (as documented at Using
Third-Party Components), execute the procedure described at Migrating the SWAC Component Manifest.
5. Build the solution in Project Studio.
What to do next
Perform the final step in Solution Studio, which will allow you to deploy your updated solution.
Prerequisites
• You must perform the Rebuild operation in the Opcenter Execution Foundation 3.3 Project before proceeding
with the migration procedure to avoid misalignments between .um/.umd files and .ul files.
• You must restore any references to other Functional Blocks before proceeding with the following migration
procedure.
• You must verify if any Functional Block needs to be updated before proceeding with the following migration
procedure and, if needed, update the involved Functional Blocks.
• We recommend you create a back-up of your Functional Blocks before migrating them.
• Do not modify the data model, such as adding new entities, during the migration procedure.
• If you are working under source control with several machines, the migration procedure should be performed
on one machine only. You can successively align the other machines using the Get Latest function once the first
machine has checked-in the migrated model.
Procedure
1. Open your solution in Project Studio (in Opcenter Execution Foundation 4.1).
2. As the Model Project has been reviewed to improve usability when modelling Functional Blocks and Apps,
perform the following steps:
• Build your solution.
• Delete the .um file from the model project. If you double-click this file, a warning message will inform
you that it is no longer supported and needs to be removed.
• Build your solution again. Now you can open the model double-clicking the .dm file from the Diagrams
sub-folder, containing the graphical representation of the data model.
3. In order to migrate your Command Handler / Event Handler / Reading Function Handler / Composite Command
Handler projects, if the ES_SD Functional Block (referenced by default in the Audit Trail App) is used in your
application, you must replace the occurrences of ScenarioConfigurationId with
ScenarioConfigurationId.Value within the code to properly access the actual value of the
property ScenarioConfigurationId belonging to the ScenarioInstance entity.
4. In order to migrate User Interfaces:
• In case of code-based UI screens (without using Model Driven UI Editor), to integrate the Data
Segregation functionality that allows you to modify the list of segregation tags assigned to entity
instances (see Modifying the List of Segregation Tags Assigned to Entity Instances in the Opcenter
Execution Foundation User Manual), specify entityName and appName in the Item Collection Viewer
(unless you have configured the widget for server-side pagination).
• Right-click the App UserInterface project and click Generate UI Application Files.
• Right-click the App UserInterface project and click Migrate to migrate the UI Module manifest.
• Verify the versions of the supported third-party software you have used to develop UIs.
• Verify that the AngularJS dependencies specified in the file module.js still correspond to your
requirements.
• If you are using SWAC components and the SWAC version has been updated (as documented at Using
Third-Party Components), execute the procedure described at Migrating the SWAC Component Manifest.
5. Build the solution in Project Studio.
What to do next
Perform the final step in Solution Studio, which will allow you to deploy your updated solution.
Prerequisites
• You must perform the Rebuild operation in the Opcenter Execution Foundation 4.0 Project before proceeding
with the migration procedure to avoid misalignments between .um/.umd files and .ul files.
• You must restore any references to other Functional Blocks before proceeding with the following migration
procedure.
• You must verify if any Functional Block needs to be updated before proceeding with the following migration
procedure and, if needed, update the involved Functional Blocks.
• We recommend you create a back-up of your Functional Blocks before migrating them.
• Do not modify the data model, such as adding new entities, during the migration procedure.
• If you are working under source control with several machines, the migration procedure should be performed
on one machine only. You can successively align the other machines using the Get Latest function once the first
machine has checked-in the migrated model.
Procedure
1. Open your solution in Project Studio (in Opcenter Execution Foundation 4.1).
2. As the Model Project has been reviewed to improve usability when modelling Functional Blocks and Apps,
perform the following steps:
• Build your solution.
• Delete the .um file from the model project. If you double-click this file, a warning message will inform
you that it is no longer supported and needs to be removed.
• Build your solution again. Now you can open the model double-clicking the .dm file from the Diagrams
sub-folder, containing the graphical representation of the data model.
3. In order to migrate your Command Handler / Event Handler / Reading Function Handler / Composite Command
Handler projects, if the ES_SD Functional Block (referenced by default in the Audit Trail App) is used in your
application, you must replace the occurrences of ScenarioConfigurationId with
ScenarioConfigurationId.Value within the code to properly access the actual value of the
property ScenarioConfigurationId belonging to the ScenarioInstance entity.
4. In order to migrate User Interfaces:
• In case of code-based UI screens (without using Model Driven UI Editor), to integrate the Data
Segregation functionality that allows you to modify the list of segregation tags assigned to entity
instances (see Modifying the List of Segregation Tags Assigned to Entity Instances in the Opcenter
Execution Foundation User Manual), specify entityName and appName in the Item Collection Viewer
(unless you have configured the widget for server-side pagination).
• Right-click the App UserInterface project and click Generate UI Application Files.
• Right-click the App UserInterface project and click Migrate to migrate the UI Module manifest.
• Verify the versions of the supported third-party software you have used to develop UIs.
• Verify that the AngularJS dependencies specified in the file module.js still correspond to your
requirements.
• If you are using SWAC components and the SWAC version has been updated (as documented at Using
Third-Party Components), execute the procedure described at Migrating the SWAC Component Manifest.
5. Build the solution in Project Studio.
What to do next
Perform the final step in Solution Studio, which will allow you to deploy your updated solution.
Prerequisites
• If required, you have already updated your Model in Project Studio.
• You have cleaned the browser cache before opening Solution Studio.
Procedure
1. In the App Management page,
• Update (with the button) or reload (with the button) the Foundation Apps that are present in
your Solution (e.g. Automation App, Personnel App, Signal App and so on) according to the following
behavior: the Apps that require an update are marked with the indicator, while all the other Apps
that do not show this indicator require a reload ( ).
• If you have updated any custom Apps in Project Studio, either reload them ( ) or update them (
) according to the versioning logic you have used (see Creating a New Version of Functional Block or
App and Reloading Apps and Extension Apps in a Solution).
2. If you come from version SIMATIC IT UAF 1.3 Update 4, in the Mashup page you have to open each Mashup
module, check that the wiring page is well formatted and then generate the Mashup.
3. In the UI Applications page, open any UI Applications to verify the following:
• Ensure they do not contain UI Modules that are no longer used in the updated solution. If you find any UI
Modules whose status is deleted, select them and click Unassign deleted modules. If you fail to do this,
the UI Application will be invalid.
• Add/delete the required UI Modules; for example, you can add new UI Modules in order to display any
newly provided screens.
4. Run the scripts for upgraded Apps, if you have Apps that reference the Siemens.SimanticIT.EQU_MS
05.00.00, Siemens.SimaticIT.EQ_OP 05.00.00, Siemens.SimaticIT.TSK_MS 06.00.00,
Siemens.SimaticIT.TSK_OP 08.00.00 and Siemens.SimaticIT.UDM_RF 04.00.00 Functional Blocks.
What to do next
Build and deploy the updated Solution in Solution Studio.
Prerequisites
Procedure
Depending on the database management platform, run the following scripts on the solution database (first on the
Master Data Domain, then on the Operational Data Domain, and finally on the Reference Data Domain) by manually
copying them from the provided location to the database server:
• On SQL Server:
• %SITUnifiedSystemRoot%Utility\OldReadingModelUpdate\MasterData\SqlServer\Post
• %SITUnifiedSystemRoot%Utility\OldReadingModelUpdate\OperationalData\SqlServer\Post
• %SITUnifiedSystemRoot%Utility\OldReadingModelUpdate\ReferenceData\SqlServer\Post
• Oracle:
• %SITUnifiedSystemRoot%Utility\OldReadingModelUpdate\MasterData\Oracle\Post
• %SITUnifiedSystemRoot%Utility\OldReadingModelUpdate\OperationalData\Oracle\Post
• %SITUnifiedSystemRoot%Utility\OldReadingModelUpdate\ReferenceData\Oracle\Post
What to do next
Go back to build and deploy the updated Solution in Solution Studio.
Due to technological upgrades and the adoption of .NET Core/Standard technology, the SQL Server
FileStream data management functionality is not in use anymore.
Starting from 3.1, unstructured data file, such as images and documents, are internally managed within
the runtime Opcenter EX FN database.
Prerequisites
You have updated the Solution in Solution Studio.
Procedure
If your Manufacturing Solution contains references to the entities that have been declared Obsolete in
version 4.0 (entities that were available with the UDM_RF Functional Block),
you will need to enable Data Loss before migrating your Solution to the current version. In particular, this
applies to the following use cases:
• if you have a Solution containing any custom Apps that reference
the Siemens.SimaticIT.UDM_RF Functional Block;
• if you have a Solution containing any Opcenter EX FN Apps except for Application Log and Personnel.
For a detailed list of the removed functionalities, refer to Obsolete Functionalities in the Opcenter
Execution Foundation Release Notes.
1. If you are in one of the above mentioned you cases, enable Data Loss by manually creating the
deploy_configuration.xml file as documented at Enabling Potentially Destructive Operations.
2. Build your Solution ( button, see Creating the Deployment Package).
3. In the Host Management page, deploy the Solution on all environment hosts ( button, see Deploying the
Solution Package to Hosts).
4. Update the database ( button, see Deploying the Solution Package to Hosts).
5. Start the runtime services on all hosts ( button, see Deploying the Solution Package to Hosts).
• Make sure you delete the deploy_configuration.xml file before using your solution on the production
line.
• If the deployment of the Solution fails and you migrated the Signals App from a previous version, you
need to deploy the Signal Rules again.
What to do next
Complete the migration by performing some specific migration steps in the Foundation Apps.
Prerequisites
You have already built and deployed the updated Solution in Solution Studio.
During the migration of Opcenter Execution Foundation from lower version to version 4.0, the Automation
Gateway App configuration consisting of values for functionalities and entity properties that are declared
obsolete (see Obsolete Functionalities in the Opcenter Execution Foundation Release Notes, Automation
Gateway section, for the complete list), will be lost.
This information is traced in Trace Viewer with the Provider Name as Siemens-SimaticIT-Trace-UDM-
AutomationGateway, see Logging and Analyzing Application Traces with Trace Viewer in the Opcenter
Execution Foundation Development and Configuration Guide. The system allows you to export the
preliminary configuration containing the pre-migration configuration which can be lost (See Migrating
Automation Node Master Data in the Opcenter Execution Foundation User Manual).
Until the Migrate operation is performed, any Engineering operation is allowed except for the following:
Reset Environment, Activate Channels, Activate Types and Instances, and Import with Replace.
After a successful Migrate operation or an Activate operation from the previous platform version, to
properly restore the runtime communication with the Automation Gateway Server, for each secured
channel, retrieve the OPC UA server certificate, approve and then activate Automation Channels, Types
and Instances to the Automation Gateway Server (as described at Activating Runtime Integration in the
Opcenter Execution Foundation User Guide).
Signal App
If you are migrating the Signals App from a previous version, perform the following steps in the following order:
1. After restarting runtime services on all hosts, reactivate the configuration of Automation and deploy the Signal
Rules based on Automation entities again.
2. Since the model of the running solution changed (commands, entities, signals), Signal Rules configured in
the Signals App may be rendered invalid. In particular, an error may return when deploying the Signal Rule or
the Signal Rule may not work properly at runtime. Depending on the involved Signal Rule, do either of the
following:
• Open the query editor to update the rule structure to the most recent version of the solution and then
save the query to persist this information on the database.
• Click Reload to ensure the Signal source/action data you are viewing is aligned with the most recent
version and then save the information.
3. You have the possibility to specify if you want to receive the values of the Automation Type only when the Signal
Rule executes, and not the initial values from the first run and when the Automation Gateway reconnects. To
incorporate this feature in the source filter, you have to save the Signal rules in the Signal App in order to view
the Enable Initial State parameter in the source filter. Moreover, as a 2.3 Signal App feature, you can also filter
by the IsChanged attribute on each Automation Parameter, in order to trigger the Signal Rule only when the
configured Automation Parameter changes. If the Signal Rule is migrated from 2.2, open the Signal Rule and
save the source block first in order to see and use the new attribute.
If you have migrated the solution from 2.3 version (or earlier), the system will set any migrated Signal Rules
to parallel and it will not be possible to convert them to sequential.