ANSYS EKM Administration Guide
ANSYS EKM Administration Guide
ANSYS EKM Administration Guide
© 2015 SAS IP, Inc. All rights reserved. Unauthorized use, distribution or duplication is prohibited.
ANSYS, ANSYS Workbench, Ansoft, AUTODYN, EKM, Engineering Knowledge Manager, CFX, FLUENT, HFSS, AIM
and any and all ANSYS, Inc. brand, product, service and feature names, logos and slogans are registered trademarks
or trademarks of ANSYS, Inc. or its subsidiaries in the United States or other countries. ICEM CFD is a trademark
used by ANSYS, Inc. under license. CFX is a trademark of Sony Corporation in Japan. All other brand, product,
service and feature names or trademarks are the property of their respective owners.
Disclaimer Notice
THIS ANSYS SOFTWARE PRODUCT AND PROGRAM DOCUMENTATION INCLUDE TRADE SECRETS AND ARE CONFID-
ENTIAL AND PROPRIETARY PRODUCTS OF ANSYS, INC., ITS SUBSIDIARIES, OR LICENSORS. The software products
and documentation are furnished by ANSYS, Inc., its subsidiaries, or affiliates under a software license agreement
that contains provisions concerning non-disclosure, copying, length and nature of use, compliance with exporting
laws, warranties, disclaimers, limitations of liability, and remedies, and other provisions. The software products
and documentation may be used, disclosed, transferred, or copied only in accordance with the terms and conditions
of that software license agreement.
For U.S. Government users, except as specifically granted by the ANSYS, Inc. software license agreement, the use,
duplication, or disclosure by the United States Government is subject to restrictions stated in the ANSYS, Inc.
software license agreement and FAR 12.212 (for non-DOD licenses).
Third-Party Software
See the legal information in the product help files for the complete Legal Notice for ANSYS proprietary software
and third-party software. If you are unable to access the Legal Notice, Contact ANSYS, Inc.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. iii
Administration Guide
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
iv of ANSYS, Inc. and its subsidiaries and affiliates.
Administration Guide
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. v
Administration Guide
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
vi of ANSYS, Inc. and its subsidiaries and affiliates.
Administration Guide
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. vii
Administration Guide
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
viii of ANSYS, Inc. and its subsidiaries and affiliates.
Administration Guide
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. ix
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
x of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 1: Using This Guide
This guide covers administrative actions that the Root User, superuser, or members of the admin
group perform on an EKM server. This guide assumes that an EKM server has already been installed
and set up following the instructions that are outlined in the Installation Guide.
If you are a non-admin user of EKM, refer to the User's Guide for topics relevant to you. For a general
overview of EKM and how to get started, refer to the Getting Started Guide.
• Miscellaneous tasks (p. 251) (configuring a commons scripts library, gathering usage statistics, remote
file servers, managing logs, installing VCollab and configuring EKM for 3D visualization, using EKM
server diagnostics tool)
Some administrative tasks may require editing XML files. This guide assumes that you have a basic un-
derstanding of XML constructs and syntax (schema definition). If you are unfamiliar with these techno-
logies, it is recommended that you review them before proceeding. http://www.w3.org offers extensive
tutorials and documentation. In particular, you should review the documentation on XML schemas
found at: http://www.w3.org/TR/xmlschema-0. While creating or editing XML files, it is recommended
that you use schema-aware XML editors. This will enable you to easily create configuration files that
are syntactically correct and reduce the likelihood of errors.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 1
Using This Guide
For the definitions of the EKM path variables, see EKM Path Variables in the Engineering Knowledge
Manager.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
2 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 2: Overview of Servers and Workspaces
EKM provides many ways to structure your information and manage multiple workgroups that are
spread across multiple locations. Two concepts are defined in EKM for this purpose:
• EKM Server: A server that is a single installation of EKM whether it is clustered or not. For a clustered
installation, all nodes are considered as a single server.
• Workspace: A partition of an EKM server that can contain its own data model, users, and groups. When
you sign in to EKM, you sign in to a workspace on the EKM server.
Every EKM server contains one default user-accessible workspace with a repository for data. More
workspaces can be created if needed. When you set up a workspace you determine who can access it,
and specify the permissions that each user has in that workspace. Every EKM server also has a hidden
workspace for caching data from remote servers. This workspace may be involved in file transfers when
data is downloaded from or uploaded to a remote EKM server using the File Transfer Client.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 3
Overview of Servers and Workspaces
• Data Cache: Any file uploaded to, or downloaded from, the master server from a remote office will be
cached in the regional server. If the file does not change on the master server, then any subsequent
download of that file from the remote office can be processed by the regional server without requiring
a data transfer from the master. If the file is changed, then it is downloaded and cached again in the
regional server.
• Asynchronous Uploads: When a user in a remote office uploads data to the master server, it is first
stored in the regional server, which then uploads the data to the master server on the user’s behalf.
This enables users to quickly and asynchronously transfer large amount of data to the local server and
sign out or disconnect from their machine, without waiting for the full transfer to be complete.
• Regional Workspaces: If users in a remote office want to use EKM to collaborate among themselves
without incurring the latency of transferring data to or from the master server, they can create a
workspace in the regional server. These users can then directly sign in to the regional server, bypassing
the master server altogether. This feature should be used with caution because it can cause data to be
isolated and impede the sharing of data between users and groups belonging to other offices or regions.
Therefore, these workspaces should be used only if the data being stored in regional servers is only
relevant to the local users and will not be generally used by others in the company. For more information
about workspaces, see How Workspaces are Used (p. 4).
A detailed overview of regional servers and how they can be used for caching is provided in Distributed
Servers and Workspace Access (p. 5).
• Sandbox: Users and groups that are new to EKM may want to get acquainted with the system through
a dummy workspace. This workspace provides a sandbox for such users to experiment with usage, data
entry and other features of EKM without worrying about the constraints imposed by a production
workspace.
• Test: Configuration changes, such as edits to object lifecycles and custom data types, can be made
dynamically in a workspace. But such changes usually require some iteration and review. Having a
separate test workspace for this purpose enables administrators and other stakeholders to experiment
with configuration changes without disturbing the production workspace.
In general, workspaces should not be used as a security mechanism to provide different groups in a
company with their own private space. Data isolation can be achieved in a single workspace through
the use of groups, per-user access level assignments, and object-level permissions. Multiple workspaces
increase management overhead and impede the sharing of data between users and groups belonging
to different workspaces. Even if data sharing is not a short-term requirement, it may become an issue
in the long term.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
4 of ANSYS, Inc. and its subsidiaries and affiliates.
Distributed Servers and Workspace Access
Each EKM server has one default workspace that can be configured for user access, and more workspaces
can be created if needed.
Each workspace contains a repository for storing and sharing data. EKM will automatically create a user
account for a user when they first sign in to the workspace. Initially the user will have limited permissions,
but you can edit their permissions after the account has been created. When a user logs into EKM, they
are automatically logged into their default workspace, and can potentially access other workspaces if
they have access permission in those workspaces. See Configuring Login-related Access Settings in the
Installation Guide for details.
In the example above, the EKM server in New York contains a workspace whose data is shared globally
by users in New York, London and Tokyo. Any user who wants to be able to access the shared data on
the New York server must have a user account defined in the workspace on the New York server. If a
user in London wants to download a file from the server in New York, they must sign in to the global
workspace on the New York server. In this case file transfers occur over a Wide Area Network (WAN).
File transfer performance in this type of setup may be improved if caching is used. See Caching Data
when Transferring Files (p. 6) for more information.
In the sample configuration, the servers in London and Tokyo can have a regional workspace set up
that only users in that local region or office can access. This enables those users to collaborate among
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 5
Overview of Servers and Workspaces
themselves and share data locally if needed. In this case, user accounts are defined in a workspace on
the local EKM server, and file transfers occur over a Local Area Network (LAN).
Sometimes you may want to use an EKM server only for caching. In this case the Default user-accessible
workspace is simply not used. It is important to note that users are not defined in the cache workspace.
Users cannot sign in to such a workspace, or perform any actions in it. Its sole purpose is to store, syn-
chronize and release data during file transfers.
Note
Caching is only used when the File Transfer Client is used to upload/download files. Caching
is not used when files are transferred using the Browser.
When the user logs into the EKM server in New York, and chooses to upload or download a file, the
EKM server in New York recognizes that their user account is configured to use the Cache Server in
London, and communicates this to the File Transfer Client. The Cache Server will first check to see if it
has the file. If it does not, it will download it from the remote server in New York. At the same, the
Cache Server will stream the file data to the user’s machine.
The user does not interact with the Cache Server at all because caching occurs seamlessly behind the
scenes. To the user, it just seems like the file is being downloaded to their machine from the New York
server. The only noticeable indicator is the data reported in the File Transfer Client.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
6 of ANSYS, Inc. and its subsidiaries and affiliates.
Distributed Servers and Workspace Access
In the figure above, note that the EKM server in London does not have to be a dedicated Cache Server.
It can also have its own user-accessible workspaces for data and simulation management.
If the file has not changed on the server in New York, the request can be processed by the Cache
Server in London without requiring a data transfer from the Master Server in New York. File transfer
performance will be improved because the user is getting the file directly from their regional server
over a LAN rather than from the Master Server over a WAN.
Similarly, when a user in London uploads a file to the Master Server in New York, the file is first uploaded
to the Cache Server in London. The Cache Server then uploads the file to the Master Server in New York
and retains a copy of the file in its cache repository.
While there is technically no improvement in actual overall file transfer time for uploads, because the
upload of the file is only over the LAN to the Cache Server, there is a perceived performance gain. Once
the file is uploaded to the Cache Server, you do not have to wait for the Cache Server to upload the
file to the Master Server and you may perform other actions. This essentially enables the setup of a
queue of pending uploads (to the Master Server) that the Cache Server will handle later. You can even
sign out once the files have been transferred to the Cache Server.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 7
Overview of Servers and Workspaces
When creating the Cache Server definition, you will specify which remote EKM users will use it. You
may also assign a Cache Server to a user when setting up or modifying their user account (refer to
Adding a New User (p. 11)). Referring once again to Figure 2.3: Distributed Setup with Dedicated Cache
Server (p. 7), when the administrator in New York creates a Cache Server definition on the Master
Server for the Cache Server in London, they will assign users based in London to the Cache Server
definition. Users based in New York would not be assigned to the Cache Server because they are already
accessing the data locally on the New York server. When a user in London (who is part of the Cache
Server definition) logs into the Master Server in New York, the Master Server will know to involve the
Cache Server in London when files are being transferred to/from the Master Server.
Note
When transferring files using the File Transfer Client, if a connection to the cache server
cannot be established or is lost, files will instead be transferred to/from the EKM repository
directly.
• Windows: %APPDATA%\Ansys\v170\EKM\connector.log
• Linux: ~/.ansys/v170/EKM/connector.log
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
8 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 3: Setting Up Users and Groups
Any person who wants to access EKM must have their own user account. This account, and the groups
that the user belongs to, determine the permissions that are available to the user, and the actions that
the user can perform in EKM. This chapter describes the definition and management of users and groups
in EKM. Topics include:
3.1. Introduction to Users and Groups
3.2. Automatic Creation of User Accounts
3.3. Adding and Modifying Users
3.4. Forcing the Sign-out of a User
3.5. Designating a Root User
3.6. Accessing a User’s Data
3.7. Adding and Modifying Groups
• ekm_cache_user: The user account that is used by a cache service to find objects that have been
deleted or modified, and to purge obsolete items from the cache.
• ekm_datalink_user: The user account used to transfer files to/from PDM systems.
• ekm_lifecycle_user: The user account that is used to lock an object associated with a lifecycle
while it is under review. This is done so that no other user can modify the object while it is under review.
During installation, a default Root User is also specified. The Root User is the primary administrator for
a workspace and the only user who can perform restricted workspace configuration. When a workspace
is initialized, a user account is automatically created for the designated Root User. That account cannot
be deleted unless a different user is designated as the Root User. See Designating a Root User (p. 14)
for details.
The following predefined groups are defined in all workspaces and cannot be deleted by any user.
• all: The default group that all users in EKM belong to, regardless of whether or not they have been
explicitly assigned to it. Users in this group do not have administrative privileges unless they are also
part of the admin group.
• admin: The group that the Root User and other system administrators belong to. Users in this group
have full permissions available and can perform almost any action within EKM. Note that only users
with Shared access can be members of this group (see Licensing and Access in the Installation Guide),
and once added to this group, their access level cannot be changed.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 9
Setting Up Users and Groups
Note
• The Default workspace that is created during the EKM installation has automatic account creation
enabled by default.
• For new workspaces, automatic account creation is enabled if the Create new users automatically
check box was enabled when the workspace was created.
• EKM user names are case-sensitive. Once an account has been created with the user name entered
at first sign-in, the user must enter that exact user name for subsequent sign-ins.
• By default, users whose accounts have been automatically created will have Analyst privileges
initially (see Licensing and Access in the Installation Guide). You can change a user’s access level
in their profile. See Editing a User’s Profile (p. 14).
Upon the creation of the user’s account, an admin user can further edit the user’s profile and add him
or her to groups, as described in Editing a User’s Profile (p. 14). The user can also update his or her
own personal information and even upload a custom profile image to display on the title bar. See Setting
Your User Profile in the User’s Guide for details.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
10 of ANSYS, Inc. and its subsidiaries and affiliates.
Adding and Modifying Users
• When signing in, a user fails to enter the correct credentials for the active login module, and he or she is
not authenticated. Note that user names and passwords are case-sensitive in EKM.
Also note that EKM will not allow two user accounts that differ only by case. For example, if an account
with the user name jsmith already exists, entering the variation JSMITH at sign-in would not result
in the creation of a new account.
For information about user sign-ins and authentication, see How User Logins Work in the Installation
Guide.
• The Create new users automatically option was disabled when the workspace was created, or the cre-
ateUsersAutomatically setting has been set to false in the WorkspaceConfig.xml file. See
Configuration Settings in WorkspaceConfig.xml (p. 42) for details.
• The workspace is one that has been migrated from version 15 or earlier, in which case auto account creation
is disabled by default. You can enable this setting in the WorkspaceConfig.xml file if desired. See
Configuration Settings in WorkspaceConfig.xml (p. 42) for details.
If you want to enable or disable automatic account creation for an existing workspace, you must start
restricted configuration mode and add a createUsersAutomatically setting to the Workspace-
Config.xml file. If the setting already exists you can change its value. See createUsersAutomatically
Setting (p. 49) for details.
2. Select (New) > User. The New User dialog box opens.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 11
Setting Up Users and Groups
3. Enter a user name. This is the user name that the user will be required to enter when they sign in to EKM.
If you have chosen to authenticate users to the operating system, use the same user name that the user
enters to sign into their operating system. If users are authenticated to an LDAP server or Windows Active
Directory, the user name may be an OS account name or some other unique identifier. Details about sign-
in authentication can be found in Configuring Login Authentication and Access Settings in the EKM Install-
ation Guide.
Note
• User names are case-sensitive in EKM, even if they are not case-sensitive in the system to
which users are being authenticated (LDAP or Windows, for example). The case used at the
time an EKM user account is created in a workspace is the same case that the user must use
when subsequently signing in to that EKM workspace.
• EKM does not allow variations of the same user name (that differ only by case) in the same
workspace. For example, if a user account with the user name jsmith already exists in a
workspace, you cannot create another account with the user name JSMITH in the same
workspace. Attempting to do so will result in an error:
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
12 of ANSYS, Inc. and its subsidiaries and affiliates.
Adding and Modifying Users
4. Optionally specify other details such as First name, Last name, Title, and Phone.
5. Specify the user’s email address. This address is used by EKM to send any alerts or notifications to the
user.
6. If the user belongs to a remote office and a remote EKM server has been configured as a cache server for
that office, then select that server in the Cache server drop-down list. If a cache server does not need to
be assigned for this user, then keep the default value (No Cache Server) for this field.
7. From the Access level drop box, select the type of license that you want to be checked out when the
user signs in to EKM: Shared, Analyst or Basic. This determines what the user can access in EKM, and
what they can do. For more information, see Licensing and Access in the Installation Guide.
8. Select Enabled to enable the user for sign-in. If you do not select this, the user will not be able to sign in
to EKM.
9. If the user needs to be granted access for a limited time only, select Temporary and enter the Expiration
date when prompted.
10. To assign the user to available groups, select the groups in the Available groups column and click the
Add> button to add it to the Selected groups list. To remove the user from a group, select the group in
the Selected groups column and click the < Remove button.
Note
Only users with Shared access can be added to the admin group.
11. Once you have specified all the settings, you can click Create & Close to create the user and close the
dialog. If you want to create more users, then click Create & New. This will create the current user and
reopen the dialog so that you can create another user. All new users will be added to the Administra-
tion/Users page.
12. Once you create a new user, you can edit their profile at any point in the future to make changes to it.
See Editing a User’s Profile (p. 14) for more details.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 13
Setting Up Users and Groups
• The User name field is not editable. To change the name of an existing user, right-click on the user on the
Administration/Users page and select Edit > Rename from the context menu.
• Because you are editing a user instead of creating one, the Edit User dialog contains the OK button instead
of Create & Close and Create & New buttons.
See Adding a New User (p. 11) for details on how to fill out the dialog box.
Important
• If you change a user’s access level, the user will be forcibly signed out of EKM if he or she is cur-
rently signed in.
• You cannot edit the access level of an admin user. If you want to reduce the access level of a
user in the admin group, you will first need to remove that user from the admin group.
To sign out a user who is currently signed in, select the user and then select (More) > Force sign-
out on the toolbar. The user will immediately be signed out of EKM, and the icon next to their name
will change to white .
Note
• You cannot sign out a user who is part of the admin group.
• If a user is currently connected to more than one workspace via a web browser (see Making
Simultaneous Connections), forcibly signing out the user from one workspace will disconnect
the user from the other workspace(s) as well.
One user is designated as the default Root User for all workspaces. This is done during installation. See
Installing a New EKM Server in the Installation Guide for details.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
14 of ANSYS, Inc. and its subsidiaries and affiliates.
Accessing a User’s Data
If you want to edit the designated Root User, you can do so by editing the defaultRootUser setting
in the ekm.xml file. Note that you must first stop the EKM server and then restart it after making the
change in order for the change to take effect. See Specifying General Server Settings (p. 52) for details.
Note
• There is no separate root account in a workspace’s user list. The user designated as the Root
User must have a valid OS or LDAP account, and will sign in to EKM using their normal username
and password. For more information on how EKM user names are determined, see How User
Logins Work in the Installation Guide.
• You cannot delete a user’s account if that user is currently the designated Root User.
2. Right-click the user’s name and select More > Display > List.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 15
Setting Up Users and Groups
You can then browse through these folders to find a specific object.
Note
When using the Advanced search, you can choose to search in a specific user’s folder. For
details see Specifying Search Criteria in the User’s Guide.
2. Select (New) > Group. The New Group dialog box appears, as shown below.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
16 of ANSYS, Inc. and its subsidiaries and affiliates.
Adding and Modifying Groups
4. If you want other groups to be part of this group, select the desired groups in the Available groups list
and click the Add> button to add them to the Selected groups list. To remove a group, select the group
in the Selected groups list and click the < Remove button. All permissions that are available for the
current group will be applied to all users who are members of the selected groups.
5. To assign users to the group, select the desired users in the Available users list and click the Add > button.
To remove a user, select the user in the Selected users list and click the < Remove button. All permissions
that are available to the current group will be applied to all selected users.
6. Once you have specified all the settings you can click Create & Close to create the group and close the
dialog box. If you want to create more groups, click Create & New. This will create the current group and
reopen the dialog box again so that you can create a new group. All new groups will be added to the
Administration/Groups page.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 17
Setting Up Users and Groups
1. The group name field is not editable. To change the name of an existing group, right click on the
group on the Groups page and select Edit > Rename from the context menu.
2. Because you are editing a group instead of creating one, the Edit Group Membership dialog box
contains the OK button instead of Create & Close and Create & New buttons.
See Adding a New Group (p. 16) for details on how to fill out the New Group dialog.
Note
Only users with Shared access can be added to the admin group.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
18 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 4: Creating and Managing Workspaces
This chapter presents information on how a superuser can utilize the EKM Server Administration
interface to perform workspace management tasks in EKM.
Topics include:
4.1. Signing In and Out of EKM Server Administration
4.2. Changing the Superuser Password
4.3. Resetting a Lost Superuser Password
4.4. Cleaning Up Unused Files
4.5. Creating a New, Empty Workspace
4.6.Transferring a Workspace Between EKM Servers
4.7. Renaming Workspaces
4.8. Deleting Workspaces
4.9. Migrating Workspaces
1. In the browser address bar, type the Fully Qualified Domain Name (FQDN) of the EKM server you want to
connect to, with /su appended to the end. For example:
http://ekmServer.mycompany.com:8080/ekm/su
where
ekmServer is the hostname, mycompany.com is the domain, and 8080 is the port that was
either specified or taken as default when the EKM server was set up.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 19
Creating and Managing Workspaces
2. Choose a locale, then enter the superuser password. The default password is superuser123.
4. The EKM Server Administration window contains a list of Workspaces, and these actions:
• Add Workspace lets you add a new empty workspace (p. 23) or an exported workspace (p. 26).
• Migrate Workspace lets you migrate a workspace (p. 31) that is in configuration mode.
• Download Migration Log lets you download a log file detailing the last executed migration.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
20 of ANSYS, Inc. and its subsidiaries and affiliates.
Resetting a Lost Superuser Password
5. To change the password to the EKM Server Administration site, click the Change Password command
link. See Changing the Superuser Password (p. 21) for details.
6. To clean the EKM data directory, click Clean Up Unused Files. See Cleaning Up Unused Files (p. 22) for
details.
7. When server administration is complete, click the Sign Out link at the bottom of the window to sign out
of the site and return to the EKM login window.
Once you are logged out, you can also reset a lost password (p. 21), rename a workspace (p. 28) and
delete a workspace (p. 29).
1. Sign in to EKM Server Administration. See Signing In and Out of EKM Server Administration (p. 19) for
details.
2. Click the Change Password link at the bottom of the EKM Server Administration window.
3. In the Change Superuser Password dialog, enter a new password in the New Password field.
5. Click OK.
2. Replace the text in the superUser element with the following text:
<superUser>
<name>superuser</name>
<password>9a85a0cc0a56febcf46690a6ab1a5803</password>
</superUser>
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 21
Creating and Managing Workspaces
3. Restart EKM.
The superuser password is stored as an md5 key in this file. Therefore, you can create a new key using
any md5 generation tool, and store the new password there.
Important
In order to control the size of the EKM Data Directory, you should periodically run the garbage
collection process to delete files that are no longer needed. This is referred to as "cleaning"
the EKM data directory. Note that the dataStoreGc scheduled task (see Scheduling Automatic
Tasks (<scheduledTasks>)) performs this same operation. If dataStoreGc is running on a
regular schedule, you may not need to run the cleanup from this interface.
1. Sign in to EKM Server Administration. See Signing In and Out of EKM Server Administration (p. 19) for
details.
2. Click the Clean Up Unused Files button in the EKM Server Administration window. The Clean Up Unused
Files dialog box appears.
This dialog has two display modes. What is displayed depends on whether or not garbage collection
is already in progress.
If garbage collection is not currently running, the dialog displays information about the last time
you cleaned the EKM data directory. It shows the time that the garbage collection started, when
it finished, and the number of unreferenced files it deleted.
3. To start garbage collection, click Start Cleanup. This starts a garbage collection task on the EKM Server
and closes the dialog box. The task runs in the background so that you can continue to work in EKM or
sign out. To monitor the progress of the garbage collection, click the Clean Up Unused Files button at
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
22 of ANSYS, Inc. and its subsidiaries and affiliates.
Creating a New, Empty Workspace
the bottom of the EKM Server Administration window. This opens the dialog box again. If garbage
collection is still running, a snapshot of its current status is displayed in the Garbage Collection dialog
box.
You will see two possible status messages depending on what stage the garbage collection is in:
In the first stage, the garbage collection scans through all the nodes in the database. The Garbage
Collection dialog reports the number of nodes that have been scanned so far. After the scanning
stage is complete, it begins a final stage where it deletes all unreferenced files from the EKM data
directory.
Note
To ensure consistency during restore, and to prevent accidental deletion of files that have
not yet been committed, an unreferenced file may not be deleted if it was added or accessed
recently. See the description of the dataStoreGC setting in Scheduling Automatic Tasks
(<scheduledTasks>) (p. 62) for more details.
1. Sign in to EKM Server Administration. See Signing In and Out of EKM Server Administration (p. 19) for
details.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 23
Creating and Managing Workspaces
4. If you want EKM to create user accounts automatically when users successfully sign in to the EKM workspace
for the first time, enable the Create new users automatically check box. See Automatic Creation of User
Accounts (p. 10) for details. Otherwise, if this option is disabled, you must create user accounts for the
workspace before users can connect to it (when they are signing in to EKM, or when switching from an-
other workspace). See Adding and Modifying Users (p. 11) for details.
You can change this setting later by editing the createUsersAutomatically setting in the
WorkspaceConfig.xml file. See Configuration Settings in WorkspaceConfig.xml (p. 42) for details.
Once the workspace has been created, the Add Workspace Completed dialog box appears:
7. Click Close. The new workspace will appear in the Workspaces list in the EKM Server Administration
window, and in all other workspace drop-down lists in EKM.
Important
If the WorkspaceConfig.xml file has not been configured in accordance with the schema
definition, the new workspace will fail to initialize, and the error will be reported in the fol-
lowing dialog:
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
24 of ANSYS, Inc. and its subsidiaries and affiliates.
Transferring a Workspace Between EKM Servers
It is important to note that even though the workspace has failed to initialize, it has still been
created on the server. The presence of a faulty workspace will prevent the EKM server from
starting properly. You will need to manually remove the faulty workspace from the server.
See Deleting Workspaces (p. 29) for details.
Transferring a workspace involves exporting the workspace on the source server and then importing
the exported workspace on the destination server.
Note
• The source and destination EKM servers must be running the same release of EKM. For example,
if you exported a workspace in EKM 16.0, you could import that workspace into EKM 16.1 and
16.2, but you could not import that workspace into EKM R17. If the source and destination EKM
servers are different versions within the same release (for example, 16.0 and 16.2), workspaces
from the older version can be imported into the newer version, but not vice versa.
• You cannot import an exported workspace that has been converted into human-readable format.
For more information see Converting an Exported Workspace into a Human-readable
Format (p. 28).
• If a workspace contains custom object types that use the initializeMacro attribute to call
a script containing transactions, certain transactions in the script may cause the import/export
of the workspace to fail. You should disable such scripts before exporting the workspace.
In this section:
4.6.1. Exporting a Workspace
4.6.2. Importing a Workspace
4.6.3. Converting an Exported Workspace into a Human-readable Format
Note
To export a workspace:
1. Go to the Administration section, then select More > Export Workspace. The Export Workspace dialog
box appears:
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 25
Creating and Managing Workspaces
2. Specify a folder to be created for the exported workspace on the destination server. To do this, enter an
absolute path to the folder on the server’s file system. For example, if you enter C:\ekm\v170\ekm-
server\WorkspaceExport, a folder named WorkspaceExport will be created on the server, and the
workspace will be exported to that folder. Note that you cannot export to an existing folder.
In the steps that follow, the EKM server from which the workspace is being exported is referred to as
the “source” EKM server, and the EKM server where the workspace is being created is referred to as the
“destination” EKM server.
1. Export the workspace from the source EKM server using the Export Workspace action. For details see
Exporting a Workspace (p. 25).
2. Sign in to the Administration interface of the destination EKM server as superuser (see Signing In and
Out of EKM Server Administration (p. 19)).
3. In the EKM Server Administration window, click Add Workspace to create a new workspace. This opens
the New Workspace dialog box.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
26 of ANSYS, Inc. and its subsidiaries and affiliates.
Transferring a Workspace Between EKM Servers
b. If you want EKM to create user accounts for new users automatically, enable the Create new users
automatically check box. See Automatic Creation of User Accounts (p. 10) for details. Otherwise, if
this option is disabled, you must create user accounts for new users before they can connect to the
workspace (when they are signing in to EKM, or when switching from another workspace). See Adding
and Modifying Users (p. 11) for details.
You can change this setting later by editing the createUsersAutomatically setting in
the WorkspaceConfig.xml file. See Configuration Settings in WorkspaceConfig.xml (p. 42)
for details.
d. Type the path to the folder on the destination EKM server that contains the exported workspace.
e. Click OK.
When the operation is complete, the Add Workspace Completed dialog box appears.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 27
Creating and Managing Workspaces
4. Click Close. The new workspace is added to the Workspaces list in the EKM Server Administration
window and in all other workspace drop-down lists in EKM.
a. Go to each application definition in the new workspace and update the application's path to point
to the correct application executable.
b. Update the default remote file servers (Audit Logs, EKM Root Directory) to valid paths for the target
EKM server.
Note
• The original exported workspace does not remain intact during conversion, and once converted,
cannot be imported into another server to create a new workspace. Therefore, make sure that
you either back up the exported workspace or have access to the original workspace before
performing the conversion.
Important
The EKM server must be shut down before you can rename a workspace and then restarted
afterwards for the change to take effect.
1. Shut down the EKM server. Refer to the chapter on Starting and Connecting to EKM in the Installation
Guide for details.
2. Navigate to the <ekm-install>/repositories folder and then rename the workspace folder.
Example:
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
28 of ANSYS, Inc. and its subsidiaries and affiliates.
Deleting Workspaces
If the current workspace is named Analysts1 and you want to change it to Analysts2, then
rename <ekm-install>/repositories/Analysts1 to <ekm-install>/repositor-
ies/Analysts2.
3. Open the workspace.xml file in the workspace folder you just renamed and make the following changes:
a. Change the name of the workspace in the Workspace root element to the new workspace name.
Example:
<Workspace name="Analysts2">
Example:
<PersistenceManager class="org.apache.jackrabbit.core.persist-
ence.bundle.BundleDbPersistenceManager">
4. Restart the EKM server. Refer to the chapter on Starting the EKM Server and Launching the Web Client in
the Installation Guide for details.
1. Ensure all users have logged out of the workspace that you wish to delete.
2. Sign in to the EKM Administration Interface as superuser (see Signing In and Out of EKM Server Ad-
ministration (p. 19)). Select a workspace and click Delete Workspace. This opens the Delete Workspace
dialog box.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 29
Creating and Managing Workspaces
4. When the operation is complete, the Delete Workspace Completed dialog box appears. Make note of
the schema prefix which is required for deleting database tables. The schema prefix is also written to the
log file. Click Close.
1. Stop the application server in which EKM is running. If EKM is installed in a clustered installation, stop the
application server on each cluster node.
2. Delete the workspace from the database. To do this you will need to remove all the tables corresponding
to the workspace from the EKM database. Assuming the name of database is ekm and the name of the
workspace that you want to remove is Temp, then the following sequence of commands show how to
remove the tables from a MySQL database.
b. List all the tables within this database by issuing the command:
show tables;
c. Delete all the tables whose prefix matches the schema prefix for the deleted workspace. When
deleting a workspace using the EKM Server Administration interface, the schema prefix will be
displayed and written to the log file.
The following series of commands will delete the tables that begin with the schema prefix
"R2":
drop table r2_root_binval;drop table r2_root_bundle;drop table r2_root_names;drop table r2_root_refs;
drop table r2_vn_binval;drop table r2_vn_bundle;drop table r2_vn_names;drop table r2_vn_refs;
3. When you restart the application server, the workspace will no longer be listed in any drop-down list in
EKM.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
30 of ANSYS, Inc. and its subsidiaries and affiliates.
Migrating Workspaces
Refer to Restricted Configuration (p. 35) for details on how to start a restricted configuration mode and
where it is used. Note that only the user who has been designated as the Root User can perform restricted
configuration actions.
Important
Data migration is a potentially risky step that may cause data loss or corruption if it
cannot be successfully completed for any reason. Therefore it is highly recommended
that you take a complete backup of your EKM data before migrating a workspace that
is in production use.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 31
Creating and Managing Workspaces
1. Sign in to the EKM Administration Interface as superuser (see Signing In and Out of EKM Server Ad-
ministration (p. 19)). Select a workspace that is in “configuration mode” and click Migrate Workspace.
This opens the Migrate Workspace dialog box.
If the data model has changed as a result of your configuration and data loss may result for the
workspace, the dialog box indicates which changes are affected under Type Changes Involving
Removal of Metadata or Child Objects. If you click Cancel, no migration will take place. If you
click Apply, migration will take place but the workspace will remain in configuration mode. If you
click Apply & Accept, the workspace will exit from configuration mode after migration, and other
users will be able to sign in to it. When you accept changes, you can optionally add a comment
that will be used as the check-in comment for the new version of the /Administration/Con-
figuration folder.
2. When you click Apply or Apply & Accept in the Migrate Workspace dialog box, migration begins and
a Progress dialog box opens and report on the status of the migration (Figure 4.6: Progress Dialog Box
During Migration (p. 33)). Depending on the amount of objects in the repository, migration can take from
several minutes to a few hours to complete. You can also view a log of the migration as it progresses by
clicking the Show Log button or download it using Download Migration Log.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
32 of ANSYS, Inc. and its subsidiaries and affiliates.
Migrating Workspaces
Once it finishes, the Migration Completed dialog box indicates successful completion, as shown
below. You can view the log after download by selecting this option in the EKM Server Administra-
tion. The log will be overwritten each time you migrate a workspace configuration.
Note
• Workspaces migrated from EKM version 15 or earlier will have automatic account creation turned
off by default in EKM version 17.0.
• In EKM version 17, workspaces are no longer designated as “shared” or “individual”. A user’s
privileges in a workspace are determined by the Access level assigned to the user in his or her
user profile (Shared, Analyst, or Basic). For more information, see Licensing and Access in
the Installation Guide.
When migrating a repository from version 16 or earlier, users belonging to both shared
and individual workspaces in version 16 will be granted Shared access in version 17. If
you do not want certain users to have Shared access, you must change their Access
level to Analyst in their user profile. See Editing a User’s Profile (p. 14).
• When viewing the migration log, you may see the message DEBUG - Removing Property:
fullControl if you are migrating a version 16 repository to version 17. This has no implications
for the migrated workspace, and can be ignored.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 33
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
34 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 5: Restricted and Unrestricted Configuration of Workspaces
EKM provides many options for configuring a workspace on an EKM server that allows you to better
meet your business requirements and easily integrate with your IT infrastructure. Recall that an EKM
server can be “partitioned” into different workspaces that each has its own users, groups, custom types,
scripts, object lifecycles, external applications, and so on. Workspace configuration is specific to a single
workspace, which means that different workspaces in the same server can have their own configurations
and that configuration changes made in one workspace do not impact any other workspace. Furthermore,
these changes can be made dynamically without requiring the server to be shutdown or restarted. This
is in contrast to EKM server configuration, described in Configuring EKM Server Settings (p. 51), that
applies to all workspaces in an EKM server, and requires a server restart for changes to take effect.
There are two types of workspace configuration that can be performed in EKM:
• Restricted configuration (p. 35): This type of configuration requires the workspace to be locked down.
It can only be done by the user designated as the Root User. No other user can sign in to the workspace
while the configuration is being performed.
• Unrestricted configuration (p. 40): This type of configuration can be done at any time by anyone be-
longing to the admin group. It does not require that the workspace be locked down and does not
impact users of the workspace.
Restricted configuration applies only to objects on the Administration/Configuration page. These are
shown below.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 35
Restricted and Unrestricted Configuration of Workspaces
The files and folders in this location are under version control. When you begin restricted configuration,
these items are checked out, allowing you to make the necessary modifications. When you exit the
configuration mode, the folder is checked in with a new version number. Thus, all changes made in
restricted mode are kept in the version history and you can go back to a previous version of the config-
uration if desired.
The following sections describe how you can start and end the restricted configuration mode.
2. Perform custom type, lifecycle, script, unit, and/or workspace setting configuration changes according to
the instructions referenced below:
• Units: See Units: Defining and Configuring Using XML (p. 247)
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
36 of ANSYS, Inc. and its subsidiaries and affiliates.
Restricted Configuration
Note
• When you begin configuration, all other users will be logged out of the workspace, so you may
want to check the Administration/Users folder to see which users are logged in before you
begin. Logged-in users will be identified with green user icons . As a best practice, it is recom-
mended that you give advanced notice to all users of a workspace when configuration will start
and when it will end.
• If a user has the same user account in two workspaces, and is currently signed in to both of those
workspaces via a web browser (see Making Simultaneous Connections in the User’s Guide), placing
one workspace under restricted configuration will forcibly sign that user out of both workspaces,
even if the workspace that they currently have open is not the one being configured. However,
if proxy clients such as the File Transfer Client and EKM Studio are active in either workspace,
they will only be disconnected in the workspace that is being configured.
Note that this rule only applies to connections made through a web browser. It does not
apply to connections made through a client such as Workbench.
1. In the Administration section, click the Configure button and select Begin Workspace Configuration.
Note that this feature is only available if you are the designated Root User for the current workspace. You
are asked to confirm that you want to start the configuration mode.
2. Click OK to start the configuration. This makes items on the Configuration page editable, and signs
other users out of the workspace.
You can now make custom type, lifecycle, and script configuration changes to your workspace. When
you are done, choose one of following three options on the Workspace Configuration menu:
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 37
Restricted and Unrestricted Configuration of Workspaces
To apply a configuration:
1. In the Administration section, click the Configure button and select Apply Workspace Configuration.
The Apply Workspace Configuration dialog box informs you that you may be required to migrate
the workspace before you can accept it, if the data model has changed as a result of your changes.
1. In the Administration section, click the Configure button and select Revert Workspace Configuration.
You will be asked to confirm that you want to revert the configuration.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
38 of ANSYS, Inc. and its subsidiaries and affiliates.
Restricted Configuration
2. If you want to cancel the workspace configuration session after the workspace has been reverted, check
the Cancel the Workspace Configuration Session box. If this is done, the items on the Administra-
tion/Configuration page will become non-editable and other users will be allowed to sign in to the
workspace again.
3. Click OK to revert.
To accept the configuration, click the Configure button in the Administration section and select Accept
Workspace Configuration.
• If your changes have not affected the data model, the Accept Workspace Configuration dialog box looks
like this:
Click Accept to accept the configuration. You can optionally add a comment.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 39
Restricted and Unrestricted Configuration of Workspaces
• If your changes have affected the data model, the Accept Workspace Configuration dialog box looks like
this:
In this case you must migrate the workspace before it can be accepted. Follow the steps below.
3. Sign into the EKM Administration site from the EKM login screen.
4. Migrate the workspace. See Creating and Managing Workspaces (p. 19) for details.
Objects that can be configured in unrestricted configuration mode include the following:
• EKM Servers. Every EKM server contains one built-in job submission server named Master. You can
also add cache servers to enable data caching. See Adding EKM Servers (p. 134).
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
40 of ANSYS, Inc. and its subsidiaries and affiliates.
Configuring Workspace Settings
• External Applications. These are definitions for external applications that can be launched by EKM.
External applications are defined within job submission queues. See Defining External Applica-
tions (p. 139).
• Remote File Servers. These definitions enable users to connect to remote files and folders on any
server type. See Defining a New Remote File Server (p. 252).
• Shared Applications. This public folder contains the following pre-defined applications and job tem-
plates:
You can edit these applications and templates to suit your needs. See Modifying an EKM Applic-
ation in the EKM User’s Guide.
You can also create custom applications, job templates or process templates and save them in
the /Administration/Shared Applications folder to make them accessible to other users.
Refer to the following topics in the EKM User’s Guide for details:
• Shared Queries. This is a public folder where users can save the following:
– Search queries (see Saving a Search Query in the EKM User’s Guide)
• Users. Every user who will be accessing EKM must have a separate user account. See Adding and
Modifying Users (p. 11).
• Groups. Users can belong to specific groups that determine the types of actions users can perform.
See Adding and Modifying Groups (p. 16).
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 41
Restricted and Unrestricted Configuration of Workspaces
configuration mode in order for you to be able to change these settings. The general steps for config-
uring workspace settings are presented below.
3. Make configuration changes as described in Configuration Settings in WorkspaceConfig.xml (p. 42) and
in accordance with the schema definition presented in Schema Definition (p. 42).
4. If you downloaded the file to your local system and edited it, then upload the modified file to the Admin-
istration/Configuration page and overwrite it.
5. Apply (p. 38) and accept (p. 38) the configuration changes.
When you examine WorkspaceConfig.xml you will see that it consists of one root element named
workspace that contains child elements for various settings. Each setting is discussed below in Con-
figuration Settings in WorkspaceConfig.xml (p. 42).
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
42 of ANSYS, Inc. and its subsidiaries and affiliates.
Configuring Workspace Settings
Important
When specifying values for attributes in the WorkspaceConfig.xml file, avoid using
characters that are used as identifiers in XML code, such as “&”, “<” and “>”. Otherwise,
an error will be reported when you apply the workspace configuration.
For example, specifying the following value for the downloadConfirmation setting would
cause an error because the “&” character is used.
<downloadConfirmation>The files & folders on this system may be restricted.
Please review restrictions on a file before distributing externally.</downloadConfirmation>
In this case, the following error would be reported when you apply the workspace configur-
ation:
defaultExtensions Setting
The defaultExtensions setting can be used to specify the data type that will be taken as the default
for a particular extension. This is used in cases where the same extension is shared by multiple types.
A sample listing is shown below.
In many cases, EKM can automatically infer the correct type if a file extension is used by multiple file
types. Every user can also choose to specify the default type for a particular file extension in their
preferences. This setting is used in cases where users have not specified a preference for an extension,
and EKM cannot infer the type.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 43
Restricted and Unrestricted Configuration of Workspaces
mimeTable Setting
The mimeTable setting can be used to specify the MIME type for a file extension. The MIME type for
a built-in or custom type can also be specified in the typeSettings setting by using the content
Type type attribute. The mimeTable setting is used to set the MIME type of those files that are rep-
resented as generic File types in EKM. The default MIME type of a file in EKM is application/octet-
stream, which is used to represent binary files.
A sample listing for the mimeTable setting is shown below. In this example all files with an out ex-
tension will have a MIME type of text/plain.
typeSettings Setting
The typeSettings setting can be used to set or modify some settings of built-in or custom types.
The following settings can be specified for any type:
• hidden: Used primarily to hide built-in types from which you do not want to extract metadata or reports.
For example, by specifying WorkBenchSimulation as a hidden type, then whenever a Workbench
Simulation file type (.dsdb) is added to EKM, it will be treated as an ordinary file and no metadata
will be extracted from it.
• modelObjectClass: Used to specify the full name of a class that implements the back-end behavior
of a data type. This is used for customization only.
• typeAttribute: Used to specify the value of some type attributes. See Defining Custom Types (p. 69)
for a description of type attributes and acceptable names.
• disableDataExtraction: Used to disable data extraction when a file of this type is uploaded to
EKM. To disable data extraction, set its value to true.
Note
Even if data extraction is enabled globally in your Preferences, this attribute will
override it. See Specifying General Preferences in the EKM User’s Guide for details.
A sample listing for typeSettings is shown below. The name of a built-in type should be the non-
localized name as described in Appendix B (p. 267). In this example, a modelObjectClass setting is
provided for a custom type called AcmeSimulationFile. The metaDataApplication type attribute
of the FluentCase built-in data type value is set to fluentExtractionApp, which is a custom
application defined in the applications.xml file. The hidden setting of the WorkBenchSimula-
tion type is set to true. Finally, the disableDataExtraction setting is set to true for the
CfxDefinition type, indicating that data will not be extracted from .def files when they are uploaded
to EKM.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
44 of ANSYS, Inc. and its subsidiaries and affiliates.
Configuring Workspace Settings
dashboard Setting
The dashboard setting can be used to specify default gadgets for a user dashboard. This setting can
have any number of child gadget elements. Each gadget element can have the following child ele-
ments:
• path: Used to specify the path of the object that will be viewed by the gadget.
• essential: An optional element that can either be true or false. It specifies whether the gadget
is essential, in which case it cannot be deleted by a user (an 'X' icon will not appear for essential gadgets).
If this element is not specified, the gadget is treated as non-essential.
By default, all dashboards contain four gadgets: My Tasks, Job Monitor, Process Monitor, and Extraction
Monitor. All of these gadgets are non-essential.
Note
The dashboard setting in the WorkspaceConfig.xml file is applied when new user
accounts are created. Changes to the dashboard setting will not affect existing users.
preferences Setting
The preferences setting is used to establish the default selections for preferences in the Settings
dialog box. Changes made to the preferences defined in the WorkspaceConfig.xml file apply only
to new users that are created. The preferences of existing users are not affected. The default values
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 45
Restricted and Unrestricted Configuration of Workspaces
specified in the preferences setting are also the values that will be restored when a user (new or
existing) clicks the Restore Defaults button in the Settings dialog box. The default values for the
preferences setting are shown below.
• initialUrl: The location in the EKM workspace in which EKM will start.
• onSignInObject: The location that you want to be opened every time you sign in to EKM. The default
value, lastAccessedObject, opens the location that was open when you last signed out of EKM. If you
would prefer to open the same specific location every time, set the value to specificObject, then specify
the desired location in the initialUrl setting.
• locale: The language in which you want EKM to display text. Once you have logged into EKM, text will be
displayed in the language you choose. The language for the EKM login page will depend on the language
preference of your web browser. This is because EKM preferences are available only after you have logged
into EKM.
• r12Labels: Determines whether or not EKM displays ANSYS file labels using R12 terminology. The labels
of some files have changed as of ANSYS R12. For example, .dsdb files were called Workbench Simulation
files in R11 and are called Mechanical Database files in R12. Setting the value to true displays file labels
using R12 terminology, while setting the value to false displays labels using R11 terminology.
• unitSystem: The unit system in which you want EKM to display property values in drop-down lists.
– SI (the default)
– CGS
– US
– Metric
– British
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
46 of ANSYS, Inc. and its subsidiaries and affiliates.
Configuring Workspace Settings
Units will be shown only for custom properties of type Double that have been associated with a
quantity. All the other values are shown without any units. See Defining Properties for a Custom
Type (p. 74) for details on how to define a quantity with a custom property.
• disableDataExtraction: Setting this to true prevents the automatic extraction of metadata from
CAE files when such files are uploaded or imported into the EKM repository. Files will be identified in the
repository with a warning icon next to them, and hovering over this icon will display the message Ex-
tracted data is not set. You can subsequently extract metadata manually. By default this preference is set
to false to allow the automatic extraction of metadata.
• theme: The theme that is used to display the EKM interface. Themes are defined in CSS files that are included
in the EKM installation. The default value for this setting is midnightblue. If you prefer a lighter theme,
change the value to sunrise.
• typeColumnMap: Determines what columns are displayed in the file list window for an object type. The
typeColumnMapEntry element is an entry in the column map. Each entry has a typeName and
columnList attribute. The typeName attribute is the name of the object type, and the columnList
attribute determines the columns that are to appear for that type in the file list window. You can define a
typeColumnMapEntry for each object type in EKM.
The sample typeColumnMap element below contains a typeColumnMapEntry for the Model
type, which is the base type of all object types in EKM.
• recyclebinPolicy: Determines how and when items are permanently removed from the recycle bin.
Use one of the values described below.
– cleanAfterSpecifiedTime will delete objects from the recycle bin after a specified number of days.
This is the default setting.
– cleanNever will not permanently delete objects from the recycle bin unless the user initiates it.
• recyclebinCleanupInterval: The number of days after which an object will be permanently removed
from the recycle bin if the recyclebinPolicy is set to cleanAfterSpecifiedTime.
• httpProxyServer: If you use a proxy server to access a shared EKM server, this is the host name and port
(for example, www.ekmserver.com:3128) of the default proxy server that the File Transfer Client will
use to connect to EKM.
• httpProxyServerAuth: The default value for this property is false. Set to true if the proxy server
requires authentication for access.
• compressArchives: When this property is set to true (the default value), archive files (for example,
.wbpz files) are compressed before they are transferred to or from the EKM server. An archive file is a col-
lection of files and folders stored in one file. The archive file is not compressed — it uses the same amount
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 47
Restricted and Unrestricted Configuration of Workspaces
of disk space as all of the individual files and folders combined. A compressed file is a collection of files and
folders stored in one file and stored in a way that uses less disk space than the files and folders that it contains.
The choice to compress archive files will depend largely on your location. Compression is most beneficial if
you are transferring files from a remote location across a Wide Area Network (WAN). Even though time is
needed by the system to compress and decompress the archive file, the reduced file size compensates for
this and allows files to be transferred much more quickly when connection speeds are slower. On the other
hand, if you are on the same Local Area Network (LAN) as the EKM server, it is recommended that you disable
compression. To disable compression, set the compressArchives property to false.
The compression preference applies to archives (.wbpz files) that are created by EKM when you
upload Workbench projects to the EKM repository, and when folders are archived on the server for
download.
Note that compression will not be used on archives that are used primarily on the server (in other
words, archives that are not specifically destined for transfer). This includes archives created for jobs.
For more information about user preferences, see Setting Your Preferences in the User’s Guide.
downloadConfirmation Setting
The downloadConfirmation setting can be used to specify a customizable message that will be
displayed whenever a user tries to download a file or folder from EKM. This can be used if the data
contained within EKM is confidential, and for legal reasons, you want to inform the user about restrictions
on the data before it is downloaded. An example of this setting is shown below.
scheduledTasks Setting
The scheduledTasks setting can be used to schedule tasks that EKM will execute on a particular
day and time. The tasks correspond to scripts that have been uploaded to EKM. Scripts can be developed
in either Python or BeanShell languages with .py and .bsh extensions, respectively.
For each scheduledTask, the scriptPath setting specifies the path of the script file in the work-
space. You can specify the execution time for any script by providing the day, hour, and min values.
Any value can be used for day if you want the task to be executed on all days. Alternatively, you can
specify a particular day of the week such as Saturday, Sunday, and so on. The hour values range
from 0 (12 AM) to 23 (11 PM). The min (minute) value ranges from 0 to 59. If min is unspecified, it is
taken as 0. You can specify the interval of the task by providing the dayInterval and hourInterval
values. If you set both of these values to 0, the task will never be executed.
Scripts are always executed on behalf of the Root User. Therefore, any action executed by the script
will have all privileges given to the Root User.
In the following example there are four scheduled tasks defined. script1.py is executed every Saturday
at 10PM, script2.py is executed every day at 12AM, script3.py is executed every hour and
script4.py is executed after every 10 minutes.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
48 of ANSYS, Inc. and its subsidiaries and affiliates.
Configuring Workspace Settings
<scriptPath>/Data/Shared Data/scripts/script1.py</scriptPath>
<day>Saturday</day>
<hour>22</hour>
<dayInterval>7</dayInterval>
</scheduledTask>
<scheduledTask>
<scriptPath>/Data/Shared Data/scripts/script2.py</scriptPath>
<day>Any</day>
<hour>0</hour>
<dayInterval>1</dayInterval>
</scheduledTask>
<scheduledTask>
<scriptPath>/Data/Shared Data/scripts/script3.py</scriptPath>
<day>Any</day>
<hour>0</hour>
<dayInterval>0</dayInterval>
<hourInterval>1</hourInterval>
</scheduledTask>
<scheduledTask>
<scriptPath>/Data/Shared Data/scripts/script4.py</scriptPath>
<day>Any</day>
<hour>0</hour>
<dayInterval>0</dayInterval>
<minInterval>10</minInterval>
</scheduledTask>
</scheduledTasks>
createUsersAutomatically Setting
The createUsersAutomatically setting specifies whether or not user accounts will be created
automatically when users successfully sign in to the workspace for the first time.
• The Default workspace that is created during the EKM installation has automatic account creation enabled.
• If the workspace is one that has been migrated from version 15 or earlier, automatic account creation is
disabled.
• For new workspaces, automatic account creation is enabled if the Create new users automatically check
box was enabled when the workspace was created.
If the setting has a value of true, any user with valid credentials for the active login module will be
able to sign in to the workspace, and EKM will create a user account for that user automatically. For
information about configuring user logins, see Configuring Login Authentication in the Installation
Guide. If the setting has a value of false, a user will only be able to sign in to the workspace if an
administrator has created a user account for that user. See Adding and Modifying Users (p. 11) for details.
designatedRootUser Setting
The Root User is the primary administrator for an EKM workspace, and the only user who can make re-
stricted configuration changes in that workspace. By default, the Root User for a workspace is the user
specified in the <defaultRootUser> setting in the ekm.xml file (see Specifying the Default Root
User (<defaultRootUser>) (p. 53)).
If you want to specify a different Root User for a specific workspace, you must manually add a desig-
natedRootUser setting to that workspace’s WorkspaceConfig.xml file, and for its value specify
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 49
Restricted and Unrestricted Configuration of Workspaces
the EKM user name of the user you want to designate as the Root User for that workspace. This effectively
overrides the <defaultRootUser> setting.
Note
• EKM user names are case-sensitive. See How User Logins Work in the EKM Installation Guide to
see how EKM user names are defined.
• Once you have added this setting and designated a Root User for the workspace, you can apply
and/or accept the configuration change. If you choose to apply the configuration (p. 38), you
will lose your root privileges at that time. You must then sign out of the workspace and let the
new designatedRootUser sign in so that he or she can accept the workspace configuration
changes.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
50 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 6: Configuring EKM Server Settings
You can configure an EKM server by editing the ekm.xml configuration file that is included with your
server setup. The ekm.xml file contains settings that are defined according to the syntax in the ekm.xsd
schema definition file. Configuration changes apply to all workspaces, and the server must be shut
down and restarted in order for the changes to take effect.
In this chapter:
6.1. Schema Definition for an EKM Server
6.2. Specifying General Server Settings
6.3. Optional Settings
The schema definition listing shows that ekm.xml should consist of one root element named ekm that
contains child elements for various settings. These settings are discussed in Specifying General Server
Settings (p. 52) and Optional Settings (p. 66).
<xsd:complexType name="Repository">
<xsd:sequence>
<xsd:element name="name" type="xsd:string" />
<xsd:element name="context" type="xsd:string" />
<xsd:element name="providerUrl" type="xsd:string" />
<xsd:element name="location" type="xsd:string" />
<xsd:element name="configurationFile" type="xsd:string" />
<xsd:element name="retentionPolicy"
type="ekm:SystemRetentionPolicy" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="SuperUser">
<xsd:sequence>
<xsd:element name="name" type="xsd:string" />
<xsd:element name="password" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CustomRetentionPolicy">
<xsd:sequence>
<xsd:element name="objectType" type="xsd:string" />
<xsd:element name="expiration" type="xsd:int" />
</xsd:sequence>
</xsd:complexType>
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 51
Configuring EKM Server Settings
This setting is used in certain situations. For example, when the EKM server sends an automatic email
such as those generated during a process execution or lifecycle signoff, it uses the ekmUrl setting to
create HTML links to objects that are referenced in the emails. This setting is also used for the data
management process that manages a user’s server data and connects it to EKM. See The Data Manage-
ment Process (p. 130) for details. If this setting is incorrectly specified the data management process will
fail to launch.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
52 of ANSYS, Inc. and its subsidiaries and affiliates.
Specifying General Server Settings
Note
If you are changing the default workspace to another existing workspace, ensure that user
accounts exist for users in that workspace (see Adding and Modifying Users (p. 11)), or that
automatic account creation is enabled for that workspace (see Automatic Creation of User
Accounts (p. 10)). Otherwise, users will not be able to sign in to it. In this case EKM will then
attempt to sign users in to another workspace in which automatic account creation is enabled,
or in which user accounts exist for them.
You can change the default Root User by specifying the EKM user name of another user as defined by
their OS or LDAP account. This is case-sensitive. See How User Logins Work in the EKM Installation Guide
to see how EKM user names are defined.
Note
• When changing the Root User to an existing EKM user who currently has Analyst or Basic
access, that user's access level will be automatically changed to Shared in his or her profile.
• You can override the defaultRootUser setting for a specific workspace by editing the
WorkspaceConfig.xml file. For details see designatedRootUser Setting (p. 49).
Once the Root User has been changed, and the server has been restarted, the previous EKM user will
no longer be treated as the Root User, but their account will still exist.
The retentionPolicy setting specifies the global default expiration time (in days) for those objects
that are marked as perishable in EKM. It can also be used to specify the default expiration time on a
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 53
Configuring EKM Server Settings
per-type basis. Figure 6.5: Default Values for retentionPolicy Setting (p. 54) shows the default values for
this setting. You will seldom need to change this value.
In the listing, the default expiration time for any perishable object is 365 days. For objects of type File
or Folder, the expiration time is 1825 days (or 5 years). For an Audit Log, the default expiration
time is 30 days. For a Job object it is 30 days, and for a Data Extraction Monitor object it is
7 days. Jobs are not marked as perishable until they have finished executing.
When defining a module you need to specify a module name, and specify whether or not the module
is enabled by entering either a true or false value. ekmServer is the only module that is defined,
and it should be enabled.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
54 of ANSYS, Inc. and its subsidiaries and affiliates.
Specifying General Server Settings
<maxDataExtractionMemory>16</maxDataExtractionMemory>
</localProcess>
dataExtractionTimeout
Specifies the timeout value (in seconds) for the predefined set of metadata and report extraction applica-
tions. If an application takes longer than the timeout value to complete, it will be terminated by EKM. The
default value is 3600 seconds (or 1 hour).
dataExtractionThreads
The maximum number of simultaneous data extractions that can occur on the EKM server (or cluster node
in the case of a cluster setup). To prevent data extractions from occurring, set this value to 0.
maxDataExtractionMemory
The maximum amount of memory (in GBs) that can be used for data extraction. This is the cumulative
memory of all extraction threads. The value should be based on the available RAM as well as the memory
required by EKM and other processes on the server. For example, for a 64GB server, this value might be
set to 48 to keep the server functioning optimally when data extraction is taking place.
If the memory required to extract data from a file exceeds the maxDataExtractionMemory
limit, data will not be extracted from that file. For Fluent (.cas) and CFX (.def, .res) files, which
support partial data extraction, metadata may be extracted from the file but not a report or image
if there is insufficient memory. The same applies to the component files of a Workbench archive
(.wbpz) file.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 55
Configuring EKM Server Settings
<remoteType>dcv</remoteType>
</queue>
<queue>
<name>Linux Remote Viz Queue</name>
<os>linux</os>
<scheduler>lsf</scheduler>
<schedulerQueue></schedulerQueue>
<remoteType>dcv</remoteType>
</queue>
</enginframe>
-->
<workbenchServerPortRange>40000-40100</workbenchServerPortRange>
<!-- Uncomment the following to show the CycleCloud cluster monitor under the
Cluster Monitors section under Jobs page of EKM UI -->
<!--
<clusterMonitors>
<clusterMonitor>
<type>CycleCloud</type>
<param name="url" value="http://<cycle-cloud-server-name>/node_status"/>
<param name="credentialInfoFilePath" value="{$EKM_HOME}/conf/cycleCloudCredentials.json"/>
<param name="clusterName" value="kumo-hpc"/>
<param name="hostPrefix" value="ip-"/>
<param name="excludeNodeArrays" value="master,sgemaster,app,execute"/>
</clusterMonitor>
</clusterMonitors>
-->
<!--
The following solver versions correspond to the installed versions of ANSYS solvers for submitting jobs us
To add support for more versions add an extra <version> element with <value> and <labels>
For example, to add version support for 16.1, add the following inside <solverVersions>
<version>
<value>161</value>
<label>16.1</label>
</version>
The default value for the version can be specified as an attribute of the solverVersions element.
-->
<solverVersions default="170">
<version>
<value>170</value>
<label>17.0</label>
</version>
</solverVersions>
<!--
Change the value of following to point to Emag Installation Root Directory
-->
<emagInstallationDirectory>/path/to/AnsysEM</emagInstallationDirectory>
</remoteProcess>
jobSourceRootPath
The path to the directory where EKM will stage the data files for batch jobs submitted to RSM, if users do
not choose a working directory when setting up jobs. This directory is specified in the EKM job data dir-
ectory field during installation, and is resolved on the RSM Manager machine, so it must be accessible
from that machine. See The Creation and Structure of Job Directories (p. 130) for details.
In Windows:
If EKM and RSM are running on Windows and integrating with a Windows HPC cluster, this path
must be a UNC path to a shared directory (for example, \\RSMMANAGER\HPCTemp). All of the
nodes and the submit host (the machine submitting the job) should be able to access this share.
In this case, EKM will create a workspace directory under the job data directory, and username
directories will be created for each user under that directory (for example, \\RSMMAN-
AGER\HPCTemp\Default\jsmith).
In Linux:
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
56 of ANSYS, Inc. and its subsidiaries and affiliates.
Specifying General Server Settings
If EKM and RSM are running on Linux and integrating with a Linux cluster, this can be an absolute
path to a shared directory, or a path that is relative to users’ home directories. The use of home
directories (via a relative path) is strongly recommended. A user’s home directory is determined by
the RSM Manager, and the user has read/write permission on this directory and any subdirectories
that it contains. For example, specifying the value jobRoot would translate into
/path/to/user/home/jobRoot for each user.
In either Windows or Linux, if you specify an absolute path to a shared job data directory, you must
make considerations regarding access and security, as described in Access and Permission Require-
ments of the Job Data Directory (p. 131).
Important
• You must create the job data directory specified in the jobSourceRootPath setting before
job submission begins. EKM will not create it for you.
• If you are using a shared directory in either Windows or Linux, it is recommended that you
create the workspace directory up front, and ensure that all users have read/write permission
on that directory, so that username directories can be created under it. Additional steps
may also be required depending on your security requirements. For more information, see
The Creation and Structure of Job Directories (p. 130) and Access and Permission Requirements
of the Job Data Directory (p. 131).
• Advanced configurations (where EKM and RSM are running on Windows and integrating with
a Linux cluster) are not supported.
clusterVisibleDirectories
You only need to specify this setting if you are using a relative path for a Linux installation.
EKM automatically considers the path specified in the jobSourceRootPath setting to be visible,
so you do not need to specify that path in the clusterVisibleDirectories setting.
EKM assumes that it is submitting jobs to a compute cluster (either RSM-native or third-party). Use
the clusterVisibleDirectories setting to list directories that are visible to all compute
cluster nodes. This determines where the job data directory can reside, ensures that each RSM job
runs directly in its specified working directory, and prevents unnecessary file transfers to/from RSM.
In the example below, the /net/userhomes directory is a shared directory that all cluster nodes
can access. It is also the directory under which all users’ home directories are located. Specifying
this directory as a visible cluster directory means that directories such as /net/userhomes/jsmith
and /net/userhomes/mjones are also visible and valid.
<jobSourceRootPath>jobdata</jobSourceRootPath>
<clusterVisibleDirectories>
<dir>/net/userhomes</dir>
</clusterVisibleDirectories>
If EKM and RSM are integrating with a Linux cluster, you can specify an absolute or relative path.
For rules on specifying paths in Windows and Linux, see the preceding jobSourceRootPath
section.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 57
Configuring EKM Server Settings
RSM. All user jobs will be submitted to RSM as rsmWindowsDomain value\OS account name. For
example, if MYDOMAIN is specified as the value for rsmWindowsDomain, and a user’s OS account name
is jsmith, then jobs will be submitted to RSM as MYDOMAIN\jsmith.
Note
It is recommended that you use a NetBIOS domain name rather than a Fully Qualified
Domain Name (FQDN) for this setting.
jobTemplate
Use this optional setting to change the default RSM job template file used to run EKM jobs to a customized
one.
rsmLauncherURL
This setting needs to be changed if RSM is installed on a different machine than EKM, or if the default port
of the ANSYS RSM Launcher V17.0 service is changed. See Installing RSM for use with EKM (p. 116).
Example:
The ANSYS RSM Launcher V17.0 service’s configuration is modified to use port 10099 instead of
the default 10017. The Ans.Rsm.AppSettings.config file in the install_root\RSM\Con-
fig directory is edited as follows:
</appSettings>
<appSettings name="LauncherService">
<add key="LauncherXmlRpcEnabled" value="true" />
<!-- Port for Launcher XmlRpc listener. http://+:port/Launcher -->
<add key="LauncherXmlRpcPort" value="10099" />
<add key="LauncherXmlRpcSecure" value="false" />
<add key="XmlRpcMaxConcurrentRequests" value="10" />
<!-- Add additional ; separated forms of the machine name to form listener URLs.
Internally only 'localhost' and short machine name are used.
<add key="AddListenerPrefix" value="example.win.ansys.com;1.2.3.4" /> -->
<!-- Range of ports for user XmlRpc listeners. http://+:port/UserProxy -->
<add key="ProxyXmlRpcPortRange" value="50000-50100" />
<add key="ProxyTokenRegistrationTimeoutMilliseconds" value="10000" />
</appSettings>
rsmLauncherURL in ekm.xml is also modified to specify 10099 as the port in the URL:
<rsmLauncherURL>http://localhost:10099/rsm/</rsmLauncherURL>
If you are not changing the default port of the RSM XmlRpcApi server, but RSM is installed on a
different server than EKM, then you need to change only the rsmClientURL setting to use the
correct host name in place of localhost.
rsmClientTimeout
Specifies how long in seconds EKM should wait for a response from the RSM XmlRpcApi service (see
the rsmLauncherURL (p. 58) setting) before giving up and reporting an error.
This setting is optional. If included, the value must be positive. A value of 0 will cause EKM to wait
for a response indefinitely. If this setting is not included, the timeout used will be 120 seconds.
Example:
<rsmClientTimeout>90</rsmClientTimeout>
jobOutputFilename
The file name that will be used by all jobs to capture batch processing output.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
58 of ANSYS, Inc. and its subsidiaries and affiliates.
Specifying General Server Settings
dataManagementJreLocation
The full path to the Java Runtime Environment (JRE) used to run the data management process. For details
see The Data Management Process (p. 130).
<dataManagementJreLocation>%AWP_ROOT170%\EKM\programs\jre1.8.0_40</dataManagementJreLocation>
By default this path is set to the full path of the JRE (JRE Home) included under the EKM folder
under the ANSYS installation root folder. In general, you should not need to change this setting.
The AWP_ROOT170 variable in the path will be resolved on the RSM Manager machine.
Example:
Note
• You do not need to change the path format of the dataManagementJreLocation for a
Linux installation. RSM will convert the Windows path into a Linux path automatically.
dataManagementJarLocation
The full path to the executable JAR file used to run the data management process.
<dataManagementJarLocation>%AWP_ROOT170%\EKM\bin\ekm-servo-17.0.jar</dataManagementJarLocation>
By default this path is set to the full path of the ekm-servo-17.0.jar file included under the
EKM folder under the ANSYS installation root folder. In general, you should not need to change this
setting.
The AWP_ROOT170 variable in the path will be resolved on the RSM Manager machine.
Example:
Note
• You do not need to change the path format of the dataManagementJreLocation and
dataManagementJarLocation for a Linux installation. RSM will convert the Windows
path into a Linux path automatically.
enginframe
Contains EnginFrame settings and interactive queue definitions. For more detailed information see Con-
figuring EKM to Work with EnginFrame in the EKM Installation Guide.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 59
Configuring EKM Server Settings
The interactive queues defined in the ekm.xml file will be automatically created in the /Adminis-
tration/Servers/Master folder when the EKM server is started. Every interactive queue that
is created in EKM will automatically contain the predefined application remoteDesktop.app.xml,
which launches an empty remote desktop session. Once interactive queues have been created in
EKM you can define job submission settings (p. 138) for each queue, including the account names
that will be used to launch remote sessions.
workbenchServerPortRange
The reserved range of ports that the Workbench server will use for listening to command requests from
EKM. This setting is used when Workbench server jobs are started from EKM. The range is defined using a
min-max format, as shown in the example below:
<workbenchServerPortRange>51215-51220</workbenchServerPortRange>
clusterMonitors
When EKM is deployed on the Cloud, configuring CycleCloud in the ekm.xml file enables EKM users to
monitor the HPC cluster. When configured correctly, a Cluster Monitor page is available in the Jobs section
in EKM, and cluster monitor graphs are displayed on the HPC tab on that page. See Cluster Monitoring in
the EKM User’s Guide for details.
<clusterMonitors>
<clusterMonitor>
<type>CycleCloud</type>
<param name="url" value="http://<cycle-cloud-server-name>/node_status"/>
<param name="credentialInfoFilePath" value="{$EKM_HOME}/conf/cycleCloudCredentials.json"/>
<param name="clusterName" value="kumo-hpc"/>
<param name="hostPrefix" value="ip-"/>
<param name="excludeNodeArrays" value="master,sgemaster,app,execute"/>
</clusterMonitor>
</clusterMonitors>
• url: The URL of the REST API endpoint that will be queried for data
• credentialInfoFilePath: The path to the .json file where encrypted credentials will be stored
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
60 of ANSYS, Inc. and its subsidiaries and affiliates.
Specifying General Server Settings
• excludeNodeArrays: A comma-separated list of node arrays that you do not want to be included
in the Cluster Monitor
solverVersions
The solver versions specified here correspond to the installed versions of ANSYS solvers that are used when
jobs are submitted using EKM’s built-in CFX, Fluent, and MAPDL job templates.
<solverVersions default="170">
<version>
<value>170</value>
<label>17.0</label>
</version>
</solverVersions>
Solver versions specified in <version> elements will appear in the Version drop-down list in the
Start Job: Specify Execution Settings dialog box when a built-in job template is used to start a
job. The default attribute determines which version will be selected by default in this list.
To add support for more solver versions, create additional <version> elements with <value>
and <label> attributes. For example, to add support for version 16.1 solvers, you would add the
following <version> element:
<version>
<value>161</value>
<label>16.1</label>
</version>
The <value> is what EKM uses to refer to the version internally, while the <label> is what is
displayed in the Version drop-down list in the Start Job: Specify Execution Settings dialog box.
Note
• Make sure that the versions specified correspond to the actual ANSYS application versions
installed on your compute servers.
• The <solverVersions> element is intended for ANSYS products only. Non-ANSYS solvers
are not supported.
• Adding support for an older solver version may limit the availability of certain features in
EKM, should a user choose to use that older solver version during a job run. For example, live
job monitoring will not be available if a solver from release 15 or earlier is used. To provide
users with maximum functionality, we recommend that you use current and recent releases
only.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 61
Configuring EKM Server Settings
emagInstallationDirectory
If users will be using the built-in Electronics job template, use this setting to specify the installation directory
of ANSYS Electronics Desktop. The value must be a shared path or the same path on all compute nodes.
size
The maximum amount of data, in bytes, that can be cached. You can use suffixes k or K for kilobytes, m or
M or megabytes and g or G for gigabytes. For example, 20G shown in the above example denotes 20
gigabytes.
Note
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
62 of ANSYS, Inc. and its subsidiaries and affiliates.
Specifying General Server Settings
<day>Any</day>
<hour>0</hour>
<dayInterval>0</dayInterval>
<minInterval>1</minInterval>
</batchJobMonitor>
<serverMonitor>
<day>Any</day>
<hour>0</hour>
<dayInterval>0</dayInterval>
<minInterval>10</minInterval>
</serverMonitor>
<cacheMonitor>
<day>Any</day>
<hour>23</hour>
<dayInterval>1</dayInterval>
</cacheMonitor>
</scheduledTasks>
You can specify the execution time for any task by providing the day, hour, and min values. Any
value can be used for day if you want the task to be executed all days. Alternatively, you can specify
a particular day of the week such as Saturday, Sunday, and so on. The hour values range from 0
(12 AM) to 23 (11 PM). The min (minute) value ranges from 0 to 59. If min is unspecified, it is taken
as 0. You can specify the interval of the task by providing the dayInterval and hourInterval
values. If you set both of these values to 0, the task will never be executed.
dataStoreGC
Used to periodically clean files from the datastore folder that are no longer being used within EKM.
When a file is deleted from EKM it is not removed immediately but is marked for garbage collection.
The file content is actually removed as part of this scheduled task. As shown in Figure 6.11: Default
Values for scheduledTasks Setting (p. 62), this task is executed every day at 2 AM.
To ensure consistency during restore and preventing accidental deletion of files that have not
yet been committed, this task will delete only those files that are no longer in use, and whose
modification time is older than garbage collection start time minus a buffer time. The buffer
time is equal to the specified interval of dataStoreGC scheduled task plus an additional buffer
of 6 hours. For example, suppose default settings are used for dataStoreGC and a file was added
on Monday at 3PM. The next garbage collection will start on Tuesday at 2AM, but this file will
not be deleted because it is still in use. Now suppose this file is deleted on Tuesday at 10AM.
The next garbage collection will start on Wednesday at 2AM, but because the file’s modification
time is less than the buffer of 30 hours (24 hour dataStoreGC interval and 6 hour of additional
buffer), it will not be deleted even then. The file will only be deleted in the next garbage col-
lection on Thursday at 2AM. This ensures that if a complete backup was started before 10 AM
on Thursday, the file will exist in both the database backup as well as the datastore backup,
as long as the backup finishes before Thursday at 2AM.
Important
The garbage collection interval should exceed the time it takes to complete a full
backup of the datastore to avoid data inconsistency during restore. Thus if the
backup time exceeds 24 hours, the dayInterval setting should be increased from the
default value of 1.
fileBackup
Used to create a backup of all files uploaded to EKM. This is desirable if you want to periodically write
all files managed by EKM to a separate, backup folder. Because you may decide to use your own
backup policy, by default, this task is specified to never execute because the dayInterval and
hourInterval values are set to 0.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 63
Configuring EKM Server Settings
remoteSync
Used to periodically synchronize all files and folders in remote file servers. EKM allows users to create
a reference to files/folders that reside in remote servers, in lieu of uploading them. This task is used
to periodically poll the external servers and synchronize the information in EKM, to determine if any
changes have occurred in the file server.
Important
Do not schedule the remoteSync task to run at midnight. Doing so can interfere
with the creation of the daily audit logs.
recycleBinCleanup
Used to periodically purge objects from the Recycle Bin of all users in all workspaces, based on the
recycle bin cleanup policy specified in the users' preference. Objects will be deleted only if the user
has chosen to delete objects in the Recycle Bin that are older than X days, and more than X days have
elapsed because the object was placed in the Recycle Bin.
mail
Used to send an email to users that have subscribed to receive alerts for certain objects. By default,
this task runs at 8 PM every day.
purge
Used to remove objects from the repository that have expired. By default, this task runs every Saturday
at 10 PM.
batchJobMonitor
Used for monitoring the status of asynchronous batch jobs submitted to RSM. This task is run every
minute to get real time feedback.
serverMonitor
Used for monitoring the status of remote EKM servers. This task is run every 10 minutes. If a server
cannot be reached, a warning is shown in the EKM user interface, alerting the system administrator
to investigate the issue.
cacheMonitor
Used to monitor the size of the cached data. It is run every night at 11 PM. It first removes any cached
files that are no longer present in the master EKM workspace where the file came from. It then calculates
the total size of the cache and if the size exceeds the maximum limit, it removes the oldest files one
at a time until the size is below the limit. The “age” of the file is based on its last access time.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
64 of ANSYS, Inc. and its subsidiaries and affiliates.
Specifying General Server Settings
</pluginSettings>
</pluginRegistry>
pluginDirectory
Specifies the full path of the directory containing the plug-in JAR files. By default, it is set to the plugins-
deploy directory within the EKM installation directory. The loadAll setting determines whether all the
plug-in JAR files in the pluginDirectory should be loaded or not. By default, this value is set to true.
If you specify it as false, then you can explicitly list all the plug-ins you want to load by the following line.
You will seldom need to change these two values.
<plugin>PLUGIN-JAR-NAME</plugin>
pluginSettings
Used to specify plug-in-specific settings that are given as name value pairs. Currently the only available
setting is customResourcesPath for the cae plug-in. The customResourcesPath setting is used
to specify a path where script files for metadata extraction and report generation can be placed if you
want to override the default data extraction of built-in CAE types.
name
The name of the user who is the designated Superuser. This setting is optional. Only a password is required
to sign in to the EKM Administration interface.
password
Specifies the md5 hash of the superuser password. For security reasons clear text password is not stored
in the file. The default value corresponds to the password: superuser123. It is recommended that you
use the administration interface to change this default password after installation.
For information on the EKM Administration interface, see Creating and Managing Workspaces (p. 19).
type
Must be cluster.
cacheConfigFile
Specifies the location of the configuration file for the infinispan cache, which is a cluster-wide in-memory
cache.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 65
Configuring EKM Server Settings
The default path shown is a suggested location for the custom resources folder. You can either create
a folder in this location, or specify a path to a different folder on the EKM server.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
66 of ANSYS, Inc. and its subsidiaries and affiliates.
Optional Settings
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 67
Configuring EKM Server Settings
To enable this functionality, set the value of the <passwordChangeScript> setting to the path of
the password change script. The username and new password will be provided to the script in two
environment variables, username and password, respectively.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
68 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 7: Defining Custom Types
You can create and edit custom data types when the workspace is in restricted configuration mode. To
create a custom type you simply fill out fields in a dialog box, as described in Defining Custom Types
Directly in EKM (p. 72). Alternatively you can create an XML file outside of EKM and then upload it into
EKM. See Defining Custom Types Using XML (p. 94) for details.
This chapter will describe the steps required to add or modify a custom type, assuming that the restricted
configuration mode has already been started (see Restricted Configuration (p. 35)). Once you are done
with your modifications, you can accept the configuration (p. 39) to commit the changes and exit the
restricted configuration mode. At that time, EKM may ask you to migrate old data whenever it sees a
structural difference between an old type and a new one. Structural differences occur when you add
or remove a property or child from an existing type. Adding a new type or deleting a type is not con-
sidered a structural change. See Migrating Workspaces (p. 31) for more details on how to migrate
workspaces. Data migration is a time-consuming exercise that you should undertake only when necessary
on a production workspace. Therefore you should ensure that the changes are correct and agreeable
to all stakeholders before committing them to a production workspace.
Many of the examples described in this chapter can be found in the examples folder in your EKM
server: EKM_HOME/examples/conf/customTypes.
Important
By default, Google Chrome does not display XML files such as those in /Administra-
tion/Configuration/Custom Types. However, you can install an extension such as
XML Tree to enable viewing of XML. Go to https://chrome.google.com/extensions (or choose
Extensions from the Chrome menu) and search for XML. Among the search returns will be
the XML Tree extension, which has been found to work.
In this chapter:
7.1. Overview of Custom Types
7.2. Suggested Steps for Defining Custom Types
7.3. Defining Custom Types Directly in EKM
7.4. Defining Custom Types Using XML
7.5. Custom Type Examples
7.6. Extending Built-in Types
– Custom File Formats: If you have proprietary files for which EKM does not provide off-the-shelf
support for, you can easily create custom data types that support these file formats. Custom data
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 69
Defining Custom Types
types can be used to define metadata (properties) that are extracted by an application after a file is
uploaded. You can also define properties that users must input when a file is uploaded. These “user-
defined” properties can be useful for defining attributes that cannot be automatically extracted from
files but are relevant to your business process. A Project ID attribute is an example of a user-defined
attribute. A custom file format definition can also specify applications for extracting images and reports
from files. See Custom File Formats (p. 105) for more details.
– Custom Folder Structures: By default, EKM organizes data in files and folders in a way that is similar
to Windows and Linux file systems. The hierarchical structure is easy to understand. You may, however,
want to have more control over how data is organized in EKM, and you may want to be able to enforce
a standard way of naming or organizing files and folders. This can be done by creating custom folder
structures. Custom folder structures are data types that specify the name, type, and occurrence (single
or multiple) of child objects. They enable you to control how new objects can be added to a particular
type in EKM. See Custom Folder Structures (p. 102) for more details.
– Custom Analysis Project: Analysis Project is specific type of container that can be used to manage
all data that is associated with an analysis. Apart from data, it also manages inputs and outputs of
the analysis and enables it to be automatically re-executed if the project becomes out-of-date. Users
can create new instances of Analysis Project objects in EKM and provide information on where inputs
and outputs are located and how to execute the analysis. If you do not want users to manually enter
this information every time they create a project, you can define a custom Analysis Project that spe-
cifies this information in the type definition. See Custom Analysis Projects (p. 104) for more details.
• Extending a Built-In Type: Built-in types (p. 70) come with a standard list of properties that are created
by EKM (for example, Date Modified, Modified By, and so on) and metadata that are extracted automat-
ically after upload (for example, physical model data used in a simulation). However, you may also want
users to specify additional attributes at upload time that are relevant to your business requirements or
extract additional metadata. This can be done by extending a built-in type and adding more properties.
See Extending Built-in Types (p. 110) for more details.
Important
Data type labels that are displayed in the user interface or in the documentation are localized
labels (for example, Ansoft ePhysics File). The actual “non-localized” names of the types are
different (for example, AnsoftePhysics) and are described below. You MUST use non-localized
names when referring to built-in and custom type definitions.
You can think of types in EKM as being analogous to classes in an object-oriented programming language.
There is a base type named Model (also referred to by its localized name - EKM Object) and all other
types extend Model or a sub-type of Model. When a type extends another type it inherits the properties,
children, and type attributes of the parent type. Sub-types can add new properties, children, and type
attributes. They cannot, however, remove anything defined by the parent type.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
70 of ANSYS, Inc. and its subsidiaries and affiliates.
Suggested Steps for Defining Custom Types
Below are some built-in types that are commonly referenced by custom types:
Container
This is the base type for all Container types such as Folder and custom Folder.
Folder
This type refers to a Folder object.
File
This is the base type for all File types. Some file types include:
– CaeModelSummaryReport: This type is used for all Simulation Details Report types.
• CaeModelFile: This is the base type for all files that contain information about a simulation model.
– AnsysDatabase: This type is used for ANSYS Database/Mechanical APDL Database files (.db)
– AnsysResult: This type is used for ANSYS Result files (.rst, .rstp, .rth, .rmg, .rfl)
When you are ready to define a custom type, refer to one of the following methods:
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 71
Defining Custom Types
To create or modify a custom type, you must go into restricted configuration mode. Refer to Restricted
Configuration (p. 35) for details. The instructions in this chapter assume that you have done this.
You can create three kinds of custom types: an object type, a mixin, or an extension to a built-in type.
These are discussed below in Defining a New Custom Type (p. 72). If a custom type is already defined
and you want to edit it, see Editing a Custom Type (p. 94).
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
72 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Custom Types Directly in EKM
2. This dialog box contains the following tabs for specifying various settings of the custom type:
– Kind of custom type: You have 3 options to choose from: Object type, Mixin or Extension to a built-
in type. Refer to Defining Custom Types Using XML (p. 94) for more details on these options. The
other settings in the tab and the other tabs in this dialog box depend on which option you select.
– Name: This is the name of the custom type. Note that the custom type name, also referred to as
typeName, is not the same as the name of the custom type object; however, usually the object
name is typeName.type.xml. Thus if you specify the name to be Project, the name of the object
will be Project.type.xml.
– Label: The name is usually an internal ID whereas the label is how the type is represented in the user
interface. Do not use the label or name of any built-in type. If the type extends a built-in type, you
may want to append a suffix such as _c to the label to make it unique.
A label is not specified if you are creating a mixin or an extension to a built-in type.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 73
Defining Custom Types
– Extends from: This is the base class from which the type extends. This is not specified if you are de-
fining a mixin. Existing types are shown in a drop-down list. Non-localized type names are used because
some type names have a common localized name. Also, the list may not contain a new type that you
have just defined if you have not yet accepted or applied the workspace configuration. If you want
to refer to a recently-created type in your new custom type definition, then you will need to apply
the workspace configuration first, before you can define the new type.
• Properties: On this tab you specify the properties of the custom type. This tab is not available if you
are defining an extension to a built-in type. See Defining Properties for a Custom Type (p. 74) below
for details. Note that if you want to extend an existing type by adding properties to it, you will need to
first define a mixin that specifies the properties, and then add the mixin to your extended type definition.
• Children: On this tab you specify any children of the type. This tab is not available if you are defining
an extension to a built-in type. See Defining Children for a Custom Type (p. 76) below for details.
• Mixins: On this tab you specify any mixins of the type. A mixin can be used to create sharable groups
of children and properties that can be included in more than one type (new data types and extensions
to built-in types). This tab is not available if you are defining a mixin. See Defining Mixins for a Custom
Type (p. 77) below for details.
• Type Attributes: On this tab you specify any type attributes of the type. This tab is not available if you
are defining a mixin or an extension to a built-in type. See Defining Type Attributes for a Custom
Type (p. 78) below for details.
• Script: On this tab you can define macros that you can reference when defining type attributes, actions
and views for a custom type. See Defining Scripts for a Custom Type (p. 87) for details.
• Actions: On this tab you specify any actions for the type. This tab is not available if you are defining a
mixin. See Creating Actions for a Custom Type (p. 88) below for details.
• Views: On this tab you can define custom views for the type. These will appear as additional tabs in
the view window when viewing an object of this type. See Creating Custom Views for a Type (p. 92)
for details.
3. When you have specified all the settings, you can click Create & New to create the new type and open
the same dialog box again for creating an additional type. If you do not want to create any additional
types, you can click Create & Close to create the type and dismiss the dialog box.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
74 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Custom Types Directly in EKM
You can click Add to add a new property. You can then specify the settings for each property in the
Property definition pane. The settings will depend on the type of the property, but will include the
following:
• Name: This is the name of the property. When a new property is added it has a default name, such as
prop0. You can change the name and click the Rename button to specify a different name.
• Label: This is how the property will be represented in the user interface.
• Type: Choose the property type: String, Integer (referred to as “Long” in XML), Real Number (referred
to as “Double” in XML), Boolean, Date or Reference.
• Multi-line value: For String properties, enables you to specify two or more lines of text as the value
of the string.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 75
Defining Custom Types
• Default: You can specify a default value for the property. The value should be compatible with the
type, and whether or not it is multi-valued. Refer to Defining Properties Using XML (p. 95) for more
details on how to provide correct values for various property types.
• Options: If the user can only select the value of the property from a limited set of options, you can
specify the options separated by comma.
• Display order: This value is set when you want the property to appear in a particular order in the
Properties display or in a dialog box when user input is required. Dialog boxes include: Edit Properties,
Edit Type, New Folder, and New Object. This value can be any valid integer. Properties with lower
order are displayed first. If unspecified, the default value is 0, which will display the property alphabet-
ically by name.
• Extracted: If this check box is selected it means that the property value is automatically extracted.
Otherwise it is specified by the user.
• Required: If this check box is selected it means that the user is required to enter the value of this
property.
• Multivalued: If this check box is selected it means that the property is multi-valued or a list.
• Base type: This setting is available if the property type is Reference and is used to specify the base type
of the object reference. You may need to apply the workspace configuration in order to see a recently
created custom type in this list.
• Minimum and Maximum: These settings are available if the property type is Integer or Real Number.
• Quantity and Unit: These settings are available if the property type is Real Number and are used to
specify the unit information. Refer to Defining Properties Using XML (p. 95) for more details.
You can also click an existing property in the Properties column to either change its settings or remove
it by clicking Remove.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
76 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Custom Types Directly in EKM
You can add a new child by clicking the Add Child button. This will add a new row to the children
table. For each child you can specify the following:
• Name: This is the name of the child. It can be empty if the child is a list.
• Type: This is the type of the child. You may need to apply the workspace configuration in order to see
a recently created custom type in the drop-down list.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 77
Defining Custom Types
You can add a new mixin by clicking Add Mixin. This will add a new row to the Mixin table. You can
select the particular mixin that you want to add to the custom type from the drop-down list. You may
need to apply the workspace configuration to see a recently-created mixin in this list. You can remove
an existing mixin by clicking the Remove button in the row.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
78 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Custom Types Directly in EKM
The Type Attributes that are shown in the dialog box depend on the base type from which the custom
type extends. The list of type attributes shown in Figure 7.5: Custom Type - Type Attributes (p. 79) are
the default settings for a new object type that extends from CaeModelFile. Settings are described
below.
icon
This attribute can be used to specify the path of the icon file associated with this file type. You can place
icon files in the resources folder (typically EKM_HOME/conf/resources) and specify the value of this
type attribute as /custom/<path of icon file in resources folder>.
To specify icons for a parent menu that is not associated with any action, you can add a new action
and just provide an icon without supplying a macro.
propertyUpdateMacro
This attribute can be used to specify a macro that will enable dependencies to be created across properties,
so that if one property is changed, other properties that depend on it will change as well. The macro that
you specify must be defined in the Script entry box on the Actions tab. See Example: Specifying a Macro
that Creates Dependencies Across Properties (p. 88) for an example.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 79
Defining Custom Types
• the property options are changed for drop-down lists or list boxes
The property dependencies will be visible in the following dialog boxes in EKM:
• Upload
• New Folder
The macro that you define on the Script tab should have two arguments. The first argument is of
type ModelObjectInterface and for the Edit Properties dialog box, it is the object whose
properties are being changed. For the Upload and New Folder dialog boxes, it represents the
parent folder where the object will be added or uploaded. The second argument is a map of the
Property object. An overview of the methods contained in the Property object is provided
below. For more details, refer to the scripting interface API.
If you need to modify variable values using an action macro, you can either have the macro return
a map containing the name of the property and its updated value, or directly set values using
the setValue method in the macro.
• getOptions: Returns the list of options for properties shown in a drop-down list or list box.
• setOptions: Sets the options for properties shown in a drop-down list or list box. The specified options
must be a subset of options specified in the type definition for that property.
extractImageOnUpload
This attribute can either be true or false and specifies whether an image of the CAE model should be
extracted after upload. Images are not extracted from all simulation files.
imageName
This attribute can be used to specify the format of the image file that is extracted when an image extraction
application is specified. For example, to extract an image in CAX format, you would specify file.cax as
the value of this attribute. Note that a suitable extractor must be specified for the imageApplication
attribute.
Note that 3D images are automatically extracted from several built-in CAE file types by default. For
certain Fluent, CFX and Mechanical APDL file types, 3D images are extracted and displayed in an
interactive 3D viewer on the Image tab when viewing the CAE file in EKM. Specifying values for the
imageName and imageApplication attributes will override this default. For more information
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
80 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Custom Types Directly in EKM
about the default image extraction, see Automatic Extraction of Images on Upload in the EKM User’s
Guide.
disableDataExtraction
This attribute can either be true or false. It is used to specify whether or not data is extracted from a
file of this type when it is uploaded to EKM, and whether or not data can be manually extracted from it
after it has been uploaded.
Note
If you are enabling data extraction for a type, you must also make sure that the global
Disable data extraction setting is disabled in your Preferences. See Specifying General
Preferences in the EKM User’s Guide for details.
contentType
This attribute can be used to specify the MIME type of the file.
initializeMacro
This attribute can be used to specify a macro that will executed after the object is created. The macro that
you specify should have one argument of type ModelObjectInterface that represents the newly-
created object and must be defined on the Script tab. See Example: Executing a Macro When an Object
Is Created (p. 88) for an example.
imageApplication
This attribute is used to specify the application used for extracting an image from a file after upload. Images
can be extracted in any web-compatible format such as GIF, JPEG, PNG, TIFF, as well as VCollab’s CAX
format for 3D visualization. The application should take the name of the file as a command line parameter
and generate the image file in the current working directory. The input file will also be available in the
current working directory.
For example, if the imageName attribute is set to file.cax, you could specify extractCaxImage
as the value of the imageApplication attribute to use the built-in CAX extractor application,
extractCaxImage.app.xml, to extract CAX files. For more information about configuring EKM
to use VCollab, see Using VCollab for 3D Visualization in EKM (p. 255).
extension
This attribute can be used to specify the file extension for the format. EKM uses the extension to identify
the appropriate type for a file. If your file format can have multiple extensions then you can specify them
in a comma-delimited string.
extendBuiltInExtraction
This attribute can be used to specify whether the metadata or report extractors that are specified will extend
or replace any built-in extractors. When the value is set to true (default), the additional extractors that
you specify for metadata extraction in the metaDataApplication setting and simulation details report
extraction in customReportApp setting will extend the built-in extractors so that custom extraction
occurs after the built-in extraction. When the value is false, the additional extractors will replace the
built-in extractors so that built-in extraction does not occur at all. This attribute will be available only if
you are defining a new object type. If you are defining an extension to a built-in type, then you will need
to set this attribute in the WorkspaceConfig.xml file.
metaDataApplication
This attribute can be used to specify an application for extracting metadata from a file after upload. The
value for this type attribute should be a key for the application defined in the application.xml file.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 81
Defining Custom Types
See Extracting Metadata from Custom File Formats (p. 107) for details. If this value is empty, the built-in
extractor will be utilized if defined for that type.
typeValidatorClass
This attribute can be used to specify a Java class used for determining a file’s type. This is used for auto-
matic type assignments during uploads.
showContentViewAsDefault
If set to true, the content view of the CAE file will be the default view in the interface.
allowJobExecution
If set to true, an Execute menu will be available for the CAE file, enabling users to execute batch and in-
teractive jobs directly from the file.
reportApplication
This attribute can be used to specify an application for extracting a Simulation Details Report from a file
after upload or on-demand. See Extracting Reports from Custom File Formats (p. 108) for information on
how to build an application for extracting the report.
customStatusFlagsMacro
Use this attribute to specify the name of a macro that will display custom status flags and icons when an
object of this type is displayed or queried in the list view.
In Python, the macro should use def testStatus(model):, as shown in the example below:
def testStatus(model):
statuses = [["testStatus", "/custom/testStatusFlag/status.gif"]]
return statuses
The status flag is a list with two values: a key and an icon. In the example above, if the key test-
Status is defined in the custom.properties file, a localized tooltip will be displayed. Otherwise,
the key will appear as the tooltip.
In BeanShell, the macro should use List testStatus(model), as shown in the example below:
import java.util.List;
import java.util.ArrayList;
List testStatus(model) {
List statuses = new ArrayList();
List status = new ArrayList();
status.add("testStatus");
status.add("/custom/testStatusFlag/status.gif");
statuses.add(status);
return statuses;
}
Example: Specifying a Custom Metadata and Report Extractor for a Built-in Type
The following sample XML code is used to define a custom report extractor (customReportApp) and
a custom metadata extractor (customMetaApp) for new type that is an extension to the built-in
FluentCase type. While the workspace is in restricted configuration mode, edit the content of the
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
82 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Custom Types Directly in EKM
Then, apply and accept the workspace configuration. The applications need to be defined as External
Applications under EKM Server (for example, /Administration/Servers/Master/EKM
Server). Refer to Extracting Metadata from Custom File Formats (p. 107) for more information on de-
fining applications for the metadata extraction.
Example: Specifying a Metadata and Report Extractor for a New Object Type
The following example defines a custom extractor for metadata and report generation for a new custom
object type of type “NCT” that extends CAEModelFile. The file listings for the extractor Python files,
external application XML files, custom object type, and custom mixin type are shown below.
1. Using a text editor, create the external applications that are needed by copying and pasting the contents
of the external application files customMetaApp.app.xml and customReportApp.app.xml listed
below into an empty file and saving the files with the names and extensions as noted.
2. Using a text editor, create the custom object type and custom mixin type files that are needed by copying
and pasting the contents of the NewCustomType.type and mix1.type listed below into an empty
file and saving the files with the names and extensions as noted. You can also create these files using the
New > Custom Type action. To do this, you will have to refer to the settings in the XML files and specify
the corresponding settings in the Edit Custom Type dialog box.
3. Edit the external application files and enter the correct path to your Python executable in <execPath>.
Also, enter the path to the directory where the Python files (extract-additional-metadata.py
and extract-additional-report.py listed below) are stored on your local drive in <param>.
Example:
<execPath>C:\Python25\python.exe</execPath>
<param>C:\EKM\extract-additional-metadata.py</param>
4. While the workspace is in restricted configuration mode, upload the external application files to the /Ad-
ministration/Servers/Master/EKM Server folder.
6. Apply and Accept Workspace Configuration. You may have to migrate your workspace if there are data
model conflicts that need to be resolved. To do this, sign out of EKM and sign into the EKM Administration
site. Once migration is complete, sign back into EKM and Apply/Accept the Workspace Configuration.
7. Upload any Fluent case file. Change the type to NCT using Edit > Type.
8. Display the simulation details report and view the custom report additions by clicking on the Fluent case
file.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 83
Defining Custom Types
9. Display the added custom metadata for the report by clicking the Details tab.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
84 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Custom Types Directly in EKM
s = """
<ekmReport:section xmlns:ekmReport="http://www.ansys.com/ekm/report" name="Custom report">
<table name="Project Information">
<column name="condition"/>
<column name="value"/>
<row><value>Client</value><value>abc</value></row>
<row><value>Company Name</value><value>ANSYS</value></row>
<row><value>Company Location</value><value>Globally</value></row>
<row><value>Contact Person</value><value>Dana</value></row>
<row><value>Contact Address</value><value>[email protected]</value></row>
</table>
<table name="Solution Information">
<column name="condition"/>
<column name="value"/>
<row><value>Solver</value><value>Mechanical APDL</value></row>
<row><value>iterations</value><value>1500</value></row>
<row><value>version</value><value>17.0</value></row>
<row><value>tolerance</value><value>0.02</value></row>
<row><value>physicalModels</value><value>Stress, Magnetostatic</value></row>
</table>
</ekmReport:section>
"""
f.write(s)
f.close()
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 85
Defining Custom Types
import os
scriptPath = os.getenv('PYTHON_EXEC_PATH')
f = open('ekm-meta-data.xml', 'w')
s = """<ekmMetaData:meta-data xmlns:ekmMetaData="http://www.ansys.com/ekm/metaData">
<data name="p1" value="%s"/>
<data name="p2" value="101"/>
<data name="fluentVersion" value="6.4.17"/>
</ekmMetaData:meta-data>
""" % scriptPath
f.write(s)
f.close()
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
86 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Custom Types Directly in EKM
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 87
Defining Custom Types
1. On the Script tab of the Custom Type dialog box, select the Script Language that you want to use for
the script that will be associated with the action, view, or type attribute.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
88 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Custom Types Directly in EKM
Prior to defining an action you will need to specify a script (p. 87) on the Script tab that contains the
macro to be executed when the action is performed. You will reference the macro name when defining
the action.
1. On the Actions tab of the Custom Type dialog box, click the Add Action button. A new row will be added
for each new action that you add.
2. For each action in the table, specify the Name, Macro, Permissions, and (optional) Icon, in accordance
with the settings described in Defining Actions Using XML (p. 99). For menu groups, you may add a row
containing just the Name and Icon of the group. There is no Macro associated with a menu group.
3. To display an action when multiple objects of this type are selected, enable the Show on multi-selection
check box for that action. Otherwise, the action will only be displayed when a single object is selected.
If you enable this option, make sure that the corresponding macro script handles single and multiple
objects, as shown in the following sample script:
# Example macros for custom actions
# 'Show on multi-selection' disabled, custom action menu will be displayed for a single object selection only.
def appendDescription(object, dialog):
import time
description = object.getProperty("description")
ekm.startTransaction()
time = time.asctime(time.localtime(time.time()))
object.setProperty("description", description+", added at: "+time)
ekm.commitTransaction()
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 89
Defining Custom Types
# 'Show on multi-selection' enabled, custom action will be displayed when multiple objects of the same type ar
# Custom action menu will also be displayed for a single object selection.
def setDescription(objects, dialog):
import time
ekm.startTransaction()
time = time.asctime(time.localtime(time.time()))
try:
# pythonic approach is to assume an iterable, then fail gracefully if it does not work on the given o
# Duck-typing avoids tests using type() or isinstance()
# iterate assuming list for multiple objects
for object in objects :
description = object.getProperty("description")
object.setProperty("description", description+", added at: "+time + " on multiple objects")
except TypeError:
# not a list of objects, then it must be a single object
object = objects
description = object.getProperty("description")
object.setProperty("description", description+", added at: "+time + " on single object")
ekm.commitTransaction()
1. Create two sample image files containing icons and name them tips.gif and ansysIconSmall.gif.
2. Create an icons folder in EKM_HOME/resources/ if it does not exist. Copy the image files to this folder.
4. Upload the Project.type.xml file that is provided in the examples folder in EKM_HOME/ex-
amples/conf/customTypes to the Administration/Configuration/Custom Types folder
in the EKM repository.
5. Edit the custom type by selecting the custom type file (Project.type.xml), right-clicking, and selecting
Edit > Custom Type.
6. In the Edit Custom Type dialog box, select the Actions tab.
8. In the Icon column, enter /custom/icons/tips.gif for the first row and /custom/icons/an-
sysIconSmall.gif for the second row.
9. Click OK.
11. In the repository, create a new custom folder of type Project and give it a name.
12. Right-click the new custom folder that was added and verify that a new menu item named Custom Actions
appears at the bottom of the context menu. When you right-click the menu item, verify that two submenu
items named Append Description and Set Description are listed, along with their corresponding icons
(tips.gif and ansysIconSmall.gif, respectively).
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
90 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Custom Types Directly in EKM
Verify that the actions are also available in the Action toolbar.
1. Shut down the EKM server. Refer to the chapter on Starting and Connecting to EKM in the Installation
Guide for details.
2. On the EKM server, go to EKM_HOME/bundles and open the folder that corresponds to the chosen
locale (de = German, en = English, fr = French, ja = Japanese). Open the custom.properties file
in a text editor. If such a file does not exist, create a text file named custom with the extension proper-
ties.
actionName.menu=localized text
where actionName is the name of the action in the custom type definition (without spaces), and
localized text is the desired action label text.
For example, if you defined a custom type with an action named Set Description, and wanted it
to appear in German when the German locale is selected, you would enter the following in the
EKM_HOME/bundles/de/custom.properties file:
SetDescription.menu=Beschreibung Definieren
4. Save the custom.properties file, and then restart the EKM server.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 91
Defining Custom Types
The available built-in actions will vary depending on the object type:
• For containers and folders: Delete, Edit, New, Download, Upload, More
Views can contain object properties, images, links to other EKM objects, or other components.
• The name of the XHTML file that defines the content of the custom view
• The variables used to initialize input and output interface components, and store inputs specified by the
user in the input components
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
92 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Custom Types Directly in EKM
Variables can be accessed by the macro to retrieve user inputs and act upon them.
For an example of how a macro is defined, see Example: Creating a Custom Interface for Fluent Batch
Jobs (p. 207).
1. In the Custom Type dialog box, select the Views tab, then click Add View. A new row will be added for
each new view that you add.
2. Specify a Name for the view. When you open an object of this type, this will be the label displayed on the
view’s tab.
3. Specify the name of the Init Macro that you defined on the Script tab which references the XHTML file.
4. If you want a custom view to be the default view when an object of this type is opened, enable the Default
radio button in that view’s row.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 93
Defining Custom Types
To edit a custom type, right-click it and select Edit > Custom Type from the context menu. The Edit
Custom Type dialog box that opens is essentially the same as the New Custom Type dialog box, except
that you can modify only a single type at a time. For this reason, the Edit Custom Type dialog box
contains the OK button instead of Create & Close and Create & New buttons.
See Defining a New Custom Type (p. 72) for details on how to edit the properties (p. 74), children (p. 76),
mixins (p. 77), type attributes (p. 78), script (p. 87), actions (p. 88) or views (p. 92) of a custom type.
The following are some key points to remember while defining custom types in XML:
• The XML file should conform to the schema definition as described in Schema Definition for Custom
Types (p. 94).
• The name of the XML file must end with the extension: .type.xml.
• The name of the XML file should start with the type name. This is not a strict requirement but a good
practice to follow. For example, the name of the XML file for a custom Project type should be Pro-
ject.type.xml.
• When the XML definition is ready, you can upload it to the /Administration/Configuration/Cus-
tom Types folder. The upload wizard will automatically recognize the file to be of type EKM Type
based on its file extension.
• If you want to edit an existing type in XML, you can first download the desired file, make the changes
using an XML editor, upload it back to EKM and overwrite the existing file. Alternatively, if the changes
are minor and you are comfortable with the XML syntax, you can use the Edit > Content action menu
for the selected type to make the changes directly to the file in EKM.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
94 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Custom Types Using XML
<xsd:simpleType name="Version">
<xsd:restriction base="xsd:string">
<xsd:pattern value="[0-9]+(\.[0-9]+)*"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="Constraint">
<xsd:attribute name="name" type="xsd:string" use="required" />
<xsd:attribute name="value" type="xsd:string" use="required" />
</xsd:complexType>
<xsd:complexType name="Property">
<xsd:sequence>
<xsd:element name="defaultValue" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="enumeration" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="constraint" type="ekmTypes:Constraint" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
<xsd:attribute name="type" use="required">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="Boolean" />
<xsd:enumeration value="Date" />
<xsd:enumeration value="Double" />
<xsd:enumeration value="Long" />
<xsd:enumeration value="String" />
<xsd:enumeration value="Reference" />
</xsd:restriction>
</xsd:simpleType>
The file indicates that a custom type file consists of a root element called types that can have one
child element that can be a type, mixin or extension.
type
This element is used to define a new data type.
extension
This element is used to extend a built-in type.
mixin
This element is used to create sharable groups of children and properties that can be included in
more than one type or extension element. A mixin can have properties or child types as
sub-elements. Child types are used for enforcing an object hierarchy. An extension can have
mixins as sub-elements. A type can have properties, child types, mixins or type attrib-
utes as sub-elements. Type attributes are used to specify type-specific attributes such as ap-
plications for extracting metadata or reports. These are primarily used for defining custom file formats.
You must specify a version attribute for types and mixins. By convention, a version in EKM consists
of three revision numbers: X.Y.Z where X Y and Z are integers that represent the major revision, minor
revision, and patch revision of the type, respectively. All versions start with 1.0.0. You are free to
choose a different version convention that can consist of greater or fewer revision numbers.
Property definitions are used to define the metadata that are associated with a custom type. To define
a property, you need to specify the name and type of the property. Property names cannot contain
the following special characters: / \ : [ ] % * ' " |
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 95
Defining Custom Types
You can also assign a label to a property. The label can contain any character and is used to display
the property in the user interface. The type of the property must be defined as one of the following:
Boolean, Date, Double, Long, Reference or String. The Boolean type is used for properties
whose value can be either true or false. Date is used for dates. Double is used for real numbers
and Long for integers. Reference can be used for properties whose values reference another object
in EKM. For example, a simulation file can have a reference property called geomFile that is a reference
to a geometry file used in a simulation. String can be used to define strings.
• specifiedBy: The valid values are user and extractor. If extractor is specified, then the value
for this property will be automatically extracted using a metadata extractor application. If user is
specified, then the value for this property will be manually entered by the user. If this attribute is not
given, its value is assumed to be user. Only properties whose specifiedBy attribute is set to user
can be modified by a user in the Edit Properties dialog box in the EKM user interface.
• required: The valid values for this attribute are true or false. This attribute is used only when the
value for the specifiedBy attribute is set to user. If the value is true then the user will be
prompted to enter a value for this property whenever an object of the type containing this property is
created. For example, if you define metadata for a new file format with the specifiedBy attribute
set to user and the required attribute set to true, then whenever a file of that format is uploaded,
users will be asked to enter values for all the user-defined properties. If the value is false, then users
will not be prompted to enter values when the object is created or the file is uploaded. However, values
can still be modified in the user interface using the Edit Properties dialog box. If this attribute is not
specified, its value is assumed to be false.
• multivalued: The valid values for this attribute are true or false. If the value is true, then the
value for the property can be a list of values instead of a single value. If this attribute is not specified,
its value is assumed to be false.
Note
If a single date is input with an internal comma, an error is generated. This is an ex-
ample of a date format that is incorrect for a multi-valued field:
Feb. 12, 2013 11:08
displayOrder: This value is set when you want the property to appear in a particular order
in the Properties display or in a dialog box when user input is required. Dialog boxes include:
Edit Properties, Edit Type, New Folder, and New Object. This value can be any valid integer.
Properties with lower order are displayed first. If unspecified, the default value is 0, which will
display the property alphabetically by name.
• defaultValue: This element is used for specifying the default value for the property. For multi-valued
properties you can specify more than one default value. If you specify a default value you will need to ensure
that the value is correctly specified for the property type.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
96 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Custom Types Using XML
– Boolean types can only have true or false as valid values. If unspecified, the default value is false.
– Date types must have default values in either ISO-8601 format or a format that depends on the locale
of the EKM server.
→ For ISO-8601, the format is: YYYY-MM-DDThh:mm:ss.sTZD, where hh is two hour digits (00 through
23) and TZD is the time zone designator (Z or +hh:mm or -hh:mm)
→ For the English locale, the format is: month/day/year hour:min AM/PM
You can also use scientific notation such as 1.235E6 or 1.235E-6. If unspecified, the default
value is 0.0.
Note
Double type is referred to as “Real Number” in the Custom Type dialog in EKM.
– Long types can contain only numbers such as 0, 5, -5 and so on as values. If unspecified the default
value is 0.
Note
– Reference types contain the full path to an existing object in EKM as a default value.
If unspecified, the default value is an empty string “”, which denotes a null reference.
– String can have any arbitrary text as the value. If unspecified, the default value is an empty string “”.
• enumeration: Sometimes you may want users to choose a property value from a list of options. These
options can be specified as an enumeration (that is, an enumerated list) for the property. You can specify
an enumeration for any property type (Double, Integer, String, and so on) except Boolean. While
specifying enumerations, follow the value syntax for the various property types that were described above.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 97
Defining Custom Types
• constraint: This element can be used to put constraints on property values. Constraints are validated
when a user provides property values, and a validation error message is generated if a constraint is violated.
A constraint element has a name and a value attribute. The constraint name must be one of the following:
– min: Used for specifying the minimum value for a Double or Long type. The value for this constraint
denotes the minimum value for the property.
– max: Used for specifying the maximum value for a Double or Long type. The value for this constraint
denotes the maximum value for the property.
– quantity: Used for specifying the unit quantity for a Double type. The value for this constraint
denotes one of the quantities specified in the /Administration/Configuration/Units.xml
file (for example, length, volume, and so on) See Units: Defining and Configuring Using XML (p. 247)
for more details on specifying units.
– unit: Used for specifying the unit for a Double type. The value for this constraint denotes one of
the units specified in the /Administration/Configuration/Units.xml file for the quantity
specified above. This constraint should only be used if the quantity constraint has been used. For ex-
ample, if the quantity is length, acceptable unit values are: m, cm, ft, and so on If a quantity is
specified but a unit is not specified, then the chosen unit for this property will be the default unit of the
users' preferred unit system. For example, if the users' preferred unit system is SI, the unit will be m, and
if it is British it will be ft. Thus you should specify the unit constraint only if you want to force the
property to always be viewed in the specified unit for all users. See Units: Defining and Configuring Using
XML (p. 247) for more details on specifying units.
– baseType: Used for specifying the base type for a Reference type. The value for this constraint
denotes the base type of the referenced object. For example, you can use this constraint to ensure that
a reference always points to an object of type File.
– rows. Can be used to accept multi-line values for a String type. If the specified number of rows is
greater than 1, a text area with the specified number of rows is rendered rather than a single-line text
box. For example, specifying a value of 5 permits the input of 5 lines of text in a text box.
Example 7.1: version Property (p. 98) defines a property named version of type String. Because
the specifiedBy value is extractor, this property will be extracted from the file by the metadata
extraction application. Because a label is specified, the property will appear in the user interface as
Version.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
98 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Custom Types Using XML
Example 7.2: dimension Property (p. 99) defines a property named dimension of type Double. Because
the specifiedBy attribute is not specified, it is assumed that the value will be specified by the user.
Because the required attribute is set to true, users will be prompted to enter the value for this
property when they create the object or upload a file containing this property. A default value of 15.0
is also specified. This property also has min and max constraints specified. This means that the value
for this property should be between the specified range of 10.0 and 20.0.
Example 7.3: revisionStatus Property (p. 99) defines a property named revisionStatus of type
String that will appear in the user interface as Revision Status. It is a required property that will be
specified by users. This property also has enumerations specified, so users can select only one of
these values: Draft, Released or Obsolete. This property will appear in dialog boxes as a select
menu (or drop-down list).
Example 7.4: physicalModels Property (p. 99) defines a property named physicalModels of type
String that will appear in the user interface as Physical Models. The property value will be automat-
ically extracted. Because the multivalued attribute is set to true, the property can accept more
than one value. Enumerations are specified, and the values must be equal to one of the enumerations.
Example 7.5: inputFile Property (p. 99) defines a property named inputFile of type Reference. It
is a required property that will be specified by the users. Because the baseType constraint is
specified, the referenced object should be of the same type (or a subtype) of CaeModelFile.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 99
Defining Custom Types
The listing in Example 7.6: Custom Actions (p. 100) shows a type definition that also defines some custom
actions. The XML code related to the action definition is contained within <actions> and </actions>.
This example shows how two action menus Append Description and Set Description are added to
the Project custom type. These action menus are added to a new and common parent menu called
Custom Actions. So, in addition to the other built-in action menus (such as Delete, Edit, Help, and
so on) you will now see another menu called Custom Actions that will contain two submenus: Append
Description and Set Description. When the Append Description menu is clicked, it does not open a
dialog box but simply appends the current time stamp to the Project’s description. When the Set De-
scription menu is clicked, it opens a dialog box that displays the current description, and enables you
to enter a new description. The description entered is then applied to the Project when the dialog box
is submitted. The user interface files for the dialog box are stored in a folder named set-project-descrip-
tion within the resources folder (which is typically EKM_HOME/conf/resources unless its location
has been changed in the ekm.xml file).
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
100 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Custom Types Using XML
description, false);
}
# 'Show on multi-selection' enabled, custom action will be displayed when multiple objects of the same type are se
# Custom action menu will also be displayed for a single object selection.
def setDescriptionOnObjects(object, dialog) {
import time
ekm.startTransaction()
time = time.asctime(time.localtime(time.time()))
try:
# pythonic approach is to assume an iterable, then fail gracefully if it does not work on the given ob
# Duck-typing avoids tests using type() or isinstance()
# iterate assuming list for multiple objects
for object in objects :
description = object.getProperty("description")
object.setProperty("description", description+", added at: "+time + " on multiple objects")
except TypeError:
# not a list of objects, then it must be a single object
object = objects
description = object.getProperty("description")
object.setProperty("description", description+", added at: "+time + " on single object")
ekm.commitTransaction()
}
</script>
<action name="Custom Actions/Append Description" icon="/custom/icons/tips.gif"
macro="appendDescription" permissions="modify" />
<action name="Custom Actions/Set Description" icon="/custom/icons/ansysIconSmall.gif"
macro="setDescriptionDialog" permissions="modify" />
<action name="Custom Actions/Set Description On Objects" icon="/custom/icons/ansysIconSmall.gif"
macro="setDescriptionOnObjects " permissions="modify" multiSelectEnabled="true" />
</actions></type>
As shown in the code in Example 7.6: Custom Actions (p. 100), all actions related to a type must be
defined within the actions element. This element contains a script element and any number of
action elements. The script element is used to define macros that are associated with the action.
See the chapter on Defining Macros and Custom Dialog Boxes in the EKM User's Guide for details on
scripting and macro definition. The action element defines each action associated with the type and
has the following attributes:
• name: Specifies the name of the action menu and any parent menus. The parent menus are separated by
a slash /. Parent menus will be created if they do not already exist. The name of the parent menu can also
be an existing menu (such as Edit) and in this case, the new menu will be added to the existing parent menu.
You can specify the name of the parent menu only in a single language. This means that if you have users
in multiple locales, it will be better to place the custom actions in a new parent menu, rather than an existing
one.
• macro: Specifies the name of the macro that will be called when the menu is clicked. See the chapter on
Defining Macros and Custom Dialog Boxes in the EKM User's Guide for details on macro definition and the
EKM scripting interface. Typically, the macro will be defined in the script element before the action
definition, but you can also define it in the common library of macros that are loaded by EKM at startup.
The macro must take the following two arguments:
– an instance of ModelObjectInterface that specifies the object on which the action will be performed
– an instance of DialogInterface that specifies the dialog box that will be opened. If the action does
not require a dialog box to be opened, then you can ignore this argument in the macro body. The macro
named appendDescription in the above listing is an example of this type of macro. If the action re-
quires a dialog box to be displayed, the macro body should define the steps that are part of the dialog
box, using the addStep() method of the DialogInterface. The macro named setDescription-
Dialog in the listing is an example of this type of macro.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 101
Defining Custom Types
• permissions: Specifies the permissions that a user must have in order to view this action on the action
menu. The permitted permission values are:
– lifecycle: Specifies who can perform lifecycle operations such as promote and demote.
– fullControl: Specifies who has full control over the object. Full control means that all permissions are
available, including the ability to change permissions.
• icon: Specifies the path to the image file that will be used to represent the icon. The convention used for
the path is: /custom/<relative location of the file in EKM_HOME/conf/resources
folder>, which is the location of the EKM_HOME/conf/resources folder. For example, suppose you
have added an icon called myicon.gif to your EKM_HOME/conf/resources/icons folder. The path
you would specify for icon would then be: /custom/icons/myicon.gif.
To specify icons for a parent menu that is not associated with any action, you can add a new action
and just provide an icon and not supply a macro. In the Project example shown above, you can create
a new action named Custom Actions and supply it with an icon. Once configured, the icon will
be displayed along with the label for the new menu category.
• multiSelectEnabled: To display an action when multiple objects of this type are selected, set this at-
tribute to true. Otherwise, if set to false, the action will only be displayed when a single object is selected.
If you enable this option, make sure that the corresponding macro script handles single and multiple objects,
as shown in the sample script.
Let's look at how you can define a custom folder structure by means of an example.
Suppose you want all of your simulation projects to be stored in a common place in EKM, and you want
each project to organize the data in three folders: Requirements, Common Files, and Reports. Let's say
you also want users to create new folders for each simulation they perform for the project, and further-
more, you want users to enter some required attributes when they start a new project.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
102 of ANSYS, Inc. and its subsidiaries and affiliates.
Custom Type Examples
The first step in the process is to define a new type named ProjectContainer (Example 7.7: Defining a
Project Container Type (p. 103)). It will appear in the user interface as Project Container (its localized
name) with version 1.0.0. It extends the built-in Container type. The listing below shows the XML
code fragment.
The ProjectContainer type can only have children of type Project, where Project is another
custom type that we will define shortly. The occurs attribute of the child element dictates whether
a single instance or multiple instances of the child type are allowed. In this case, occurs is set to list
which means that multiple instances of Project type can be added to a ProjectContainer. The
other valid values for occurs are required and optional. The required value is used if only
one instance of the child is allowed, and this instance must always exist. The optional value is used
if the child may or may not exist. For custom types, you should only use required or list values.
The name attribute specifies the name of the child. It is ignored and can be set to an empty string if
occurs is set to list. If occurs is set to required then the child will be automatically created
when the parent object is created. You therefore need to provide a valid name for the child. The child
name cannot contain the following special characters:
Now that we have created the Project Container type, we will define a new Project type. The XML
code listing shown in Example 7.8: Defining a Project Type (p. 103) is for a new Project type. It extends
the built-in type Container and defines some required user-defined properties: componentType,
disciplines, partId, exportControlled and dateOfIssue. The user who creates a project
in EKM by will be prompted to enter values for these properties. This type also has some required
children: Requirements, CommonFiles and Reports that are all of type Folder. When a Project
instance is created, these required children are also created automatically at the same time. You cannot
delete a required child. The Project type also enables you to create more instances of Folder type
for the various simulations to be performed in the project. Some custom actions are also specified for
the Project type. These were explained in the previous section.
In EKM you can use the New > Folder action menu in any folder to create an instance of a custom
folder that is allowed in the parent folder. If there are any required user-defined properties associated
with the type, you will be prompted to enter their values at the time of object creation in the New
Folder dialog box. All of the necessary user interface components will be automatically generated by
EKM.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 103
Defining Custom Types
<enumeration>Thermal</enumeration>
<enumeration>Electromagnetic</enumeration>
</property>
<property name="partId" label="Part Id" type="Long" required="true">
<constraint name="min" value="0" />
<constraint name="max" value="100" />
</property>
<property name="exportControlled" label="Export Controlled?"
type="Boolean" required="true"/>
<property name="dateOfIssue" label="Date Of Issue" type="Date" required="true"/>
</properties>
<children>
<child name="Requirements" occurs="required" type="Folder"/>
<child name="Common Files" occurs="required" type="Folder"/>
<child name="" occurs="list" type="Folder"/>
<child name="Reports" occurs="required" type="Folder"/>
</children>
<actions>
<script>
appendDescription(object, dialog) {
description = object.getProperty("description");
ekm.startTransaction();
time = Calendar.getInstance().getTime().toString();
object.setProperty("description", description+", added at: "+time);
ekm.commitTransaction();
}
setDescription(dialog) {
ekm.startTransaction();
object = dialog.getObject();
object.setProperty("description", dialog.getVars().get("description").getValue());
ekm.commitTransaction();
}
setDescriptionDialog(object, dialog) {
dialog.addStep("Set Description",
"/custom/set-project-description/set-description.xhtml",
"setDescription");
description = object.getProperty("description");
dialog.addVar("description", dialog.VARIABLE_TYPE_STRING, description, false);
}
</script>
<action name="Custom Actions/Append Description" macro="appendDescription"
permissions=" modify"/>
<action name="Custom Actions/Set Description" macro="setDescriptionDialog"
permissions=" modify"/>
</actions>
</type>
Custom analysis projects are defined by extending the Analysis Project built-in type. You can then use
the following type attributes to specify input, output and execution information:
• inputPattern: Specifies the path to an input file or folder containing input files. The path is relative
to the analysis project and can contain wildcards (* for any number of any character and ? for a single
occurrence of any character). Any number of inputPattern type attributes can be specified.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
104 of ANSYS, Inc. and its subsidiaries and affiliates.
Custom Type Examples
• outputPattern: Specifies the path to an output file or folder containing output files. The path is
relative to the analysis project and can contain wildcards. Any number of outputPattern type attrib-
utes can be specified.
• executionWorkflow: Specifies the full path of the process template that will be executed when the
analysis project is updated. The process should not have any required variables.
• executionWorkflowVar: Specifies a reference variable defined in the process template that will
be initialized with the instance of the analysis project that starts the process. This is used to reference
the analysis project in the process.
</ekmTypes:types>
The name of the custom type in the listing is TestAnalysis. It extends the AnalysisContainer
type and defines two children: inputs and outputs of type Folder. It specifies the input pattern
to be inputs/*, which means that all files in the inputs subfolder will be treated as inputs of the
analysis. It specifies the output pattern to be outputs/*, which means that all files in the outputs
subfolder will be treated as outputs of the analysis.
You can see how these sample files are used in Tutorial: Creating a Custom Analysis Project, located at
the end of the Working with Analysis Projects chapter in the User’s Guide.
• Extract metadata, images, or reports from a format that EKM does not support.
• Define user-defined properties for a file format that users will be prompted to enter values for,
whenever files of this format are uploaded.
Let's look at how you can define a custom file format by means of an example.
Suppose you have an in-house solver that requires an input file in a proprietary format and you want
EKM to automatically extract key metadata from this file after it is uploaded. You also want users to
enter some additional property values after the upload process. Finally you want users to create a
Simulation Details Report from the file. The custom type definition for this file format is shown below.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 105
Defining Custom Types
In Example 7.10: Custom File Definition (p. 106), the new type is named AcmeSimulationFile and is
given the label Acme Simulation File that will appear in the user interface. If you just need to extract
metadata from the file, then you can extend the new custom file format from the File type. However,
if you want to extract image or simulation details from the file (for a Simulation Details Report), then
you will need to extend it from the CaeModelFile type. This allows the Simulation Details Report action
menu to be visible in the user interface for this file.
This custom data type defines three properties that are automatically extracted by the metadata extraction
application: version, iterations, and physicalModels. It also defines some type attributes.
As previously explained, type attributes are used to specify settings that apply to all instances of that
type. Type attributes require a name and a value to be specified. The valid options for name depend
on the base type that you are extending. See Defining Type Attributes for a Custom Type (p. 78) for
more details.
In our example, the extension of the AcmeSimulationFile type is acm. This means that any file with
the extension .acm (for example, my-simulation-file.acm) will be treated as an AcmeSimula-
tionFile file type by EKM. The type also specifies applications for extracting metadata and reports.
Finally, the AcmeSimulationFile type also specifies a mixin named ModelAttributes. Mixins are
used to define sharable groups of properties or children. The ModelAttributes mixin is shown in
the following listing (Figure 7.10: ModelAttribute mixin Example (p. 106)). This mixin defines two user-
defined properties: revisionStatus and reviewedBy. Because the AcmeSimulationFile type
definition includes this mixin, it will also include these properties. Therefore, when a file of this type
is uploaded, a user will be asked to enter values for these properties.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
106 of ANSYS, Inc. and its subsidiaries and affiliates.
Custom Type Examples
• write the metadata in a file named ekm-meta-data.xml to the current working directory
• support only metadata files that adhere to the format specified in the meta-data.xsd schema file
The schema definition for metadata files is simple and the code listing is shown in Figure 7.11: meta-
data.xsd Schema Definition Listing (p. 107). The complete listing is included in the EKM_HOME/schema
folder.
<xsd:complexType name="MetaData">
<xsd:attribute name="name" type="xsd:string" use="required" />
<xsd:attribute name="value" type="xsd:string" use="required" />
</xsd:complexType>
<xsd:complexType name="ChildMetaDataList">
<xsd:sequence>
<xsd:element name="data" type="ekmMetaData:MetaData" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="child" type="ekmMetaData:ChildMetaDataList" minOccurs="0"
maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="type" type="xsd:string" use="required"/>
</xsd:complexType>
<xsd:complexType name="MetaDataList">
<xsd:sequence>
<xsd:element name="data" type="ekmMetaData:MetaData" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="child" type="ekmMetaData:ChildMetaDataList" minOccurs="0"
maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
The schema definition shows that a metadata file should have a root element named meta-data
that can have any number of elements named data. Each data element has two attributes: name and
value. The name should correspond to a property whose specifiedBy attribute is set to extractor.
The value is the extracted value of that property. Multi-valued properties can be specified in a comma-
separated manner.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 107
Defining Custom Types
Figure 7.12: Sample Metadata File for Custom AcmeSimulationFile Type (p. 108) shows the listing for a
sample metadata file of type AcmeSimulationFile that was defined above. The ekmMetaData
namespace is used for validating the file before it is read by EKM.
Important
The first two lines and the last line of this listing should be present in ALL metadata files.
The application for extracting a Simulation Details Report can be written in any programming language
and must fulfill the following requirements:
• write the report in a file named ekm-report.xml to the current working directory
• support only report files that adhere to the format specified in the report.xsd schema file
A listing of the schema definition for a custom extraction report is shown in Figure 7.13: Listing of re-
port.xsd Schema Definition (p. 108). The complete listing is included in the EKM_HOME/schema folder.
<xsd:complexType name="Image">
<xsd:attribute name="name" type="xsd:string" use="required" />
<xsd:attribute name="src" type="xsd:string" use="required" />
</xsd:complexType>
<xsd:complexType name="Link">
<xsd:attribute name="name" type="xsd:string" use="required" />
<xsd:attribute name="src" type="xsd:string" use="required" />
</xsd:complexType>
<xsd:complexType name="Text">
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="name" type="xsd:string"
use="required" />
<xsd:attribute name="showFormattedContent"
type="xsd:string" use="optional" />
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
108 of ANSYS, Inc. and its subsidiaries and affiliates.
Custom Type Examples
<xsd:complexType name="Column">
<xsd:attribute name="name" type="xsd:string" use="required" />
<xsd:attribute name="id" type="xsd:string" use="optional" />
</xsd:complexType>
<xsd:complexType name="Row">
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0"
maxOccurs="unbounded">
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="Table">
<xsd:sequence>
<xsd:element name="column" type="ekmReport:Column"
minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="row" type="ekmReport:Row" minOccurs="0"
maxOccurs="unbounded" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
<xsd:attribute name="caption" type="xsd:string" use="optional" />
<xsd:attribute name="showHeaders" type="xsd:boolean"
use="optional" />
<xsd:attribute name="showBorder" type="xsd:boolean"
use="optional" />
</xsd:complexType>
<xsd:complexType name="Section">
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element name="section" type="ekmReport:Section"/>
<xsd:element name="image" type="ekmReport:Image"/>
<xsd:element name="link" type="ekmReport:Link"/>
<xsd:element name="text" type="ekmReport:Text"/>
<xsd:element name="table" type="ekmReport:Table"/>
</xsd:choice>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
Figure 7.13: Listing of report.xsd Schema Definition (p. 108) shows that the root element of the report
file is named section. A section can have any number of section, image, link, text, and
table child elements.
The image element has an src attribute for pointing to the image file. All images that need to be in-
cluded in the report should be placed in a folder called ekm-report-files in the current working
directory of the report application. The src attribute of the image element should reference the image
file using reportFiles</image-name>. For example, if the report application generates an image
named plot.gif, then it needs to be included in the report. Furthermore, this image file should be
placed in the ekm-report-files sub-folder in the current working directory, and the image element
defined with the code shown below.
The table element can have any number of column and row child elements. The format of the table
can be controlled by showBorder and showHeaders attributes. The column element has a name
attribute that is shown in the column header. The row element has a number of child elements named
value. Each value element specifies the value for a particular row and column. The number of value
elements must be the same as the number of columns in the table.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 109
Defining Custom Types
Figure 7.15: Sample Report File for AcmeSimulationFile Type (p. 110) shows the listing for a sample report
file for the AcmeSimulationFile type previously defined. A table named info is defined with two
columns: condition and value and four rows. Each row has two value elements for the condition
and value columns.
The listing in Example 7.11: Extending a Fluent Case Built-in Type (p. 110) shows an example that extends
the FluentCase built-in type. It creates an extension named AcmeFluentExtension that extends
FluentCase. The ModelAttributes mixin was defined in a previous example (see Figure 7.10: Mod-
elAttribute mixin Example (p. 106)). ModelAttributes defines user-defined properties that a user will
be prompted to enter values for, when a file of this type is uploaded to EKM.
If you later need to migrate your workspace, you may perform the migration without having performed
the step of editing the WorkspaceConfig.xml. If this happens, data extraction will fail even if you
subsequently edit the WorkspaceConfig.xml file and attempt to migrate again. The workaround
in the case of a failed data extraction is to subsequently extract metadata using the Extract Data action.
See Extracting Data On Demand in the EKM User’s Guide for details.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
110 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 8: Integrating EKM with Remote Solve Manager (RSM)
In order to successfully run and manage jobs in EKM, you must ensure that RSM is installed and set up
properly, and that EKM is configured to work with RSM.
Important
When setting up RSM for use with EKM, it is imperative that you follow the instructions here
(in the EKM Administration Guide) and not those in the Remote Solve Manager’s User’s Guide.
• For information about supported operating system scenarios, see Supported Platforms (p. 116).
• You cannot use RSM to run jobs on machines other than the RSM Manager machine. To be able to run jobs
on other machines, you must use a commercial cluster such as LSF or Microsoft HPC.
• The Compute Server service (Ans.Rsm.SHHost.exe) and RSM-RPC Server (Ans.Rsm.XmlRpcServer) are no
longer used. Only the RSM Job Manager service (Ans.Rsm.JMHost.exe) is required. For details see Starting
RSM Services on Windows (p. 126) or Starting RSM Services on Linux (p. 128).
• You cannot use the RSM Admin interface to edit RSM settings, define queues or compute hosts, create ac-
counts, run test jobs, and so on. Settings in the RSM Admin interface apply only when jobs are submitted
directly to RSM from clients other than EKM (such as Workbench and Mechanical).
• All configuration is done through XML configuration files instead of the RSM Admin interface:
• When integrating with third-party batch systems such as LSF and SGE, RSM Manager should always be installed
on a cluster submission host.
– All jobs must run on localhost (the machine where RSM Manager is running)
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 111
Integrating EKM with Remote Solve Manager (RSM)
– Jobs will queue only when all of the localhost machine's resources are being used by other jobs
• When used by EKM, accounts/passwords are not cached by the RSM Job Manager. Since accounts are not
managed by RSM, the concept of alternate accounts no longer applies when using EKM with RSM.
• The Settings dialog box in EKM no longer has an RSM Accounts tab. Now, EKM passes your EKM credentials
to RSM. If necessary, you can override these credentials in your preferences. See Specifying Job Management
Preferences in the EKM User’s Guide.
A batch job is a sequence of tasks to be executed by the operating system. Batch jobs are run in RSM
and do not require that EKM wait for the job to complete before performing other tasks. These jobs
are often long-running. Consequently EKM provides a way to monitor the status of jobs, and notifies
the user when a job is complete. Batch jobs in EKM are typed as Job objects.
In order to successfully run batch jobs in EKM, you must install and configure RSM, and configure EKM
to work with RSM. An overview of the required steps is provided below.
Required Steps
1. Install ANSYS Workbench, RSM, and the ANSYS applications that you want to run.
Note
• RSM is automatically installed with Workbench. For information on installing RSM, refer to
Distribution of Services (p. 113) and Installing RSM for use with EKM (p. 116).
• ANSYS applications (Fluent, CFX, MAPDL, and so on) should be installed on the machine(s)
where you will be running jobs. They should be installed in a way that they can be accessed
by the RSM machine and any other cluster machines being used.
2. Configure RSM to work with EKM and (if applicable) a third-party cluster. The easiest way to do this is to
run a script that automates the process. For an overview see Configuring RSM for use with EKM and Third-
Party Clusters (p. 117). For instructions see Configuring RSM Automatically (p. 118).
If do not wish to use the automated script, you will need to perform each configuration step indi-
vidually, as described in Configuring RSM Manually (p. 119).
3. If RSM is not installed on the same machine as EKM, change the value of the rsmLauncherURL setting
in ekm.xml from localhost to the hostname of the server where the ANSYS RSM Launcher service is
running. See Specifying Remote Process Policies (<remoteProcess>) (p. 55) for details.
4. If necessary, modify RSM configuration files to complete the integration of EKM with RSM and third-party
batch systems. See Modifying RSM Configuration Files (p. 124).
5. Ensure that EKM and RSM job directories are correctly defined. See EKM and RSM Job Directories (p. 129).
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
112 of ANSYS, Inc. and its subsidiaries and affiliates.
EKM and RSM Platform Support
6. In EKM, synchronize EKM job submission queues with those defined in RSM. See Synchronizing Job Sub-
mission Queues (p. 137).
7. For each job submission queue in EKM, load or create application definitions that determine the applications
to be run. See Defining Job Submission Queue Settings (p. 138) and Defining External Applications (p. 139).
Note
If users will be submitting Electronics jobs, you must specify the installation directory of
Electronics Desktop in the ekm.xml configuration file. See the emagInstallationDir-
ectory setting in Specifying Remote Process Policies (<remoteProcess>) (p. 55).
Optional Steps
• If the RSM Manager is running on Windows, you will have specified the RSM Windows domain name during
the EKM server installation. If for some reason you need to edit this value after installation, you can do so
in the ekm.xml file by editing the rsmWindowsDomain setting. For details see Specifying Remote Process
Policies (<remoteProcess>) (p. 55).
• By default, all users will have access to all RSM queues. If desired, you can restrict certain users from submitting
jobs to a queue by setting permissions on the queue. (See Editing Permissions in the EKM User’s Guide.)
• EKM Server
• RSM Manager
When using EKM with RSM, there are only certain platform combinations and distribution of services
that are supported.
In this section:
8.3.1. Distribution of Services
8.3.2. Supported Platforms
As described in Types of Queues (p. 136), integration with RSM is based on the creation of EKM queues
that map to RSM queues.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 113
Integrating EKM with Remote Solve Manager (RSM)
2. On Server 1, generate the required RSM configuration files, and modify them as necessary to complete
the RSM configuration. See Configuring RSM for use with EKM and Third-Party Clusters (p. 117).
Note
If you are using RSM as the job scheduler, all jobs will run directly on the RSM machine.
If a job requests more cores than are available, it will remain queued until the requested
cores become available. If a job requests more cores than exist on the RSM machine, it
will be rejected.
3. In EKM, synchronize queues with RSM (see Synchronizing Job Submission Queues).
2. On Server 2, generate the required RSM configuration files, and modify them as necessary to complete
the RSM configuration. See Configuring RSM for use with EKM and Third-Party Clusters (p. 117).
3. On Server 1, specify the value of the following settings in the ekm.xml file:
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
114 of ANSYS, Inc. and its subsidiaries and affiliates.
EKM and RSM Platform Support
a. jobSourceRootPath: Specify the path to the directory where EKM will stage the data files for
batch jobs submitted to RSM. You must create this directory before job submission begins. This dir-
ectory is resolved on the RSM Manager machine, so it must be accessible from that machine.
b. rsmLauncherURL: Change the value from localhost to the hostname of the server where the
ANSYS RSM Launcher service is running.
For details about these settings, see Specifying Remote Process Policies (<remoteProcess>) (p. 55).
4. In EKM, synchronize queues with RSM (see Synchronizing Job Submission Queues).
As described in Types of Queues (p. 136), integration with RSM is based on the creation of EKM queues
that map to RSM queues. For example, suppose you have an LSF cluster on your LAN that you want to
use with EKM, as shown in Figure 8.1: EKM and RSM with an LSF Cluster (p. 115).
For this system, the integration steps you would need to follow to configure the LSF cluster to EKM are:
2. Install the RSM Manager on an LSF Head Node/Submit Host. In LSF, a submit host is a machine that is able
to submit jobs to the cluster; often this is just a head node.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 115
Integrating EKM with Remote Solve Manager (RSM)
3. On the LSF Head Node/Submit Host where RSM is installed, generate the required RSM configuration files,
and modify them as necessary to complete the RSM configuration. This will include mapping the LSF queue
to an RSM queue. See Configuring RSM for use with EKM and Third-Party Clusters (p. 117). For a relevant
example, see Example 8.1: EKM/RSM with an LSF Cluster (Jobs use Local Scratch Directory) (p. 121).
4. In EKM, synchronize queues with RSM. See Synchronizing Job Submission Queues (p. 137) for details.
An EKM user can use an EKM queue to send work to the LSF cluster via RSM without knowing any details
about the LSF or RSM configuration.
Important
The O.S. family requirement does not exclude using a Linux file server that is accessed from
Windows. The EKM Server, RSM Manager and machine(s) where jobs process must all be
from the same family, but could all be Windows machines that only use a Linux server to
serve files.
See Supported Operating System Versions in the Engineering Knowledge Manager and the ANSYS Remote
Solve Manager documentation for more specific information on supported operating systems.
Important
• There is no requirement that EKM must be installed on the same server as RSM. For a description
of supported platforms and acceptable EKM/RSM configurations, see EKM and RSM Platform
Support (p. 113).
• RSM is automatically installed with ANSYS Workbench, but can also be installed as a standalone
package.
• If using third-party batch systems such as LSF or SGE, install RSM on a Head Node/Submit Host.
• An EKM server only needs to be configured to use RSM if the server’s user-accessible workspace
is being used, and jobs are being submitted from it. If an EKM server is being used for caching
only, RSM does not need to be configured on that server. For more information about server
configurations, see Distributed Servers and Workspace Access (p. 5).
• In order to run jobs successfully in EKM, the installed version of RSM must be exactly the same
version as EKM. For example, EKM 17.0 will not work with RSM 16.2.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
116 of ANSYS, Inc. and its subsidiaries and affiliates.
Configuring RSM for use with EKM and Third-Party Clusters
• After installing RSM, do not start RSM services. If you will be using the automated script to con-
figure RSM, the script will start RSM services for you. See Configuring RSM for use with EKM and
Third-Party Clusters (p. 117). If you will not be using the automated script, you will need to configure
RSM and start RSM services manually. See Configuring RSM Manually (p. 119).
• If after installing and configuring RSM you wish to install another ANSYS product using the ANSYS
unified installer, make sure that you stop all RSM services before proceeding with the installation,
and then restart them after the installation. For instructions refer to RSM Service Installation and
Configuration in the Remote Solve Manager User’s Guide.
For details about installing RSM, refer to RSM Software Installation in the Remote Solve Manager User’s
Guide.
For details on the RSM integration settings that are stored in EKM, refer to Specifying Remote Process
Policies (<remoteProcess>).
8.5. Configuring RSM for use with EKM and Third-Party Clusters
Once you have installed RSM, you must configure it to work with EKM. For your convenience, a script
is provided in the EKM_HOME\examples\rsm folder which automates the configuration process.
Note that the LauncherService is enabled by default, and should not be disabled.
• Creates the RSM ClusterConfiguration (.rsmcc) and ConfiguredQueue (.rsmq) files in the specified con-
figuration directory.
• Starts the RSM Manager. In Windows, enable-portal-setting.cmd also registers the RSM Manager
as a Windows service.
For instructions on using the automated script, see Configuring RSM Automatically (p. 118).
You can also perform the configuration steps manually if desired. See Configuring RSM Manually (p. 119).
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 117
Integrating EKM with Remote Solve Manager (RSM)
Important
Prior to running the script, make sure that you have set the AWP_ROOT170 environment
variable.
2. If jobs will be run from RSM only, you can skip this step. Otherwise, if you are integrating RSM with an LSF,
PBS, TORQUE, UGE/SGE or Windows HPC cluster:
b. If you will be running jobs exclusively via the cluster, comment out the default rsm config com-
mand, as shown below:
rem "%AWP_ROOT170%\RSM\bin\rsm.exe" config create default
If you will be running jobs via RSM as well as via the cluster, you can leave this uncommented.
c. Uncomment the rsm config command that corresponds to your cluster type, and optionally
specify arguments to configure the cluster configuration. You can also modify the .rsmcc and
.rsmq files after they have been generated (see Modifying RSM Configuration Files (p. 124)).
rem Uncomment one of the following "rsm config" commands:
4. Use enable-portal-setting.cmd[sh] along with a parameter that specifies the location of the
configuration directory. This is the directory where the .rsmcc and .rsmq files will be generated. Referring
to the sample below, replace /some/path with a local path on the RSM server that is read/write accessible
to the user running the RSM Job Manager (for example, D:\RSMData).
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
118 of ANSYS, Inc. and its subsidiaries and affiliates.
Configuring RSM for use with EKM and Third-Party Clusters
enable-portal-setting.cmd /some/path
If the directory that you specify does not currently exist, it will be created automatically.
Note
When EKM is used with RSM, it is required that the LauncherService be enabled in the
RSM\Config\Ans.Rsm.AppSettings.config file. This setting is enabled by default,
and should not be disabled.
2. Go to the RSM\Config folder where ANSYS products are installed and open the Ans.Rsm.AppSet-
tings.config file.
3. Specify a local path on the RSM server that is read/write accessible to the user running the RSM Job
Manager:
<appSettings name="JobManagement">
<add key="CompressionThresholdMb" value="0" />
<add key="CleanupTimeSpan" value="00:10:00" />
<add key="FinishedJobHistoryCleanupTimeSpan" value="02:00:00" />
<add key="FailedJobHistoryCleanupTimeSpan" value="1.00:00:00" />
<add key="CancelJobHistoryCleanupTimeSpan" value="00:10:00" />
<add key="JobsWatcherPeriodMs" value="5000" />
<add key="LogWatcherPeriodMs" value="1000" />
<add key="AsyncResultPollingTimeoutMs" value="1000" />
<add key="ConfigurationDirectory" value="\some\local\path" />
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 119
Integrating EKM with Remote Solve Manager (RSM)
To begin, you must run a command to generate the RSM configuration files required for your particular
setup. Two configuration files are generated:
Basically, the .rsmcc file contains information about the cluster, and how RSM will work with the
cluster. The .rsmq file defines the RSM queue names that users will see in EKM. Each RSM queue maps
to an actual cluster queue name as well as a cluster configuration defined in the .rsmcc file.
Once the configuration files have been generated, you can modify them and specify values for additional
properties that they contain.
To generate the required RSM configuration files, you must run the rsm config command at \Pro-
gram Files\ANSYS Inc\v170\RSM\bin, appending options if necessary to create the desired
configuration. (In Linux, use rsmutils config at RSM/Config/tools/linux.)
Before generating files, make sure that you have specified a target directory (p. 119) for the generated
configuration files. To ensure that you specify appropriate configuration options, it is recommended
that you read Important Considerations and Recommendations for Job Submission (p. 124) before gen-
erating configuration files.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
120 of ANSYS, Inc. and its subsidiaries and affiliates.
Configuring RSM for use with EKM and Third-Party Clusters
Generating Configuration Files for a Basic Setup (EKM with RSM Only)
If jobs will be run from RSM only, you can enter the following command:
C:\Program Files\ANSYS Inc\v170\RSM\bin>rsm config create default
or
C:\Program Files\ANSYS Inc\v170\RSM\bin>rsm config create ARC -name localhost -rq Local
In this case, a LOCALHOST.rsmcc file is created which contains the following settings:
<?xml version="1.0" encoding="utf-8"?>
<ClusterConfiguration version="1">
<name>localhost</name>
<type>ARC</type>
<machine>localhost</machine>
<submitHostPlatform>AllWindows</submitHostPlatform>
<stagingDirectory />
<localScratchDirectory />
<fileCopyOption>None</fileCopyOption>
<nativeSubmitOptions />
<useSsh>False</useSsh>
<sshAccount />
<sshStagingDirectory />
<useSshForLinuxMpi>True</useSshForLinuxMpi>
<deleteStagingDirectory>True</deleteStagingDirectory>
<readonly>False</readonly>
</ClusterConfiguration>
In this configuration, the cluster type is ARC, which stands for ANSYS RSM Cluster, the configuration
name is localhost, and the RSM queue name is Local. If not specified, the cluster queue name
defaults to Local.
If you were to open the queues.rsmq file, you would see the Local queue added there:
<?xml version="1.0" encoding="utf-8"?>
<Queues>
<Queue version="1">
<name>Local</name>
<clusterConfigurationName>localhost</clusterConfigurationName>
<clusterQueueName>Local</clusterQueueName>
<enabled>True</enabled>
</Queue>
</Queues>
Generating Configuration Files for Integration with Third-Party Clusters: Examples and
Overview
The following examples provide a general overview of how to integrate a third-party cluster with EKM
and RSM. For more in-depth examples, see Generating Configuration Files for Integration with Third-
Party Clusters: Additional Examples (p. 123).
Example 8.1: EKM/RSM with an LSF Cluster (Jobs use Local Scratch Directory)
To configure EKM/RSM to use an LSF queue, and run jobs in the local scratch directory, you would enter
a command similar to the following:
/ansys_inc/v170/RSM/Config/tools/linux/rsmutils>rsmutils create LSF -name LSFSCRATCH -localScratch /rsmtmp
-rsmQueue LSF-SCRATCH -clusterQueue normal
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 121
Integrating EKM with Remote Solve Manager (RSM)
In this example, an RSM queue name (LSF-SCRATCH) is specified. This will be the queue name displayed
in EKM. If an RSM queue name is not included in the command line (for example, -rsmQueue LSF-
SCRATCH), the actual cluster queue name will be displayed instead.
If you were to open the queues.rsmq file, you would see the LSF-SCRATCH queue added there:
<?xml version="1.0" encoding="utf-8"?>
<Queues>
<Queue version="1">
<name>LSF-SCRATCH</name>
<clusterConfigurationName>LSFSCRATCH</clusterConfigurationName>
<clusterQueueName>normal</clusterQueueName>
<enabled>True</enabled>
</Queue>
</Queues>
The clusterConfigurationName value, LSFSCRATCH in this example, is what links the queue to
the actual cluster configuration.
Example 8.2: EKM/RSM with a Microsoft HPC Cluster (Jobs use a Local Scratch Directory)
To integrate EKM/RSM with a Microsoft HPC cluster, and run cluster jobs in a local scratch directory,
you would enter a command similar to the following:
C:\Program Files\ANSYS Inc\v170\RSM\bin>rsm config create MSHPC -name HPCSCRATCH -localscratch C:\RSMTemp
-scratchUnc RSMTemp -rsmQueue HPC-SCRATCH
When integrating with a Microsoft HPC cluster, the cluster queue name will default to Local if not
specified.
In this example, including the -localscratch argument indicates that jobs will run in a local scratch
directory. The path is the same as what you would see specified for the Share Path for Local Scratch
setting in the Compute Server Properties dialog box in RSM (see Properties on the File Management
Tab in the RSM User’s Guide).
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
122 of ANSYS, Inc. and its subsidiaries and affiliates.
Configuring RSM for use with EKM and Third-Party Clusters
If you were to open the queues.rsmq file, you would see the following queue added there:
<?xml version="1.0" encoding="utf-8"?>
<Queues>
<Queue version="1">
<name>HPC-SCRATCH</name>
<clusterConfigurationName>HPCSCRATCH</clusterConfigurationName>
<clusterQueueName>Local</clusterQueueName>
<enabled>True</enabled>
</Queue>
</Queues>
Generating Configuration Files for Integration with Third-Party Clusters: Additional Ex-
amples
Here are more in-depth examples of commands for generating RSM configuration files for SGE, Microsoft
HPC and LSF clusters.
Note that a single cluster queue can be mapped to more than one RSM queue.
In EKM, the SGE queue ekmshare1 is referred to as SGE_SHARE. all.q is not aliased and is referred
to as all.q.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 123
Integrating EKM with Remote Solve Manager (RSM)
Local scratch setup: Jobs submitted to RSM all.q queue will run in a local scratch folder /rsmtmp.
rsmutils config create UGE -name SGELOCAL -localScratch /rsmtmp -peMpi myPE -clusterQueue all.q
No local scratch. Jobs submitted to RSM’s SGE_SHARE queue will run in shared cluster directory specified
by jobSoureRootPath in ekm.xml.
rsmutils config create SGE -name SGESHARE -peSmp myPE -clusterQueue ekmshare1 -rsmQueue SGE_SHARE
Note that you can specify UGE or SGE for config create. They are the same.
Local scratch setup. Jobs submitted to RSM’s HPC-SCRATCH queue will run in a local scratch folder
C:\RSMTemp. Note that the cluster nodes will all share this folder as \\[ExecutionNode]\RSMTemp.
rsm config create MSHPC -name HPCSCRATCH -localscratch C:\RSMTemp -scratchUnc RSMTemp -rsmQueue HPC-SCRATCH
No local scratch. Jobs submitted to RSM’s HPC-SHARE queue will run in shared cluster directory specified
by jobSoureRootPath in ekm.xml.
rsm config create MSHPC -name HPCSHARE -rsmQueue HPC-SHARE
In EKM, the LSF queue normal is accessed via the RSM queue names LSF-SCRATCH and LSF-SHARE.
Local scratch setup. Jobs submitted to RSM’s LSF-SCRATCH queue will run in a local scratch folder
/rsmtmp.
rsmutils config create LSF -name LSFSCRATCH -localScratch /rsmtmp -rsmQueue LSF-SCRATCH -clusterQueue normal
No local scratch. Jobs submitted to RSM’s LSF-SHARE queue will run in shared cluster directory specified
by jobSoureRootPath in ekm.xml.
rsmutils config create LSF -name LSFSHARE -rsmQueue LSF-SHARE -clusterQueue normal
You can modify these files after they are created to complete your configuration.
Sample configuration files for different cluster types can be found in the EKM_HOME\ex-
amples\rsm\sample-configurations folder.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
124 of ANSYS, Inc. and its subsidiaries and affiliates.
Configuring RSM for use with EKM and Third-Party Clusters
• The option of using a shared staging directory applies to all ANSYS solvers.
• If you use a Fluent, CFX or Electronics job template to submit a job to a queue that uses a local scratch dir-
ectory, the job may fail.
• When configuring a job template in EKM, ensure that you make available only those queues that support
the type of job being submitted. For example, in the CFX or Electronics template, ensure that you enable
only those queues that use a shared staging directory. For more information about job template properties,
see Creating a Custom Job Template in the EKM User’s Guide.
• Consider giving your RSM queues meaningful names, so that you can easily identify what they are to be
used for. For example, you may want to indicate whether or not the queue uses a local scratch directory.
<name>: The cluster configuration name. This name will be referenced in the queue definition
(queues.rsmq) file.
<type>: The type of cluster. Possible values are ARC (ANSYS RSM Cluster), LSF, PBS, TORQUE,
SGE, UGE, and MSCC.
<machine>: This will always be set to localhost.
<submitHostPlatform>: The platform of the cluster submission host. The value can be AllWin-
dows or AllLinux.
<stagingDirectory>: IMPORTANT: Leave this property blank. This is the shared cluster directory
in which jobs will run. It is specified in the jobSourceRootPath setting in the ekm.xml file. For
more information see Specifying Remote Process Policies (<remoteProcess>) (p. 55).
<localScratchDirectory>: If cluster jobs will run in a scratch directory local to the execution
node, specify the path of the desired local scratch space on the cluster. This should be a local path
such as D:\storage\RsmTemp. Note that the use of local scratch is supported for MAPDL/Mech-
anical solutions only. If using other solvers, you must use a shared staging directory. See Important
Considerations and Recommendations for Job Submission (p. 124).
<fileCopyOption>: Always leave this set to None.
<nativeSubmitOptions>: Not applicable for most EKM setups. For advanced, customized con-
figurations, refer to [scheduler] Job Submission Arguments in Properties on the Cluster Tab in the
RSM User’s Guide.
<useSsh>: If integrating with a Linux cluster, specify whether or not you want to use the SSH
protocol to communicate with remote cluster nodes. This value can be True or False.
<sshAccount>: If SSH is being used, enter the user account that will be used to access the cluster
node.
<sshStagingDirectory>: If SSH is being used, enter the path of the directory on the remote
machine where jobs will be run.
<useSshForLinuxMpi>: Applies only to distributed jobs using multiple cluster execution nodes.
If true, use SSH for inter-node communication on the cluster, If false, use RSH.
<deleteStagingDirectory>: Specify whether the temporary job subdirectories created in the
staging directory are deleted upon completion of jobs. This value can be True or False. Retaining
job files in the staging directory can be helpful for testing and debugging failed jobs. Note that if
the job staging directory is the same as the EKM job data directory (jobSourceRootPath), RSM
will never try to delete the user’s client directory.
<readonly>: Internal use only.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 125
Integrating EKM with Remote Solve Manager (RSM)
<name>: The RSM queue name to be displayed in EKM. If this is not specified, the actual cluster
queue name will be displayed instead.
<clusterConfigurationName>: The name of the cluster configuration that will use this queue.
Specify the same value that is specified for the <name> property in the .rsmcc configuration file.
<clusterQueueName>: The actual cluster queue name. Required for all cluster types except ARC
(native RSM) and MSCC (Microsoft HPC). If left blank for an ARC or MSCC cluster, the cluster queue
name will default to Local.
<enabled>: Specify True to enable the queue, or False to disable it. Only enabled queues will
appear as available queues in EKM.
1. Referring to Installing RSM Services for Windows in the Remote Solve Manager User’s Guide, install only
the RSM Manager service:
AnsConfigRSM.exe -mgr
The RSM Manager (Ans.Rsm.JMHost.exe) provides an XmlRpc interface called the Launcher
Service to be used by EKM.
2. In EKM, OS account names are determined by the mapping login module that is configured for your
installation. For details refer to How User Logins Work in the Installation Guide.
Important
• On a Windows machine, the account name must always include the domain (for example,
MYDOMAIN\jsmith).
• In EKM, this same domain must be specified in the rsmWindowsDomain setting in the
ekm.xml file. By default, jobs are submitted to RSM as rsmWindowsDomain value\OS
account name. Refer to rsmWindowsDomain (Windows only) (p. ?) for details.
• If a user’s RSM account has different credentials than the credentials used to sign in to
EKM, the user must specify those RSM account credentials in his or her job management
preferences in EKM. When submitting jobs, EKM will then pass these credentials to RSM
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
126 of ANSYS, Inc. and its subsidiaries and affiliates.
Configuring RSM for use with EKM and Third-Party Clusters
instead of the user’s EKM credentials. See Specifying Job Management Preferences in
the User’s Guide.
3. Optionally configure the XmlRpc port for ANSYS RSM Launcher service.
Note
If you change the default port value described below, you will need to restart the
service for it to pick up the changes. Services are accessed via the Windows Control
Panel under Administrative Tools.
The XmlRpc interface of the ANSYS RSM Launcher service provides the interface from the EKM
Server to RSM. The Launcher service must be running with XmlRpc enabled for EKM to be able
to communicate with RSM. This is done through the LauncherXmlRpcEnabled setting.
This service runs on a tcp port specified in the file Ans.Rsm.AppSettings.config that
is located in the install_root\RSM\Config directory of the RSM installation. For example:
C:\Program Files\ANSYS Inc\v170\RSM\Config\Ans.Rsm.AppSettings.config.
If you need to change the default XmlRpc port (10017) used, edit this file and change the
value specified for the LauncherXmlRpcPort in the appSettings settings:
<appSettings name="LauncherService">
<add key="LauncherXmlRpcEnabled" value="true" />
<add key="TokenVerification" value="false" />
<!-- Port for Launcher XmlRpc listener. http://+:port/Launcher -->
<add key="LauncherXmlRpcPort" value="10017" />
<add key="LauncherXmlRpcSecure" value="false" />
EKM defines a URL used to communicate with this RSM service. If you change the default XmlRpc
port of the Launcher service, you will also need to change the port specified in the default
value of the rsmLauncherURL setting. The rsmLauncherURL setting in EKM also includes
the hostname where this Launcher service is running. If this is on a different server than EKM,
the default value of localhost must be changed. See Specifying Remote Process Policies
(<remoteProcess>) (p. 55) for details.
• LauncherXmlRpcSecure: Set to true to enable SSL for the XmlRpc HTTP interface.
• ProxyXmlRpcPortRange: Limit the range of ports for the User Proxy XmlRpc interfaces.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 127
Integrating EKM with Remote Solve Manager (RSM)
1. Referring to Installing RSM Services for Linux in the Remote Solve Manager User’s Guide, install only the RSM
Manager service. The RSM Manager (Ans.Rsm.JMHost.exe) provides an XmlRpc interface called the
Launcher Service to be used by EKM. Before installing the RSM Manager service, be sure to read Configuring
RSM to Use a Remote Computing Mode for Linux > Adding Common Job Environment Variables in the Remote
Solve Manager User’s Guide.
2. In EKM, account names are determined by the mapping login module that is configured for your installation.
For details see How User Logins Work (p. ?) in the EKM Installation Guide.
If a user’s RSM account has different credentials than the credentials used to sign in to EKM, the
user must specify those RSM account credentials in his or her job management preferences in EKM.
When submitting jobs, EKM will then pass these credentials to RSM instead of the user’s EKM cre-
dentials. See Specifying Job Management Preferences in the User’s Guide.
3. Optionally configure the XmlRpc port for ANSYS RSM Launcher service.
Note
If you change the default port value described below, you will need to restart the service
for it to pick up the changes.
The XmlRpc interface of the ANSYS RSM Launcher service provides the interface from the EKM
Server to RSM. The Launcher service must be running with XmlRpc enabled for EKM to be able
to communicate with RSM. This is done through the LauncherXmlRpcEnabled setting.
This service runs on a tcp port specified in the file Ans.Rsm.AppSettings.config which is
located in the <install root>\RSM\Config directory of the RSM installation. For example:
C:\Program Files\ANSYS Inc\v170\RSM\Config\Ans.Rsm.AppSettings.config.
If you need to change the default XmlRpc port (10017) used, edit this file and change the value
specified for the LauncherXmlRpcPort in the appSettings settings:
<appSettings name="LauncherService">
<add key="LauncherXmlRpcEnabled" value="true" />
<add key="TokenVerification" value="false" />
<!-- Port for Launcher XmlRpc listener. http://+:port/Launcher -->
<add key="LauncherXmlRpcPort" value="10017" />
<add key="LauncherXmlRpcSecure" value="false" />
EKM defines a URL used to communicate with this RSM service. If you change the default XmlRpc
port of the Launcher service, you will also need to change the port specified in the default value
of the rsmLauncherURL setting. The rsmLauncherURL setting in EKM also includes the host-
name where this Launcher service is running. If this is on a different server than EKM, the default
value of localhost must be changed. See Specifying Remote Process Policies (<remotePro-
cess>) (p. 55) for details.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
128 of ANSYS, Inc. and its subsidiaries and affiliates.
EKM and RSM Job Directories
• LauncherXmlRpcSecure: Set to true to enable SSL for the XmlRpc HTTP interface.
• ProxyXmlRpcPortRange: Limit the range of ports for the User Proxy XmlRpc interfaces.
The EKM job data directory is specified during installation, and is captured in the jobSource-
RootPath setting in the ekm.xml file. See Specifying Remote Process Policies (<remotePro-
cess>) (p. 55).
This directory has some essential requirements and considerations. Refer to Access and Permission
Requirements of the Job Data Directory (p. 131).
Important
• These two directories must be the same location when using EKM with RSM. When RSM is being
used with a cluster, network shares will be used to accomplish this. There is no requirement that
the physical location of the directory is on one of the machines running EKM or RSM. It just needs
to be accessible.
• If users will be submitting jobs to EKM from Workbench, and Workbench and RSM are on different
machines that refer to the job directory using different paths, then you must specify a
pathMapping in the ekm.xml file. This ensures that EKM passes a job path to RSM that RSM
can recognize. See Specifying Remote Process Policies (<remoteProcess>) (p. 55).
8.6.1. How Job Data Files are Handled in EKM and RSM
This section describes:
8.6.1.1.The Data Management Process
8.6.1.2.The Creation and Structure of Job Directories
8.6.1.3. Access and Permission Requirements of the Job Data Directory
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 129
Integrating EKM with Remote Solve Manager (RSM)
When a user starts a job in EKM, the user’s data management process writes job data to the job data
directory, which is specified in the jobSourceRootPath setting in the ekm.xml file. The RSM Manager
accesses this directory when managing the job.
In order for the data management process to execute properly, the job data directory must meet the
following requirements:
• The directory must exist before EKM is deployed and users begin running jobs, and must be accessible by
the RSM Manager machine.
• All users who will be submitting jobs must have read/write permission on this directory.
For more information about the jobSourceRootPath setting, see Specifying Remote Process Policies
(<remoteProcess>) (p. 55).
To see how the data management process works, see the example in The Creation and Structure of Job
Directories (p. 130).
If a shared job data directory is being used, EKM will create a workspace directory under the job data
directory (if not already present), followed by a username directory, and time stamp directory.
As an example in Windows:
1. In the ekm.xml file, the jobSourceRootPath is set to \\RSMMANAGER\HPCTemp. This is a UNC path
to a shared directory named HPCTemp on the RSM Manager machine. This translates to C:\HPCTemp on
that machine.
2. John Smith (with user name jsmith) is signed in to the Default workspace. When John runs a job, js-
mith’s data management process creates the following directory for the job:
C:\HPCTemp\Default\jsmith\20_May_2015_10.39.18_AM
3. When John selects input files for the job, the files are uploaded to the 20_May_2015_10.39.18_AM
directory. RSM Manager accesses this directory to manage the job. The RSM compute server can access
this directory, and will run the job directly in it to avoid unnecessary file transfers.
4. Every time John starts a new job, a new subdirectory named with the job’s time stamp will be created under
the C:\HPCTemp\Default\jsmith directory.
5. When another user, Susan Thomas, starts a job, a directory will be created for her job under the job data
directory in a similar way:
C:\HPCTemp\Default\sthomas\20_May_2015_11.40.26_AM
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
130 of ANSYS, Inc. and its subsidiaries and affiliates.
EKM and RSM Job Directories
In a Linux configuration, if home directories are being used instead of a shared job directory, only a
time stamp directory will be created under the job data directory, as shown in the following example:
/net/server/home/jsmith/jobRoot/20_May_2015_10.39.18_AM
For information about specifying the jobSourceRootPath setting, see Specifying Remote Process
Policies (<remoteProcess>) (p. 55).
Note
If using a shared job data directory, it is recommended that you create the workspace sub-
directory up front, and ensure that all users who will be submitting jobs have read/write
permission on that subdirectory. Additional steps may be needed depending on your security
requirements. For more information, see Access and Permission Requirements of the Job
Data Directory (p. 131).
In Windows:
• The job data directory must be a shared directory, specified by a UNC path in the jobSourceRootPath
setting.
• Make sure that this directory is open to all users who will be running RSM jobs.
• It is recommended that you create the workspace subdirectory up front, and ensure that all users have
read/write permission on this directory, so that each user’s data management process will be able to create
a user directory for that user under the workspace directory. For example, if your job data directory path is
\\RSMMANAGER\HPCTemp, and users will be submitting jobs from the Default workspace, create a De-
fault directory under the HPCTemp directory (\\RSMMANAGER\HPCTemp\Default), and set appropriate
permissions on the Default directory.
In Linux:
• The use of home directories (via a relative path) is the recommended way of handling users’ job data in
Linux. Home directories provide each user with guaranteed access to his or her own job data, while preventing
unwanted access by other users. The home directory is accessible by RSM, and the permission requirements
are satisfied because users have read/write access on their own home directories.
• You may choose to use a shared job directory (via an absolute path) instead of home directories. This may
be less secure, however, because users could potentially have access to each other’s data. If you do choose
to use a shared job directory, it is recommended that you create the workspace subdirectory up front, and
ensure that all users have read/write access on this subdirectory. Although not necessary, for tighter security
you may also want to create user subdirectories up front and grant each user full read/write permissions on
his or her user subdirectory rather than the workspace directory. Keep in mind, however, that if you remove
read/write permissions on the workspace directory, you will need to create user subdirectories for any new
users who will be added to EKM later on, and set up appropriate permissions on those directories.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 131
Integrating EKM with Remote Solve Manager (RSM)
It is important to ensure that all users have at least access (execute) permission on all parent folders
in the chain, right up to the top level. Consider the path /someshare/folder1/jobRoot/De-
fault. If you granted users read/write permissions on the jobRoot and Default folders, but did
not grant them access permission on folder1, job submission would fail for those users.
For information about specifying the jobSourceRootPath setting, see Specifying Remote Process
Policies (<remoteProcess>) (p. 55).
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
132 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 9: Defining EKM Servers, Queues, and External Applications
The /Administration/Servers page contains a built-in job submission server named Master, and is
also the page where you would add a cache server if using one.
The built-in Master server contains the installed Data Extraction Queue named EKM Server, and
may contain any number of job submission queues. A job submission queue can be batch or interactive.
For more information about queues, see Types of Queues (p. 136).
Each queue contains application definition files (*.app.xml files) that will launch external applications
from EKM.
This chapter describes how to create and define servers, queues, and external applications in EKM.
However, it does not explain how to modify process-related configuration settings in the ekm.xml file
that may be required for your system. These are listed below.
• localProcess: Specifies settings for applications that are run locally on the EKM server.
• remoteProcess: Specifies settings for applications that are run remotely through ANSYS Remote
Solve Manager (RSM), or through EnginFrame. This is required only if you want to configure EKM to
use RSM for remote execution, or if you want to provide users with the ability to run interactive jobs
from EKM.
Specific usages of external applications are covered in detail in other chapters in this Administration
Guide and in the User’s Guide. Refer to Defining Process Templates in EKM Studio in the User’s Guide for
using external applications in process templates and batch processes.
The high-level steps required to configure EKM for launching external applications are listed below.
• Specify the process-related configuration settings in the ekm.xml file (see Specifying General Server
Settings).
• For batch jobs, install and configure RSM as explained in Installing RSM for use with EKM (p. 116).
• For interactive jobs, install and configure EnginFrame as explained in Installing and Configuring Engin-
Frame in the EKM Installation Guide.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 133
Defining EKM Servers, Queues, and External Applications
• Create batch job submission queues in EKM that correspond to RSM queues, and interactive job sub-
mission queues that correspond to queues defined in the ekm.xml file. This is done automatically at
startup. See Synchronizing Job Submission Queues (p. 137).
• Set permissions on queues to control which users may submit jobs to them (see Editing Permissions).
• Define applications in the desired queue as explained in Defining External Applications (p. 139).
This chapter presents information on how to set up EKM servers, queues, and external applications.
Topics include:
9.1. Adding EKM Servers
9.2. Defining EKM Cache Servers
9.3.Types of Queues
9.4. Managing Queues
9.5. Defining External Applications
9.6. Running Interactive Jobs in EKM
Every EKM Server has a built-in EKM Server object of type JobSubmissionServer named
Master. The Master server is located on the /Administration/Servers page.
The Master server is where EKM is running, and is defined by the host name and port that EKM is
running on. This server will be used to submit all batch jobs from EKM to RSM, and all interactive
jobs from EKM to EnginFrame.
• Cache Server
Cache Servers may be added to represent instances of EKM running on other machines and can be
used when you want to assign another EKM server as a cache server for some users. They have an
object type of CacheServer. You may not submit batch jobs to these remote EKM servers. All jobs
must be submitted using the Master server.
1. From the main drop box, select Administration, then select the Servers page.
2. Select (New) > Cache Server. This opens the New EKM Cache Server dialog box.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
134 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining EKM Cache Servers
3. Enter a name for the new server that is to be added (for example, RemoteServer1). The server name
is an identifier used by EKM to refer to that server.
4. Enter the fully qualified host name of the server (for example, server1.domain.com).
5. Enter the port number for the port that the EKM Server on that host is running on.
6. Select the users to assign to this cache server. All selected users will make use of this cache server for their
file transfers. You may also assign the cache server for a user when creating a new user. See Adding and
Modifying Users (p. 11).
7. Click OK. A new server of type Cache Server is created on the Administration/Servers page.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 135
Defining EKM Servers, Queues, and External Applications
These queues are used to run batch jobs in EKM. In order to run batch jobs, there must be a Batch
Job Submission Queue for every queue in RSM that you want to use. The name of the EKM queue
should match the name of a queue defined in RSM. Batch jobs submitted to the EKM queue will be
sent to the queue of the same name in RSM.
To automate the process of creating batch job submission queues, EKM provides a Synchronize
Queues action for the Master server. This action will automatically create queues in EKM’s /Admin-
istration/Servers/Master folder for all queues defined in RSM. This is the only way to create
batch queues in EKM, and is covered in Synchronizing Job Submission Queues (p. 137).
These queues are used to run interactive jobs in EKM. Interactive queues are defined in the ekm.xml
file. Queues defined in this file will be automatically created in the /Administration/Servers/Master
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
136 of ANSYS, Inc. and its subsidiaries and affiliates.
Managing Queues
folder when the EKM server starts. If you accidentally delete an interactive queue, you can use the
Synchronize Queues action to restore it.
For batch job submission queues, the synchronization process works as follows:
1. EKM contacts RSM so that it can compare the queues defined in RSM with the Batch Job Submission Queues
defined in EKM on the /Administration/Servers/Master page.
2. If there are any queues in RSM that are not defined in EKM under /Administration/Servers/Master,
they will be created in EKM.
3. If a queue is defined in EKM but is not defined in RSM, a notConfigured status flag is set for the queue
in EKM. In /Administration/Servers/Master, you will see a warning icon next to the queue
and the corresponding tool tip will indicate" Queue not configured in RSM."
Important
Any queues that are marked as notConfigured will be unavailable for job submission.
Users will not be able to send jobs to these queues as they do not exist in RSM. If this queue
is later defined in RSM and you synchronize from EKM again, the notConfigured status
flag will be cleared and the queue will be available for job submission.
Note
• During synchronization, the EKM Server Data Extraction Queue is ignored (see Types of
Queues (p. 136)). Only Job Submission Queues are synchronized.
• During startup, the EKM server will synchronize the queues for all workspaces. Each workspace
stores its own queue definitions, so they all will be synchronized.
• RSM always defines a queue named Local that is mapped to an RSM compute server running
on the host "localhost", so you can always expect to see a queue named Local defined in EKM.
In addition to the synchronization performed at startup, an EKM administrator may synchronize queues
at any time from the EKM interface. This may be necessary, for example, if a queue has been accidentally
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 137
Defining EKM Servers, Queues, and External Applications
deleted in the current session. Unlike the automatic synchronization performed at startup, on-demand
synchronization only synchronizes the queues in the current workspace.
To synchronize queues for the workspace you are currently logged into, do the following:
2. Click the synchronize queues button on the toolbar. This displays a dialog reporting the progress of
the synchronization.
1. Go to Administration/Servers/Master and select the queue whose settings you would like to define.
2. Select (Edit) > Job Submission Settings. The Edit Job Submission Settings dialog box appears.
• Native RSM – RSM itself is the batch system (this is the default value)
• IBM LSF
• Altair PBS
• Torque
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
138 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining External Applications
• SGE
Note
Note that in order to run jobs on the RSM compute server, the RSM server must be
running on a 64-bit Linux system. Also, the VNC password must be set.
• IBM LSF
• NICE Neutro
• Altair PBS
• Torque
• SGE
Note
The operating system of interactive queues is specified in the ekm.xml file, and is
therefore predetermined and non-selectable in the Edit Job Submission Settings
dialog box.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 139
Defining EKM Servers, Queues, and External Applications
and associated with a particular Queue (p. 136). Queues are used to specify different locations where
applications are run.
Important
Any application that you define must be accessible on all compute hosts where the batch
job may ultimately run. For example, if you define an application for a queue named
TestQueue, and RSM has two compute servers available to run jobs submitted to TestQueue,
then both of these compute servers need to be able to access the application that will be
run.
When you select a queue in the file list window, any external applications associated with that queue
are listed. In this way the queue object acts like a folder in the file list window, and that folder can
contain external application files. For example, if there were an application named myApp.app.xml
that was associated with a queue named MyQueue1 under the Master server, the path to that applic-
ation would be:
/Administration/Servers/Master/MyQueue1/myApp.app.xml
Important
The predefined applications in the EKM_HOME/conf/applications folder are loaded into the Data
Extraction queue at /Administration/Servers/Master/EKM Server the very first time that
EKM is started.
When defining settings for a Job Submission queue, you can choose to automatically load the predefined
applications in the EKM_HOME/conf/jobSubmissionApplications folder into the queue that
you are defining.
Some external applications (such as graph generation) are bundled with EKM, while other applications
are required to be installed on the server. See the EKM Installation Guide for a complete list of applications
that require installation. The AWP_ROOT170 environment variable must be correctly set in order to run
these installed applications. This environment variable is set automatically on Windows systems. To
learn how to set it on Linux systems, see Set the Location of ANSYS 17.0 Applications.
• ansys.app.xml: This is the ANSYS executable and is used for extracting metadata and reports from
Mechanical APDL files. You will need to specify the correct location of this application on the server.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
140 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining External Applications
• caeinterface.app.xml: This application is bundled within EKM and is used to extract metadata
and reports from some non-ANSYS file formats such as Abaqus and Nastran. You do not need to con-
figure this application.
• cfx5dfile.app.xml: This application is part of the CFX installation and is used for extracting
metadata and reports from CFX files. You will need to specify the correct location of this application
on the server.
• cfx5post.app.xml: This is the CFD Post executable and is used for extracting images from CFX
files. You will need to specify the correct location of this application on the server.
• cfx5pre.app.xml: This application is part of the CFX installation and is used for extracting images
from CFX files. You will need to specify the correct location of this application on the server.
• extractCaxImage.app.xml: This application is used to extract VCollab’s CAX file from simulation
files for 3D visualization. To make CAX extraction possible, you need to have VMoveCAE installed on
the EKM server. Note that this not the default image extractor in EKM. In order to extract CAX files you
must specify image attributes for each built-in or custom file type from which you want to extract CAX
images. For details see Using VCollab for 3D Visualization in EKM (p. 255).
• fluent.app.xml: This is the Fluent executable and is used for extracting reports from Fluent files.
You must specify the correct location of this application on the server. You will also need to specify the
appropriate command line parameters for running this application in the background. The –hidden
parameter is used for running it in the background on a Windows server. You will need to change this
parameter to –g for Linux. The –post parameter is used for running Fluent in postprocessing mode,
only. You will need to remove this parameter or create a new application definition if you need to run
the Fluent solver.
• jython.app.xml: This application is bundled with EKM and is used to execute Python scripts. You
do not need to configure this application.
• polyflowReport.app.xml: This application is bundled with EKM and is used to extract reports
from Polyflow files. You don’t need to configure this application.
• vrml2gltf.app.xml: This application is bundled within EKM and is used to convert VRML models
extracted from Fluent and MAPDL files to the glTF format that is used by EKM’s 3D image viewer.
• workbench.app.xml: This is the Workbench executable that is used for extracting metadata and
reports from Mechanical Database (.dsdb, .mechdb, .mechdat) and Workbench Project Archive
(.wbpz) files.
Important
You should not edit the files in the EKM_HOME/conf/applications folder because the
changes will not be applied to instances of those files in EKM. If you want to make changes
to an application definition, you should do so only from within EKM using either the Edit >
External Application or Edit > Content action.
Important
You should not change the application key name for any of the predefined applications. If
the key name is changed, EKM will be unable to find the application.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 141
Defining EKM Servers, Queues, and External Applications
The next sections, Defining External Applications Using XML (p. 145) and Defining External Applications
Directly in EKM (p. 142), describe two methods of creating your own external application definitions.
1. Go to the Administration/Servers/Master and select the queue with which you want to associate the
external application.
2. Select (New) > External Application. This will open the New External Application dialog box, shown
below.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
142 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining External Applications
3. Enter the Application key, Application name, Execution path, 0 or more Command line parameters,
0 or more Environment variables and optional Job submission options. Click the Add buttons to add
more parameters or environment variables. Environment variables are specified as a name and value.
Click the Remove buttons to remove parameters or environment variables.
Important
• It is highly recommended that you specify a different Application key and Application name
in each external application file that you define. (Do not use the same key or label in more
than one file.) This ensures that applications are uniquely identified when they are displayed
in a list, and ensures that the correct execution path is used.
• On Windows compute servers, any parameter that contains a space (for example, a file path)
should be enclosed in double quotation marks “” to ensure that it is treated as a single
parameter. Otherwise, the job may fail.
Application key
A string that identifies the application. For example, when you execute a batch task in a process,
custom application or analysis project, the Application key name that you specify here is used to execute
the application.
Application name
The name that will be used to identify the application in the interface (for example, in the Execute
Job dialog box, in the Job Details view, or the Edit Batch Node dialog box).
Execution path
The full path to the application executable on your local file system.
Environment variables
Variables that can be added and will be defined when the command is run. These variables only exist
while the command is executing.
4. When you have finished defining your new external application, click Create & Close to create the applic-
ation and exit the dialog box, or Create & New to continue to create more applications.
The application will be automatically saved as an XML file with the file extension .app.xml in the
queue’s folder, with the name that is specified for the Application key. In our example, the applic-
ation file myAppKey.app.xml is saved as: /Administration/Servers/Master/Local/myApp-
Key.app.xml
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 143
Defining EKM Servers, Queues, and External Applications
1. Select the queue with which the application is associated. Queues are located in the /Administration/Serv-
ers/Master folder.
2. Right-click and select Edit > External Application from the context menu. This will open the Edit External
Application dialog box.
3. Make any changes to the Application key, Application name, Execution path, Command line paramet-
ers, Environment variables and Job submission options and then click OK to save your changes.
Important
On Windows compute servers, any parameter that contains a space (for example, a file path)
should be enclosed in double quotation marks “” to ensure that it is treated as a single
parameter. Otherwise, the job may fail.
1. Select the queue with which the application is associated. Queues are located in the /Administration/Serv-
ers/Master folder.
2. Right-click and select Edit > Content from the context menu. This will open the Edit Content dialog box.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
144 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining External Applications
3. Make the desired changes to the file content, and then click OK to save your changes.
If you want, you can also download the file first, modify it in an XML or text editor, and then upload
the file and overwrite the existing application definition with the modified one.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 145
Defining EKM Servers, Queues, and External Applications
application.xsd consists of a root element named applications that contains one application ele-
ment. The application element consists of a key, execPath, 0 or more param elements, 0 or more
env elements and an optional nativeOptions element.
key
Used to identify the application. For example, a batch node in a process will use the key to refer to a par-
ticular external application.
label
The name that will be used to identify the application in the interface (for example, in the Execute Job
dialog box, or in the Job Details view).
execPath
Defines the full path of the application executable. This must correspond to the fully qualified application
path on the execution host.
param
Can be used to specify command line parameters. Each command line parameters is defined separately.
You should not define just a single parameter and use space as a separator for multiple parameters.
env
Can be used for environment variables. Each env element consists of a name and value attribute.
nativeOptions
Specifies any batch submission system-specific options. This is useful if you integrate with a queuing or
batch submission system such as LSF and you want to specify some additional parameters for controlling
the job execution. You can use the nativeOptions element to control the resources granted to a batch
job (such as OS type, number of nodes, minimum RAM, and so on). For example, for an SGE system, you
could define:
<nativeOptions>-hard -l arch="lx24 amd64"</nativeOptions>
to specify that the job can run only on machines matching that architecture.
<xsd:complexType name="NameValue">
<xsd:attribute name="name" type="xsd:string" use="required" />
<xsd:attribute name="value" type="xsd:string" use="required" />
</xsd:complexType>
<xsd:complexType name="Application">
<xsd:sequence>
<xsd:element name="key" type="xsd:string"/>
<xsd:element name="label" type="xsd:string" minOccurs="0"/>
<xsd:element name="execPath" type="xsd:string"/>
<xsd:element name="param" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="env" type="ekmApplication:NameValue" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="nativeOptions" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="Applications">
<xsd:sequence>
<xsd:element name="application" type="ekmApplication:Application" minOccurs="1" maxOccurs="1"/>
</xsd:sequence>
</xsd:complexType>
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
146 of ANSYS, Inc. and its subsidiaries and affiliates.
Running Interactive Jobs in EKM
</xsd:schema>
Once you have defined an application in an XML file and saved it with the .app.xml or .appxml file
extension, you can upload it to an existing queue. EKM will recognize the file as an External Application
type based on its file extension.
The content of the sample application named myAppKey.app.xml is shown in Figure 9.7: myApp-
Key.app.xml listing (p. 147).
When configuring external applications, you can use the syntax {$ENV_NAME} to include the value of
an environment variable while defining any of the application’s element values such as execPath,
param, or env.
Important
Always use the forward slash (/) as a path separator in all configuration files even when
running EKM on Windows.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 147
Defining EKM Servers, Queues, and External Applications
The following steps are required to enable interactive job performance in EKM:
• An administrator must install and configure EnginFrame. For details see Installing and Configuring EnginFrame
in the EKM Installation Guide.
• An administrator must configure EKM to integrate with EnginFrame. For details see Configuring EKM to
Work with EnginFrame in the EKM Installation Guide.
• An administrator may optionally define additional applications in the interactive queues that are created
in EKM on startup. By default, interactive queues are created with a single predefined application called
remoteDesktop.app.xml, which launches an empty remote desktop session. For details see Creating
a New External Application (p. 142).
• Users must install the remote visualization client on their computer or mobile device. See Table 9.2: Remote
Visualization Technologies Supported by EnginFrame in the EKM Installation Guide.
When an interactive session is started, the user will be prompted to select an application to launch (for
example, ANSYS Workbench). A job object will be created on the user’s Jobs/Job Monitor page, and
from there they will be able to connect to the remote session. The selected application will then launch
remotely on the user’s desktop.
For more information, see Running an Interactive Job in the EKM User’s Guide.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
148 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 10: Configuring EKM Mobile
EKM Mobile is an application designed for cell phones and tablets. With it, users can sign in to an EKM
server and view files, reports, and objects, perform searches, monitor and control jobs, create design
points, and control remote Workbench jobs.
• With the Mobile Connector running on the same host as the EKM Server
• With the Mobile Connector running on a host that is not the EKM Server
• A single Mobile Connector can act as an access point for multiple EKM Servers.
• The Mobile Connector can run on an Internet-accessible host (for example, in your company's DMZ), while
the EKM Servers remain unexposed to Internet traffic.
Note
Running the Mobile Connector on a host other than the EKM Server is a beta feature that
has not been fully tested.
10.1. Running the Mobile Connector on the Same Host as the EKM Server
To configure the server to accept EKM Mobile connections:
1. In the ekm.xml file, which is located in the EKM_HOME/conf folder, uncomment the sections:
<mobileConnector>
<ekmServer serverName="ekm" serverKey="" />
</mobileConnector>
<mobileServer>
<mobileConnectorUrl></mobileConnectorUrl>
<serverName>ekm</serverName>
<serverKey></serverKey>
</mobileServer>
Leaving the <mobileConnectorUrl> element blank causes the <EKM URL> value to be used
as the Mobile Connector URL, which works for this single-server scenario.
Users can now access the server from EKM Mobile at:
<EKM URL>/m/
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 149
Configuring EKM Mobile
For more information, see Using EKM Mobile in the EKM User’s Guide.
10.2. Running the Mobile Connector on a Host Other than the EKM Server
If you run the Mobile Connector on a host other than the EKM server, the Mobile Connector can be
used as an access point for multiple EKM servers. If you run the Mobile Connector on an Internet-access-
ible host (for example, in your company’s DMZ), the EKM servers will not be exposed to Internet traffic.
Note
Running the Mobile Connector on a separate host is a beta feature that has not been fully
tested.
1. In the Mobile Connector’s ekm.xml file, which is located in the EKM_HOME/conf folder, uncomment
the section:
<mobileConnector>
<ekmServer serverName="ekm" serverKey="" />
</mobileConnector>
2. For every EKM Server that will use this Mobile Connector, add an <ekmServer> element that specifies
a unique serverName attribute and a serverKey attribute. The serverKey attribute can be any string, and
is used as a like a password to authenticate messages. An example where one Mobile Connector connects
to three EKM Servers might look like:
<mobileConnector>
<ekmServer serverName="ekm1" serverKey="password1" />
<ekmServer serverName="ekm2" serverKey="password2" />
<ekmServer serverName="ekm3" serverKey="password3" />
</mobileConnector>
2. Enter the URL of the Mobile Connector in the <ekmConnectorUrl> element. (For example: http://mobile-
host:8080/ekm)
3. Enter the serverName and serverKey attributes for this server that were entered in step 1 of this procedure.
An example might look like:
<mobileServer>
<mobileConnectorUrl>http://mobile-host:8080/ekm</mobileConnectorUrl>
<serverName>ekm1</serverName>
<serverKey>password1</serverKey>
</mobileServer>
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
150 of ANSYS, Inc. and its subsidiaries and affiliates.
Running the Mobile Connector on a Host Other than the EKM Server
Users can now access the EKM Servers from EKM Mobile at:
For more information, see Using EKM Mobile in the EKM User’s Guide.
Note
When logging into EKM Mobile, users will specify the serverName of the EKM Server to which
they want to connect (for example: ekm1, ekm2, or ekm3).
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 151
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
152 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 11: Defining and Configuring Lifecycles
A lifecycle is a set of stages that an EKM object moves through during its life, where each stage is
connected by one or more transitions. When an object is in a particular lifecycle stage, predefined
policies such as permissions and automatic deletion settings are applied to the object and its descendants.
Signoff processes can also be defined for a transition that requires that an object undergo review and
approval by an individual or committee before it can be promoted to the next stage. Signoff committee
members are sent email alerts notifying them that review and approval is needed, and a new task is
added to their My Tasks page. In addition, an instance of the signoff process is placed on the Process
Monitor page and can be used to monitor the approval process. Multiple levels of signoffs can also be
defined for a lifecycle.
Once a lifecycle is defined for an object type, it needs to be configured for a workspace by the user
designated as the Root User before it can be used. Once configured and enabled, any object of that
type that is uploaded or created in EKM will have the predefined lifecycle associated with it.
This chapter describes how to define lifecycles graphically in EKM Studio. For instructions on defining
lifecycles manually using XML, see Appendix C (p. 291).
You can define a lifecycle for any object type in EKM and you can use the lifecycle to track an object
as it matures. Figure 11.1: Sample Lifecycle Graph (p. 154) shows an example of a four-stage lifecycle
graph.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 153
Defining and Configuring Lifecycles
Lifecycle stages are promoted and demoted automatically by EKM or by a user/group based on comple-
tion criteria that are specified in the lifecycle definition. For example, you can specify completion criteria
that require an object to undergo review and approval by committee members before the stage can
be changed. This is referred to as a signoff process. A signoff process is automatically generated by EKM
whenever a request for stage promotion or demotion is made. Individuals and/or committee members
are sent an email notifying them that action is required. The email provides a link to the task for easy
access and the task is also placed on the assignee's My Tasks page. An object can also require multiple
levels of review and approval before it can be promoted (or demoted) to the next stage. For example,
you can define a stage that requires an initial level of signoff by, say, all members of a Design Review
Team and Project Manager followed by a second level of approval from, say, the VP of Engineering.
You can define lifecycle templates in two different ways: graphically in EKM Studio, and using XML. The
easiest method is to use EKM Studio. When saved to your local file system or an EKM repository, the li-
fecycle you define in EKM Studio is converted to XML and the file is typed as a Lifecycle (p. 283) object
and given the .lc.xml file extension.
You can also define a lifecycle file in XML, using any XML or text editor. See Appendix C (p. 291) for details.
Lifecycle files behave like any other object in EKM with respect to being able to be tagged with user-
defined properties, placed under version control, and searched for using a keyword and advanced
search criteria.
Once a lifecycle has been defined and saved as an XML file, it will need to be configured for your
workspace before it can be used. The configuration process associates the lifecycle with all the object
types that it is defined for. The lifecycle then either gets automatically enabled for all objects in the
repository belonging to that type, or the lifecycle will require manual enabling for individual object,
depending on how it has been defined. See the Restricted and Unrestricted Configuration of Workspaces
chapter in the Administration Guide for more details.
Stages
Stages are phases within a lifecycle where you can set permissions for who can access, modify
or do other operations on an object and set criteria for automatic deletion of the object from
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
154 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Lifecycles in EKM Studio
the connected EKM repository. They are represented in a lifecycle diagram with the icon shown
above.
• Lifecycles should have exactly one start stage. A “start” stage is the stage that is not the
destination of any transition. Lifecycles can have more than one end stage. An “end” stage
is the stage that is not the source of any transition.
• Lifecycles must be acyclic. For example, if you have a transition from stage A to stage B, then
you cannot have a transition from stage B to stage A. Similarly, if you have defined transitions
from stage A to stage B and from stage B to stage C, you cannot have a transition from stage
C to stage A. Lifecycles are always directed acyclic diagrams.
Transitions
A transition is a link between a starting stage (source) and an ending stage (destination). It is
used to specify the subsequent and preceding stages of a lifecycle stage. A transition can also
optionally specify a signoff process for moving to the next stage. Transitions are represented
in a lifecycle diagram as an arrow.
Signoff Process
A signoff process is a separate process automatically generated by EKM when completion criteria for
a stage transition require that the object undergo review and approval before being promoted or
demoted. Members are sent an email notifying them that an action is needed, and a new task is placed
on their My Tasks page.
2. Upload the lifecycle file to the repository. It will be assigned the Lifecycle type.
3. (admin group members only) Configure the lifecycle file (p. 176) for the workspace.
4. Enable the lifecycle (p. 166) for an object type if it was not automatically enabled when it was configured
for the workspace.
5. Display (p. 167) the lifecycle for an object, promote (p. 170) or demote (p. 171) a lifecycle stage, manage
signoff requests (p. 172), and set a lifecycle stage (p. 175) (admin only).
For an overview of EKM Studio, see The EKM Studio Environment in the EKM User’s Guide.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 155
Defining and Configuring Lifecycles
1. Open EKM Studio, as described in Launching EKM Studio in the User’s Guide.
If you see a pop-up that gives you the option of opening LaunchStudio.jnlp or saving the
file, select the Do this automatically for files like this from now on option, select Open with
Java(TM) Web Start Launcher (default), and click OK.
If you are already in EKM Studio and have another item open, select File > New > Lifecycle.
2. Insert a start stage using the Insert Stage action and add additional stages to build your diagram. See
Inserting New Stages (p. 156).
3. Add transitions between stages using the Insert Transition action. See Inserting New Transitions (p. 160).
4. Edit the stages and transitions to further define them. See Editing Stages (p. 157) and Editing Trans-
itions (p. 160).
5. Select Edit > Lifecycle Attributes to define the object types to which the lifecycle will be applied. See
Editing Lifecycle Attributes (p. 165).
6. Select File > Save As to save the lifecycle file to your local file system or to an EKM Repository. The lifecycle
is saved as an XML file with the .lc.xml extension. See Saving Lifecycle Files (p. 164).
Actions associated with lifecycle stages are presented in the following sections. Topics include:
11.4.2.1. Inserting New Stages
11.4.2.2. Editing Stages
11.4.2.3. Renaming Stages
11.4.2.4. Deleting Stages
To insert a stage in a lifecycle diagram, click on the toolbar. Then, double-click the stage
to edit it. See Editing Stages (p. 157) for details.
If an existing stage is currently selected when you insert a new stage, the new stage will be placed next
to the existing stage, and a transition will be automatically inserted between the two stages. If no stage
is selected when you insert a new stage, the new stage will be placed at the beginning of the diagram
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
156 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Lifecycles in EKM Studio
and can then be dragged to the desired position within the diagram. In the latter scenario you will
need to manually insert a transition (p. 160) between an existing stage and the new stage.
You can drag and drop stages to arrange them in a particular order. This is particularly necessary when
a new stage inserts on top of an existing stage.
Note
You cannot insert a stage if the current selection is a transition. If you attempt to do this,
the following dialog will be displayed:
In this case, click OK and then either click in blank space or select an existing stage to connect
the new stage to.
Once a stage is inserted, it will be listed in the Stage folder in the Elements tree, and its properties
will be displayed in the Properties window.
To edit a stage:
1. Double-click the stage in the lifecycle diagram, or right-click the stage in the diagram or tree and select
Edit from the context menu. The Edit Stage dialog box will appear:
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 157
Defining and Configuring Lifecycles
2. In the Name edit box, enter a name for the stage as you would like it to appear in the diagram and tree.
Names cannot contain these characters:
/ \ : [ ] * ' " |
3. In the Description edit box, enter a description to help identify what will happen during the stage (op-
tional). The description will be displayed when you mouse over the stage in the diagram, and in the
Properties window when the stage is selected.
4. If you want the object to be automatically deleted from the repository within a certain number of days,
check the Delete automatically box. Then, in the Expiration days edit box, specify the number of days
after which the object should be automatically deleted from the repository. Usually this will only be spe-
cified in the last phase of the lifecycle, if you want an obsolete object to be automatically deleted after a
certain period of time. If you leave this value at 0, the object will not be deleted automatically and will
be preserved indefinitely.
5. To allow the object to become part of the previous stage, check the Demote Allowed box.
6. In the Permissions pane, set permissions for the stage. To set permissions, click the Insert link to add an
entry to the Member list, then click the drop box to select a user or group member. You can also use *
to specify the user who created the object. Once you have selected a user you can check the boxes of
permissions that you want that user to have.
• Access: Specifies who can access (or view) this object. By default this is selected and users cannot
change this setting. However, other permissions can be granted.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
158 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Lifecycles in EKM Studio
• Lifecycle: Specifies who can perform lifecycle operations such as promote and demote.
• Full Control: Specifies who has full control over the object. Full control means all permissions
are available, including the ability to change permissions.
Note
• Object-level permissions will only be granted to users who have an appropriate license
checked out. For example, a user with an Analyst license will not be able to modify an
object even if he or she has been granted Modify permission on the object. He or she must
have a Shared license checked out to be able to modify the object.
• If an object associated with a lifecycle is not accessible because the parent folder containing
the object does not provide access permission to sign-off members or lifecycle users, those
users cannot "Promote" the stage. To enable the ability to promote, give the required users
at least Access permission to the parent folder.
7. Click OK.
To rename a stage:
2. In the Rename dialog box, enter the desired name for the stage in the New name edit box.
3. Click OK.
When you delete a stage, the transitions connected to it will also be deleted.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 159
Defining and Configuring Lifecycles
To edit a transition:
1. Double-click the transition in the lifecycle diagram, or right-click the transition in the diagram or tree and
select Edit from the context menu. The Edit Transition dialog box will appear.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
160 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Lifecycles in EKM Studio
2. Specify any macros that are to be used for performing actions associated with promote/demote requests.
The types of macros that you can specify are described below. See Using Macros in Lifecycle Defini-
tions (p. 162) for details on how to define macros.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 161
Defining and Configuring Lifecycles
3. Define the signoff processes for promoting and demoting the object. Only the person who created the
process can promote it. You can create a multi-level signoff process by adding any number of signoff
elements to the Promote signoff or Demote signoff window pane. In the example shown in Fig-
ure 11.3: Edit Transition Dialog Box for a Lifecycle (p. 161), there are two levels of signoff defined for stage
promotion: Level 1 is required by all members of the Design Team; and Level 2 by the Develop-
ment Manager. The first level must be completed before the next one can begin.
Click Insert to add rows to the Promote signoff or Demote signoff table. To remove a row, select
it and click Delete. Once an entry has been added to a table, you can define its properties:
• Level: Specifies the name of signoff level. There are no character restrictions for the level definition.
Double-click in the Level text box to enter/edit the name.
• Members: Specifies the names of users and groups who are involved in the signoff at this level. If you
specify more than one user or group, you will need to separate their names by a comma. Single-click
in the Members box and a drop-down list of available members will be displayed (drop-down list not
shown in Figure 11.3: Edit Transition Dialog Box for a Lifecycle (p. 161)).
• Inclusive: Specifies whether or not all Members for this level need to approve the signoff. If the Inclusive
box is checked, then ALL Members must approve the signoff. If it is cleared, then any member can
approve the level signoff.
• Due Days Specifies the number of days allowed for the signoff. If a user has not approved or a rejected
the signoff by then, a daily reminder mail is sent to the user. Double-click in the Due Days box to
enter/edit the amount of time the Members have to complete the signoff process.
To define a macro, select Edit > Script, then type your script in the Edit Script dialog box. Note that
you do not insert the <script> tag in the macro definition; this is added automatically by EKM Studio.
You should define the macro using the scripting language (Python or Beanshell) displayed above the
editing window. The scripting language for a lifecycle is set in your lifecycle attributes (p. 165).
The example below shows the script for a BeanShell macro named solveOnce.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
162 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Lifecycles in EKM Studio
The name that you define for the macro in the script can then be entered in the Edit Transition dialog
box so that it can be utilized.
Note
Jython imposes a limit of 100 KB per script file. To avoid lifecycle errors it is recommended
that you create scripts using the EKM scripting interface and store them in the Scripts folder
on the Administration/Configuration page. For details see Using EKM's Scripting Inter-
face (p. 179). Storing scripts in a centralized library makes them available for any process
template, lifecycle, or custom type. See Configuring a Common Scripts Library (p. 251) for
details.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 163
Defining and Configuring Lifecycles
Note
1. Select File > Save. If the current lifecycle has been saved previously, and you want to save it under a dif-
ferent name, select File > Save As > Local File.
2. In the Save dialog box, select a save location and specify a file name.
3. Click Save.
2. In the Save Lifecycle dialog box, enter a name for the lifecycle in the File name edit box. You do not
need to include the extension. If you are in restricted configuration mode, the lifecycle will be saved in
the Lifeycles folder on the Administration/Configuration page.
3. Click Save.
To open a lifecycle file that is located on your local file system, select File > Open > Local File, then
choose the file in the Open dialog box.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
164 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Lifecycles in EKM Studio
1. Select Edit > Lifecycle Attributes from the menu bar to open the Edit Lifecycle Attributes dialog box.
3. Click in the New Type box and select an object type from the drop-down list.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 165
Defining and Configuring Lifecycles
4. If you want an object of that type to be enabled automatically by EKM whenever it is uploaded to a repos-
itory or created, check the Enabled by default box. If you do not enable an object type by default, then
the lifecycle can manually be enabled by any user who has Lifecycle permission for the object using
the Enable Lifecycle action. See Enabling Lifecycles (p. 166) for more details.
5. From the Language drop box, select the scripting language (Python or BeanShell) that you would like to
use for macros and expressions.
Python is a powerful and easy-to-use scripting language that is becoming very popular. EKM uses
Jython 2.5.2 to handle Python syntax. To learn more about Jython, refer to http://www.jython.org/
index.html. To learn more about Python, refer to http://www.python.org. Jython 2.5.2 allows the
use of Python 2.5 language features. In addition you can use any Java classes offered by JDK 1.7.
BeanShell is a scripting language that can execute code written in standard Java syntax while
providing scripting conveniences such as loose types. For more information on BeanShell and to
see its detailed documentation, refer to http://www.beanshell.org. With BeanShell you have full
access to all classes provided by Java’s JDK. EKM uses JDK 1.7, so you can use any of its classes in
macros defined using BeanShell.
If you change the Language setting, you will be prompted to edit any existing macros and expres-
sions after you click OK in the Edit Lifecycle Attributes dialog:
All expressions and scripts in the lifecycle should be consistent with the Language specified in
your lifecycle attributes. If you have not defined any macros or expressions in the current lifecycle,
you can disregard this warning message.
6. Repeat this process to add more object types to the lifecycle template. To remove a type, select it in the
list and click Delete.
If a lifecycle has been defined for a parent object but not for a child object, then the child will automat-
ically inherit its parent’s lifecycle.
Important
Once a lifecycle is enabled, the lifecycle permission policies that are defined in the life-
cycle XML file are applied to the object, and will override any other permissions that
were previously set for the object using Edit > Permissions. The Enable Lifecycle
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
166 of ANSYS, Inc. and its subsidiaries and affiliates.
Displaying Lifecycles
dialog box contains this reminder, as shown in Figure 11.7: Enable Lifecycle Dialog
Box (p. 167). Note that lifecycle permission policies can be subsequently overridden by
anyone with lifecycle permission for the object.
To enable a lifecycle:
1. Select the object, then select (Edit) > Lifecycle > Enable. This will open the Enable Lifecycle dialog
box.
2. Click OK.
Once a lifecycle is enabled for an object, you can display it by selecting (More) > Display > Lifecycle
on the right-click menu or toolbar. A sample lifecycle is shown below.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 167
Defining and Configuring Lifecycles
• Graph. In the graph, the current lifecycle stage is shown in white (for example, Thermal Analysis in
the sample figure). The graph elements will change color as the stage changes, giving you a visual depiction
of the object as it matures.
• Stages. The name, description and permissions of each stage in the lifecycle are listed.
• Transitions. Each transition requires a signoff before the next stage can be promoted. This is indicated under
Promote Signoff.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
168 of ANSYS, Inc. and its subsidiaries and affiliates.
Displaying Lifecycles
• History. This section shows actions that have been performed so far, along with any comments that users
have entered.
1. Click the user icon in the upper right of the window and select Settings.
2. In the Settings dialog box, select List Display in the left pane, and then check the Lifecycle stage box
in the right pane, as shown below.
3. Click OK.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 169
Defining and Configuring Lifecycles
1. Select the object, then select (Edit) > Lifecycle > Promote. This opens the Promote Lifecycle Stage
dialog box.
Note
You cannot promote an object if it is under version control and currently checked out
by a user, or if a user has exclusive control of it.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
170 of ANSYS, Inc. and its subsidiaries and affiliates.
Demoting a Lifecycle Stage
4. If the lifecycle stage requires a signoff before it can be promoted, the signoff committee members are
listed.
5. Click OK. If the object does not require a signoff, it will be immediately promoted to the next stage. If signoff
is required, a separate Signoff process will be launched.
1. Select the object, then select (Edit) > Lifecycle > Demote. This opens the Demote Lifecycle Stage
dialog box.
Note
You cannot demote an object if it is under version control and currently checked out
by a user, or if a user has exclusive control of it.
4. If the stage has a signoff process, the signoff committee members will be shown.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 171
Defining and Configuring Lifecycles
5. Click OK to demote the lifecycle stage. A separate Signoff request process will be launched if the object
requires a signoff before it can be demoted.
In the example lifecycle, a promote signoff process has been defined for three stages: Thermal Analysis,
Stress Analysis, and Lifetime Calculation. The first two stages require a single level of signoff by all
members of the Design Review Team and the Project Manager. This is a Level-1 Signoff. The Lifetime
Calculation stage requires an additional level of signoff from the VP Engineering (Level-2 Signoff). This
example lifecycle does not have any demote signoff levels defined. This means that the stage can be
demoted without approval from anyone.
If a signoff is defined for a stage transition, a separate Signoff process is automatically initiated by EKM
whenever the request is made to promote (or demote) the stage. The pending stage on the lifecycle
display graph will change color to indicate that a signoff is pending.
Objects under lifecycle control will be displayed in the List display as “locked” by the ekm_life
cycle_user while the signoff process is active, and the tool tip will indicate that the objects are ex-
clusively controlled by that user. This will ensure that no one else can modify the objects while they
are under review. ekm_lifecycle_user is a system account used by EKM to manage lifecycles.
Email alerts are sent to all members of the signoff committee (as defined in the lifecycle template) no-
tifying them that their action is required. The signoff will be listed in each committee member’s My
Tasks page in the Processes section. The signoff process can be displayed by clicking the Signoff link
in the task as shown in Figure 11.13: Level-1 Signoff Task on My Tasks Page (p. 173). The review is started
by clicking the start button on the toolbar. Once the objects have been reviewed, the committee
member can approve or reject the signoff request using the action menus. The user who initiated the
signoff request or the system administrator can also cancel an active signoff request.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
172 of ANSYS, Inc. and its subsidiaries and affiliates.
Managing Lifecycle Signoff Requests
• If a signoff requires “Any” committee member to approve it, then the first member to approve it will cause
the object to be promoted or demoted to the next stage (or advance to the next level of signoff ). If any
member rejects the request, then the signoff process is cancelled and the stage is not promoted (or demoted).
• If a signoff requires “All” members to approve it, then when any member rejects the request, the signoff
process is cancelled without promotion or demotion.
• The process initiator or system administrator cancels the signoff while the request is still pending.
When a signoff has ended (through approval, rejection, or cancellation), the process and all associated
tasks are deleted from the My Tasks page.
1. Select the signoff request on your My Tasks page, then click the approve button on the toolbar. This
will open the Approve Signoff Request dialog box.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 173
Defining and Configuring Lifecycles
2. Optionally enter acceptance comments. You can view these comments in the object's lifecycle history.
3. Click OK to approve the signoff. This will remove the level signoff request from your My Tasks page. The
approval will be logged in the lifecycle history.
1. Select the signoff request on your My Tasks page, and then click the reject button on the toolbar. This
opens the Reject Signoff Request dialog box.
2. Optionally enter rejection comments. You can view these comments in the object's lifecycle history.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
174 of ANSYS, Inc. and its subsidiaries and affiliates.
Setting a Lifecycle Stage
3. Click OK to reject the signoff. This action will cancel the Signoff process and cause the stage promotion/de-
motion request to be cancelled. The stage will roll back to its last state. It will also remove the level signoff
request from your My Tasks page. Your rejection will be logged in the lifecycle history.
1. Select the object, then select (Edit) > Lifecycle > Cancel Signoff. This will open the Cancel Signoff
dialog box.
2. Optionally enter comments. You can view these comments in the object's lifecycle history.
3. Click OK to cancel the signoff request. This action will remove the level signoff task from every member's
My Tasks page.
1. Select the object, then select (Edit) > Lifecycle > Set Stage. This will open the Set Lifecycle Stage
dialog box.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 175
Defining and Configuring Lifecycles
Note
You cannot edit the lifecycle stage of an object if it is under version control and currently
checked out by a user, or if a user has exclusive control of it.
3. Optionally, enter comments. You can view these comments in the object's lifecycle history.
1. Start restricted configuration (p. 37) if it has not already been started.
2. Upload, copy, or move the Lifecycle object that was created using EKM Studio (p. 155) or created using
XML (p. 291) to the Lifecycles folder on the Administration/Configuration page.
Note
It is recommended that you define only one lifecycle per object type.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
176 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 12: Scripts and Journals
This chapter presents information on how to define scripts in EKM using a supported scripting language
(Python or BeanShell) and using EKM's scripting interface, to enhance the standard product features.
Scripting actions include recording a journal script and running it, and executing any Python or BeanShell
script on demand. You can also use scripts in process templates, lifecycles, custom types, job templates
and custom applications to automate tasks.
macro
A method defined in a supported language that can execute a sequence of tasks or call other macros. The
arguments that a macro can be passed, and the values that it can return, will depend on the context in
which it is used. Macros can be specified in separate script files or defined within process templates, life-
cycles, custom types, and custom applications.
script
A file that is written in the Python or BeanShell scripting language that contains one or more macros.
BeanShell scripts have the .bsh extension; Python scripts have the .py extension.
journal
A special type of script file that can be created using the Scripting menu in EKM through the recording
of user interface actions. Also referred to as a journal script or a journal file. This is a Python file with extension
.jou.py.
• Embedding scripts in process templates: You can embed scripts in process template XML files to:
– Define logic that must be used in an expression but cannot be defined because it is too complex or you
want to use reuse the logic in other ways.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 177
Scripts and Journals
– Define logic for auto nodes. An auto node will execute the associated script upon activation.
• Embedding scripts in lifecycle files: You can embed scripts in lifecycle XML files to:
• Embedding scripts in custom type files: You can embed scripts in custom type XML files to:
– Define dependent properties (properties that depend on other properties) for any custom type. Example:
The options available in a “state” property may be dependent on the value of a “country” property.
– Define a macro that can be hooked to a custom type that will automatically execute whenever a new in-
stance of that type is created.
• Embedding scripts in job template files: You can embed scripts in job template files to:
• Defining custom applications using a script file: You can use a script file to define a custom application.
Two macros are needed in the file: an initialization macro that defines the variables used by the custom
application to get user inputs, and an execution macro that processes the user inputs once they are submitted
and executes some commands. See Defining and Using Custom Applications (p. 215).
• Testing/debugging process templates: You can use scripts to launch a process from a given process
template, and test tasks in the process. See Testing or Debugging a Process Template (p. 190).
• Building a common script library: A common script library can be constructed by an EKM administrator
to make its macros accessible to all users in all contexts. This is done by placing the script under workspace
configuration control on the /Administration/Configuration/Scripts page. Once the script is
placed in that location and the workspace configuration is accepted or applied, all of its macros will be ac-
cessible in all contexts: lifecycles, process templates, custom types, custom applications, and even the
Command Window. On the other hand, macros defined in a specific context such as lifecycle file, are accessible
only in that context. See the section on Configuring a Common Scripts Library in the Administration Guide
for more details.
Important
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
178 of ANSYS, Inc. and its subsidiaries and affiliates.
Using EKM's Scripting Interface
BeanShell can execute code that is written in standard Java syntax while providing scripting conveniences
such as loose types and dynamic execution. For more information on BeanShell and to see its detailed
documentation, refer to http://www.BeanShell.org. With BeanShell you have full access to all classes
provided by Java’s JDK. EKM uses JDK 1.7, so you can use any of its classes in scripts defined using
BeanShell. BeanShell script files are saved with the .bsh file extension.
Python is a powerful and easy-to-use scripting language that is becoming very popular. EKM uses Jython
2.5.2 to handle Python syntax. To learn more about Jython, refer to http://www.jython.org/index.html.
To learn more about Python, refer to http://www.python.org. Jython 2.5.2 allows the use of Python 2.5
language features. In addition you can use any Java classes offered by JDK 1.7. Python script files are
saved with the .py file extension.
In addition to the language features and libraries provided by the scripting languages, scripts can also
use a scripting interface provided by EKM. This interface exposes predefined methods that can be used
to access or modify data in EKM and execute common operations. See Using EKM's Scripting Inter-
face (p. 179) for information about the classes and methods that are available through the scripting in-
terface.
Note
A limitation of Python is that the output from a script is displayed only in the console of
your application server (for example, JBoss 7) and does not appear in the Output log in the
Open Command Window dialog box.
• EkmInterface: This is the primary interface and provides methods to get or search for existing objects,
create new objects, execute batch tasks, start and commit transactions, perform uploads, downloads,
copy, move and lifecycle operations. An instance of this interface is available as a global variable for
use in scripts. The name of the variable is ekm. For example, within a script you can call ekm.getRoot()
to get the root object of EKM.
• EkmAdminInterface: This interface extends EkmInterface. If you belong to the admin group,
the global ekm variable that you can access within scripts will be an instance of this interface instead
of EkmInterface. This interface provides additional methods to add users and groups and set lifecycle
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 179
Scripts and Journals
stage without validation or review. For example, within a script you can call ekm.addUser("tes-
tuser") to add a new user with user name "testuser."
• DialogInterface: This interface is used to define a dialog box for the web user interface. It provides
methods to add steps and variables.
• VariableInterface: This interface is used to define variables used in a dialog box. It contains
methods to get/set the value, type, label, and so on for any dialog variable.
• EkmCaeInterface: This interface provides methods to create simulation details reports. An instance
of this interface is also available as a global variable for use in scripts. The name of the variable is ekmCae.
When you are using methods provided by the scripting interface, you will need to refer to the accom-
panying API documentation to determine whether the method needs to be called within or outside of
a transaction. A transaction is a group of commands that are committed together. If any command fails,
none of the previous commands will be committed and the whole transaction will be aborted. You can
start a transaction by calling the startTransaction method of EkmInterface and you can
commit a transaction by calling the commitTransaction method of the same interface. Any method
that does not change the state of an object can be called either within or outside a transaction. Most
methods that change the state of an object are called within a transaction. Examples: setPermissions
and setProperties methods in ModelObjectInterface. Some methods must be called outside
a transaction because they start a transaction internally. Example: enableLifecycle method in Ek-
mInterface.
If you need to specify an object path when defining a script, you can obtain an object’s path from its
Details page ( (More) > Display > Details). The path is reported in the EKM Object Properties
section of that page. You can then use Ctrl + C to copy the path to your clipboard, and Ctrl + V to
paste it into the script.
Note
• When creating a Python script, you may need to add an "r" when using raw inputs. Python may
interpret some characters differently (for example, "\n" for new line, or "\t" for tab). If a string
contains these values and you want it to be interpreted as raw input, add an “r” before the string.
For example, the string that contains a path in the following line contains characters that
may be misinterpreted by Python and result in an error:
data["externalFolderPath"] = "\\networkSharedPath\new folder"
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
180 of ANSYS, Inc. and its subsidiaries and affiliates.
Using Sample Scripts Supplied by EKM
Adding an “r” before the string (as shown in bold below) specifies that you want it to be
interpreted as raw input:
data["externalFolderPath"] = r"\\networkSharedPath\new folder"
• It is the responsibility of the script/journal creator to ensure that errors and warnings are properly
handled during script execution. Errors and warnings can be retrieved from the command object
after execution using the getErrorMessages() and getWarningMessages() methods.
The sample code snippet below shows the getErrorMessages() method being used:
import java.text.DateFormat as DateFormat
df = DateFormat.getDateTimeInstance()
cmd0 = ekm.getCommandObject("downloadToExternalFolderCommandObject")
cmd0.addModel(ekm.getObjectByPath(r"/Data/Shared Data/Sample Files/README.txt"))
data = {}
data["externalFolderPath"] = r"\\networkSharedPath\new folder"
cmd0.execute(data)
errMessages = cmd0.getErrorMessages()
size = errMessages.size()
if size>0:
errString = r""
for msg in errMessages:
error= errMessages[msg]+ r": "+ msg
errString = errString+ r"\n" + error
ekm.raiseException(errString)
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 181
Scripts and Journals
Note
The scripts folder contains Python (p. 182) sample scripts. You can copy the macros defined in these
scripts to your custom scripts. However, you cannot reference a macro directly. Only when a script
from this directory is placed under workspace configuration control by an EKM admin user on the
common /Administration/Configuration/Scripts page, will its macros be globally available
in all contexts. See the section on Configuring a Common Scripts Library in the Administration Guide
for more details on how a global script library can be configured by an admin user.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
182 of ANSYS, Inc. and its subsidiaries and affiliates.
Recording Journal Scripts
test_script.py: Contains code snippets for performing a variety of operations. If an EKM admin
user places the test_script.py file under workspace configuration control (see Configuring a
Common Scripts Library), then any user can simply use the name of the macro when defining a
custom script.
Once the journal is created, you can execute it by clicking on the file, or right-clicking on it and selecting
Execute from the action menu. You can also choose to embed the script in a process template, lifecycle,
or custom type definition, use it to define a custom application or custom user interface, or execute it
on demand using the Run Journal File action from the Scripting menu.
Important
Not all actions can be recorded in a journal script in Release 17.0. Support for journaling is
currently available for the following actions:
• Copy Report Action in a Simulation Details Report view for a CAE file (Copy Report Object)
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 183
Scripts and Journals
• Delete Object
• Edit > Type (multiple objects of same type selected: Change Multiple Types)
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
184 of ANSYS, Inc. and its subsidiaries and affiliates.
Recording Journal Scripts
• Execute Batch
• New > (Child Type) (Add Catalog Content for a Catalog object)
• Profile
1. In the Administration section, select Scripting > Record Journal. The Start Journal Recording dialog
box appears:
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 185
Scripts and Journals
2. Click Browse to specify the folder where the journal file will be saved. The default location is /Data/My
Data.
4. Click OK. When you record a journal, two objects will be written to the location you specify:
• An empty journal file of type EKM Journal File with extension .jou.py that does not contain any
data because you have not recorded any actions yet.
• A companion _files folder that is used as temporary storage for the recorded actions.
Note
If you start recording a journal on one browser tab, any journal-supported actions that you
perform on other browser tabs will be recorded in the same journal file.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
186 of ANSYS, Inc. and its subsidiaries and affiliates.
Example of Journal Recording and Execution
Important
Any error that occurs while executing the journal will result in an unhandled exception.
Clicking Continue when such an exception occurs dismisses the exception and returns you
to the object from which the script was executed.
2. In the Start Journal Recording dialog, select the /Data/My Data folder as the save location, and then
specify Test Journal as the journal name. Click OK.
3. Click the user icon in the top right corner of the EKM window and select Settings.
4. In the Settings dialog box, select List Display in the left pane and then enable the Lifecycle Stage
check box in the right pane to add a Lifecycle Stage column to your file list display. (Or, make other
changes to your preferences that are different than the default settings.) Click OK.
5. Stop recording the journal by selecting Scripting > Stop Recording Journal.
1. Click the user icon in the top right corner of the EKM window and select Settings.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 187
Scripts and Journals
2. In the Settings dialog box, click Restore Defaults (or return the list display preferences to their original
state). This should remove the Lifecycle Stage column from your file list display.
4. In the Run Journal File dialog box, select the Test Journal.jou.py file in your My Data folder, then
click OK. Your preferences are automatically updated behind the scenes, and a Lifecycle Stage column is
added to your file list display.
Note
A limitation of Python is that the error output from a script is displayed only in the console
of your application server (for example, JBoss 7) and does not appear in the Output log in
the Open Command Window dialog box.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
188 of ANSYS, Inc. and its subsidiaries and affiliates.
Running Python and BeanShell Scripts From a Command Window
2. Select the scripting language that you will use. Supported languages are Python and BeanShell.
3. You can copy and paste text from a script or enter the script commands directly into the Script input
box. Click the Submit button and the script commands will be immediately processed by EKM and the
submitted script, as well as any output, will be displayed in the Output log.
4. To load a script command file from your local file system, click Browse and select the BeanShell or Python
script file, then click the Load button. The script will not be executed at this point, but its contents will
appear in the Script Input text box. This allows you to view and modify the commands before they are
executed. Once you are ready, you can click Submit to execute it.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 189
Scripts and Journals
//ProcessTemplateNode
public interface ProcessTemplateTaskInterface extends TaskInterface {
public ProcessObjectInterface getNestedProcess();
}
//BatchNode
public interface BatchTaskInterface extends TaskInterface{
public String getJobStatus();
public boolean isJobStopped();
public void execute();
}
//Auto node
public interface AutoTaskInterface extends TaskInterface {
public void execute();
}
Detailed documentation of the scripting interface is provided in the EKM_HOME/api folder. You can
use the scripting Command Window (p. 188) to input scripts for testing.
The examples below demonstrate how to use these APIs to test or debug a process template.
Manual Task
To launch a process template, use the API shown below. You need to specify the process template path,
process name and location, and required variables map.
########### Create Process Object using specified process template and required variables ##########
po = ekm.executeWorkflow("/Data/Shared Data/run-simulation.pt.xml", "test-run-simulation",
"/Processes/Process Monitor", {"Disciplines":["Flow"]})
########### Get all the active tasks and set variables state in process object ##########
activeTasks = po.getActiveTaskMap()
variableState = {"Mesh Quality":"Coarse", "Dimension 1":6.5,
"Geometry File":ekm.getObjectByPath("/Data/Shared Data/elbow.cas"), "Dimension 2":3.0,
"Mesh Folder":ekm.getObjectByPath("/Administration/Users/jsmith/My Data")}
po.setVariableState(variableState)
########### Get specified task and complete it with current variables state ###########
setupTask = activeTasks["Setup"]
setupTask.complete()
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
190 of ANSYS, Inc. and its subsidiaries and affiliates.
Testing or Debugging a Process Template
Batch Task
If a batch task is set to start automatically, it will do so if it is the first task in the process, or when the
prior task has been completed. You can launch a batch task and monitor the job’s progress using code
similar to that shown below.
In this snippet, the task is set to complete itself automatically (autoComplete is true).
######### Monitor batch task till the job and task itself gets completed #############
batchPreProcessTask = po.getTask("Batch Pre-process")
try:
while ((not batchPreProcessTask.isJobStopped()) or batchPreProcessTask.getStatus() != "active"):
batchPreProcessTask = ekm.getObjectById(batchPreProcessTask.getId())
if batchPreProcessTask == None :
break
except:
print "Batch task exceuted"
If autoComplete is false, you must explicitly mark the batch task as complete once the job is ex-
ecuted:
batchPreProcessTask.complete()
If autoStart is false, you must explicitly start the execution of batch task as follows:
batchPreProcessTask.execute()
If autoStart is true, you can specify the task as a breakpoint task. The process will not execute
further until the task is manually executed, either through a script or in the Process Monitor. Breakpoints
can be added as follows:
##########Even if autostart = true, task will not proceed#########
breakpointTasks = list()
breakpointTasks.append('Batch Pre-process')
po.setBreakpointTasks(breakpointTasks)
To remove all breakpoints, user needs to call po.removeBreakpointTasks().
Auto Task
Usually, auto tasks start executing automatically and complete themselves. You can, however, use
scripting to define a breakpoint task that allows you to review or update inputs before the task executes.
You can then execute the task manually using the Execute action in the Process Monitor or through
scripting.
po = ekm.executeWorkflow("/Data/Shared Data/Sample Files/process-templates/batch-monitor.pt.xml",
"test-batch-monitor", "/Processes/Process Monitor", {})
breakpointTasks = list()
breakpointTasks.append('solve')
po.setBreakpointTasks(breakpointTasks)
activeTasks = po.getActiveTaskMap()()
variableState = {"caseFile":ekm.getObjectByPath("/Data/Shared Data/test.xml), "count":3,
"outputFolder":ekm.getObjectByPath("/Data/Shared Data")}
po.setVariableState(variableState)
setupTask = activeTasks["setup"]
setupTask.complete()
Once the setup task is complete, the solve task is created but will not execute automatically because it
is defined as a breakpoint task. Here you can review or update the variable state before the auto task
is executed. Once updated, the auto task can be executed as follows:
solveTask = po.getTask(solve)
solveTask.execute()
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 191
Scripts and Journals
You can even complete the task without executing a macro by issuing:
solveTask.complete()
This will execute the completion macro specified for the last step as well.
Once you have access to the process, you can complete the tasks contained within it. An example of
this is shown in the sample script below.
po = ekm.executeWorkflow("/Data/Shared Data/Sample Files/process-templates/nested-process-template
/main-process-template.pt.xml", "test-nested", "/Processes/Process Monitor", {})
activeTasks = po.getActiveTasks()
variableState = {"outerVariable":True}
po.setVariableState(variableState)
beginTask = activeTasks["Begin"]
beginTask.complete()
Reassignment Task
Current and/or future tasks in a process can be reassigned to other users.
In a process template that contains no nested templates, you can reassign a task using the reas-
signTask method in the ProcessObjectInterface API as follows:
po.reassignTask("End", "ekmadmin", "Please check mesh for approval")
In the example above, “End” is the task name, and “ekmadmin” is the user to whom the task is being
reassigned. The note "Please check mesh for approval" will be displayed when the task is
reassigned.
If a process template has another process template nested inside of it, and you want to reassign a task
that resides in the nested template, you must specify the path to the task within the sequence of tasks,
as shown in the example below:
po.reassignTask("Nested Workflow/Run Simulation/Approve Mesh", "ekmadmin", "Please check mesh for approval")
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
192 of ANSYS, Inc. and its subsidiaries and affiliates.
Viewing a Script Error Log
In this example, Nested Workflow, Run Simulation and Approve Mesh are the sequential
tasks in a nested process template, and Approve Mesh is the task that is being reassigned.
Once a task has been reassigned, the target user must sign in to EKM and accept the task to be able
to complete it. This is accomplished using the accept method, as shown in the example below.
po = ekm.executeWorkflow("/Data/Shared Data/run-simulation.pt.xml", "test-run-simulation", "/Processes/Process Monit
task=po.getTask("Setup")
po.reassignTask("Setup", "ekmadmin", "dummy note")
ekm.login("ekmadmin")
task.accept()
If you have added debug statements to a script using print, the output of those statements will get
captured in the log as well.
To view the script error log, go the Administration section and select Scripting > Show log.
By default, the Script log dialog box displays the debug messages and error messages that were dis-
played in the interface when the errors occurred. To view more details about the error, enable the Show
error details check box. This may help you identify the source of an error.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 193
Scripts and Journals
Errors will continue to be added to the log as they occur. To reduce the amount of content shown in
the log, disable the Show error details check box.
To download the log to an HTML file so that it can be viewed and shared externally, click Download
as HTML.
Note
• A maximum of 100K characters can be captured in the log. When that limit has been reached,
content is no longer added.
• The log captures errors in the current session only, and is emptied when the session ends.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
194 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 13: Defining Custom Dialogs, Wizards and Applications
This chapter provides information on how you can enhance the standard EKM features by creating
custom user interfaces such as dialog boxes and wizards, as well as custom applications that utilize
these interfaces in EKM.
Contents include:
13.1. Defining Custom Dialog Boxes
13.2. Defining and Using Custom Applications
13.3. Creating a Custom Application
13.4. Executing a Custom Application
13.5. Modifying an EKM Application
• Action Menus: You can define new actions for custom types and built-in types. These actions can be executed
using the action menu. If the action requires any user input then you will need to show a dialog box when
the action menu is clicked.
• Job Execution: When defining a job template, you can specify that you want a custom interface to be dis-
played when that template is used to execute a batch job.
• Process Templates: By default, EKM shows an automatically generated dialog box for task completion and
batch execution. But you could define a custom dialog box to be used in its place, especially if you want
more control over the task is presented.
• Custom Applications: You will need to define a dialog box for any custom application. This dialog box is
shown when the custom application is executed in the web user interface.
Note
In custom dialog boxes that involve job execution, only batch jobs are supported. Interactive
jobs are not supported.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 195
Defining Custom Dialogs, Wizards and Applications
• XHTML: Dialog boxes are defined using XHTML syntax. See XHTML Files (p. 197) for details.
• JSF: Java Server Faces (JSF) is a new standard for developing web-based applications. It introduces tags that
can be used in XHTML files. These tags can be used to provide complex user interface components (such
as calendar, tree, and so on) that are not directly supported by HTML. Some components have built-in AJAX
support to increase user interface responsiveness and interactivity. In addition, these tags are used to bind
the values specified in the user interface to some variables defined in the back-end. This binding enables
JSF to automatically fill the values of the variables with user inputs when the form is submitted. The tags
that can be used depend on the JSF component libraries loaded by the system. EKM uses the following JSF
component libraries: MyFaces Core 2.1.8, Tomahawk 20–1.1, and RichFaces 4.2.2. Refer to http://my-
faces.apache.org/ for more information on MyFaces and Tomahawk libraries. Refer to http://www.jboss.org/
richfaces for more information on the RichFaces libraries.
Note
– If you use custom applications and JSF validation tags, you need to provide a label so that the
validation protocols can apply a proper error message to the custom application. In the example
that follows, the error message is missing the label of the field that has an invalid entry.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
196 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Custom Dialog Boxes
– Variable names used in a custom application should always be a valid java identifier. For ex-
ample, a variable cannot have a name that is a reserved word such as "boolean".
If you are new to XHTML, CSS, JavaScript and JSF, then it may feel a little overwhelming to understand
all of the technologies and languages at first. Indeed, the possibilities offered by these technologies
are very extensive making them both powerful and complex. However, if you have a basic understanding
of HTML, the documentation and examples provided in this chapter will enable you to create a basic
user interface.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 197
Defining Custom Dialogs, Wizards and Applications
have complete freedom when designing the layout and presentation of a dialog box. You can create
tables, use different font styles and sizes, embed custom images, and so on. If needed, you can also
utilize CSS to specify styles for user interface components and JavaScript to provide dynamic behavior.
All of the XHTML files that you create must have the .xhtml file extension and contain the following:
Sample XHTML Code for a Custom Dialog Box (p. 198) contains a full listing for an XHTML file for a
sample custom dialog box. Figure 13.2: Sample Custom Dialog Box (p. 199) shows how the dialog box
is displayed in the EKM user interface. The file defines common user interface components and can be
used as a template to define any custom dialog box.
Header
An XHTML must start with the header:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:t="http://myfaces.apache.org/tomahawk"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:rich="http://richfaces.org/rich"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:ing="http://www.ansys.com/ingress/spdm">
Body
In between the header and footer, you may insert any HTML or JSF tag in the XHTML file to define the
user interface components. See User Interface Components (p. 201) for details.
Footer
An XHTML must end with the footer:
</ui:component>
</body>
</html>
The dialog box uses common user interface components (p. 201) such as check boxes, selection lists,
and so on that can be used as a template when you define any custom dialog box. The variables for
the dialog box are defined in a separate initialization macro named init that EKM uses to create the
dialog box.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
198 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Custom Dialog Boxes
<body>
<ui:component>
<div style="text-align: center; font-size: large">
Sample Dialog<br/>
<span style="color: red">For Displaying Common UI Components</span>
</div>
<div style="padding-top: 10px; padding-bottom: 10px; width: 100%">
<table>
<tr>
<td>File upload:</td>
<td>
<t:inputFileUpload size="60" value="#{custom.vars.file.value}"/>
</td>
</tr>
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 199
Defining Custom Dialogs, Wizards and Applications
<tr>
<td>Reference selection:</td>
<td>
<ing:inputCustomReference size="60" referenceVar="reference"/>
</td>
</tr>
</table>
</div>
<table>
<tr>
<td><h:graphicImage value="#{custom.url}/tank.jpg" /></td>
<td>
<table style="padding-left: 10px; width: 250px">
<tr>
<td>String Entry:</td>
<td>
<h:inputText value="#{custom.vars.string.value}" />
</td>
</tr>
<tr>
<td>Integer Entry:</td>
<td>
<h:inputText value="#{custom.vars.integer.value}">
<f:validateLongRange minimum="0" maximum="10"/>
</h:inputText>
</td>
</tr>
<tr>
<td>Real Entry:</td>
<td>
<h:inputText value="#{custom.vars.real.value}" />
</td>
</tr>
<tr>
<td>Date:</td>
<td>
<rich:calendar value="#{custom.vars.date.value}"
datePattern="MMM d, yyyy HH:mm"
enableManualInput="true" />
</td>
</tr>
<tr>
<td>Check box:</td>
<td>
<h:selectBooleanCheckbox value="#{custom.vars.boolean.value}" />
</td>
</tr>
<tr>
<td>Radio buttons:</td>
<td>
<h:selectOneRadio value="#{custom.vars.radio.value}"
layout="lineDirection">
<f:selectItem itemValue="Radio 1"/>
<f:selectItem itemValue="Radio 2"/>
</h:selectOneRadio>
</td>
</tr>
<tr>
<td>Select menu:</td>
<td>
<h:selectOneMenu value="#{custom.vars.menu.value}">
<f:selectItems value="#{custom.vars.menu.optionItems}"/>
</h:selectOneMenu>
</td>
</tr>
<tr>
<td>List box:</td>
<td>
<h:selectManyListbox value="#{custom.vars.listBox.value}">
<f:selectItem itemValue="List Option 1"/>
<f:selectItem itemValue="List Option 2"/>
<f:selectItem itemValue="List Option 3"/>
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
200 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Custom Dialog Boxes
</h:selectManyListbox>
</td>
</tr>
</table>
</td>
</tr>
</table>
</ui:component>
</body>
</html>
You can also use an HTML table to display an image and other controls, side by side.
For the sample dialog box (Figure 13.2: Sample Custom Dialog Box (p. 199)), tank.jpg is at the top-
level of the resources folder, so the full path becomes: #{custom.url}/tank.jpg.
If you want to display an image that resides in the EKM repository, see Linked Images (p. 201).
path: specifies the path of the image file. It can be a JSF EL expression such as #{custom.vars.im-
agePath}, or an absolute value such as /Data/Shared Data/image.gif.
style: can be used to define a style for the image. For example, you may want to display a colored
border around it, as shown in the sample below.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 201
Defining Custom Dialogs, Wizards and Applications
path: specifies the path of the object. It can be a JSF EL expression such as #{cus-
tom.vars.path}, or an absolute value such as /Data/Shared Data.
style: can be used to define a style for the link.
styleClass: refers the CSS class to be applied to link.
value: can be used to specify the link text. If not specified, the object name is used for the link
text, with the object path shown in a tooltip.
<ing:objectLink path="/Data/Shared Data" styleClass="facesCommandLink" value="Click here for Shared Data"/>
String Input
The inputText setting can be used to define a text box for capturing string input in a dialog box, as
shown in the following code fragment:
<h:inputText value="#{custom.vars.string.value}" />
Except for a reference selection, all elements that capture user inputs must have a value attribute.
This attribute points to the value of the variable, defined in the initialization script (p. 205), that stores
the user input. The common syntax to specify the value is: #{custom.vars.varName.value},
where varName is the name of the variable defined in the initialization script (p. 205). In this case the
name of the variable is string.
Integer Input
The inputText setting can be used to define a text box for capturing integer input in a dialog box,
as shown in the following code fragment:
<h:inputText value="#{custom.vars.integer.value}">
<f:validateLongRange minimum="0" maximum="10"/>
</h:inputText>
The value attribute must point to a variable of type long in the initialization script (p. 205). In this case,
the name of the variable is integer. If required, you can also specify minimum and/or maximum
values for the integer as shown above with the f:validateLongRange tag. This is optional and if
it’s not specified, the integer will not have any minimum or maximum value.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
202 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Custom Dialog Boxes
The inputText setting can be used to define a text box for capturing real number input in a dialog
box, as shown in the following code fragment:
<h:inputText value="#{custom.vars.real.value}" />
The value attribute must point to a variable of type double in the initialization script (p. 205). In this
case the name of the variable is real. If required, you can also specify minimum and/or maximum
values for the real number as shown above for integer inputs. This is optional and if it is not specified,
the real number will not have any minimum or maximum value.
Date Input
The rich:calendar setting can be used to define a text box for capturing date and time input in a
dialog box, as shown in the following code fragment:
<rich:calendar value="#{custom.vars.date.value}"
datePattern="MMM d, yyyy HH:mm"
enableManualInput="true" />
The value attribute must point to a variable of type Date in the initialization script (p. 205). In this
case the name of the variable is date. The datePattern attribute specifies the format in which the
date will be displayed or entered manually. The enableManualAttribute specifies whether
manual date input is allowed or not. Refer to the RichFaces documentation for information about this
component and to learn about additional attributes.
Reference Selection
The inputCustomReference setting can be used to define a combination text box and browse
button for selecting a reference to another object in EKM, as shown in the following code fragment:
<ing:inputCustomReference size="60" referenceVar="reference"/>
The referenceVar attribute specified the name of the reference variable defined in the dialog box’s
macro. In this case the name of the variable is reference. You can control the size of the text box
using size or width attributes.
File Selection
The inputFileUpload setting can be used to define a combination text box and browse button for
selecting a file to upload to EKM, as shown in the following code fragment:
<t:inputFileUpload size="60" value="#{custom.vars.file.value}"/>
The value attribute must point to a variable of type VARIABLE_TYPE_FILE in the initialization
script (p. 205). In this case the name of the variable is file.
The value attribute must point to a boolean variable in the initialization script (p. 205). For the example
dialog box (Figure 13.2: Sample Custom Dialog Box (p. 199)) the name of the variable is boolean.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 203
Defining Custom Dialogs, Wizards and Applications
The value must point to a string variable defined in the initialization script (p. 205). For the example
dialog box (Figure 13.2: Sample Custom Dialog Box (p. 199)), the name of the variable is radio. The
layout attribute specifies whether radio buttons are displayed horizontally (using the lineDirection
value) or vertically (using the pageDirection value). The options for the radio button are specified
using the f:selectItem tags as shown above. Instead, you can use the f:selectItems tag to
specify the variable options in the dialog box’s macro. See Selection Menu for an example of the
f:selectItems tag.
The value attribute must point to a string variable defined in the initialization script (p. 205). In this
case the name of the variable is listBox. If the variable is defined as multi-valued, the list box will
allow multiple selections. Otherwise only a single selection is allowed. The options for the list box are
specified using the f:selectItem tags as shown above. Instead of this, you can use f:selectItems
tag to specify the variable options for the dialog box’s macro. See Selection Menu for an example of
the f:selectItems tag.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
204 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Custom Dialog Boxes
In the example below, when a user clicks an Update command link next to an input box, the macro
testMacro (specified in the script) is executed. This macro updates the value of the variable test-
String. After the macro is executed, the input box is rendered again to display the updated value,
New Value.
<h:inputText value="#{custom.vars.testString.value}" id="inputText"/>
<a4j:commandLink id="testLink" action="#{custom.dialog.executeMacro('testMacro')}"
render="inputText" value="Update"/>
<h:inputText class="submitXMLData" value="#{custom.dialog.vars.xmlData.value}" style="display:none"/>
• The steps contained in the dialog box. Dialog boxes can either have a single step or have multiple
steps (for example, in case of wizards). For each step you would need to specify the header of the step
and the XHTML file that provides the interface for that step. For the last step you would also need to
specify the execution macro that will be called when the dialog box is submitted. This macro is used
to process the user inputs and then execute some commands.
• The variables used by the dialog box. Variables are used to store the inputs specified by the user in
the dialog box. These variables can then be accessed by the execution macro to retrieve the user inputs
and act upon them.
Defining Steps
The following code snippet shows how dialog boxes can be defined in a macro. This file is provided in
the examples folder in your EKM server installation: EKM_HOME/examples/custom-apps.
init(dialog) {
dialog.addStep("Test Variables", "test-variables.xhtml", "action");
The name of the macro is init and it takes a single argument dialog box that is an instance of Dia-
logInterface.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 205
Defining Custom Dialogs, Wizards and Applications
The first line of the macro adds a step to the dialog box as follows:
dialog.addStep("Test Variables", "test-variables.xhtml", "action");
The first argument is the header and will be shown in the Title Bar of the dialog box when it is opened
in the web user interface.
The second argument is the path of the XHTML file that defines the user interface for this step. The
path can be either relative or absolute. An absolute path is used primarily for defining action dialog
boxes for custom types. The location of the XHTML files (and other resource files used in the user interface
such as images, CSS files, JavaScript files, and so on) is dictated by the customResourcesPath setting
in ekm.xml and is by default EKM_HOME/conf/resources. The XHTML file for the custom type
dialog box can be placed in any sub folder in the custom resources folder. You can then use the path:
/custom/<relative path of file in custom resources folder> to refer to the XHTML
file in the custom resources folder. Process templates and custom applications can be added or modified
dynamically to EKM by any user who may or may not have access to EKM server’s file system. EKM
handles this issue in the following ways:
• The user interface resource files needed for custom applications and process templates are added as
an archive (in .zip, .tar, or .tar.gz formats).
• The resources archive is made a child of the process template or custom application object in EKM.
• When a custom dialog box needs to be opened, the resource archive is extracted to a specific location.
This location is:
path-to-custom-resources_folder/_custom_resource_cache_/id-of-the-
object
where id-of-the-object refers to the internal ID of the object in EKM. It is used to store
the resource files from different custom applications and process templates in a separate folder.
Because you do not know the ID of an object before it has been added to EKM, you cannot use the
absolute path to specify XHTML files for custom applications and process template dialog boxes. You
can, however, specify a relative path and behind the scenes EKM will create the full path before the
dialog box is opened. User interface resources are contained in an archive, and the relative path will
depend on the path of the XHTML file in the archive. If the file is at the top level of the archive, then
you can simply specify the file name (for example, test-variables.xhtml). However, if the file is
in a folder then you will need to specify the name of the parent folder too (for example, folder-
name/test-variables.xhtml).
The third argument is the name of the action macro that will be called when the dialog box is submitted.
For a multistep wizard, you need to specify only the execution macro in the last step.
Defining Variables
Once the steps have been specified you can then add the variables used in the dialog box. This is done
using the addVar() method of the DialogInterface as shown in the following line:
dialog.addVar("string", dialog.VARIABLE_TYPE_STRING, "Hello World", false);
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
206 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Custom Dialog Boxes
The first argument is the name of the variable, the second argument is the type of the variable, the
third argument is the default value and the fourth argument specifies whether the variable is multi-
valued or not. The following types can be specified:
The default value will depend on the type of the variable. For VARIABLE_TYPE_DATE, it must be an
instance of java.util.Date class. You can set the default to the current time by calling Calen-
dar.getInstance().getTime(). For VARIABLE_TYPE_FILE the default must be null. For multi-
valued variables, the default value must be a list. For example:
dialog.addVar("listBox", dialog.VARIABLE_TYPE_STRING, new String[]
{"List Option 1", "List Option 2"}, true);
In the above line, the variable listBox is a multi-valued variable whose default value is a list with two
elements: List Option 1 and List Option 2.
The addVar() method returns the newly added variable, which is an instance of the VariableIn-
terface. You can use this instance to specify some additional attributes that can’t be specified in the
addVar() method. For example, for reference variables you can specify the type of objects to be se-
lected using the setReferenceType() method of ReferenceVariableInterface as shown
in the following snippet. Here we are setting the type to Folder, this means that users will only be able
to select Folder objects for this variable:
referenceVar = dialog.addVar("reference", dialog.VARIABLE_TYPE_REFERENCE, "", false);
referenceVar.setReferenceType("Folder");
Similarly you can specify the options for any variable using the setOptions() method as shown in
the following snippet. Here we are setting 3 options: Menu Option 1, Menu Option 2, and Menu
Option 3.
menuVar = dialog.addVar("menu", dialog.VARIABLE_TYPE_STRING, "Menu Option 2", false);
menuOptions = new LinkedList();
menuOptions.add("Menu Option 1");
menuOptions.add("Menu Option 2");
menuOptions.add("Menu Option 3");
menuVar.setOptions(menuOptions);
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 207
Defining Custom Dialogs, Wizards and Applications
To create a custom interface to be used in a job template, you must perform two main tasks:
2. Define a script with an initial macro, action macro, and ajax macro (if required).
<body>
<ui:component>
<script>
function showHideCores() {
if(document.forms['actionForm']['actionForm:processingRadio'][0].checked == true ){
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
208 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Custom Dialog Boxes
document.getElementById('numberOfCoresDiv').style.display='none';
}
else if(document.forms['actionForm']['actionForm:processingRadio'][1].checked == true ){
document.getElementById('numberOfCoresDiv').style.display='block';
}
}
</script>
<div style="height:100%; width:100%; min-height:330px; min-width:400px">
<h:graphicImage value="#{custom.url}/images/launcher.jpg" style="width:99%; padding-top:5px;"/>
<div style="float:left; padding-top:8px; width:49%">
<h:outputText value="Dimension" style="padding-bottom: 2px"/>
<h:selectOneMenu id="dimensionDropDown" value="#{custom.vars.dimension.value}">
<f:selectItem id="_2dDimension" itemLabel="2D" itemValue="2d" />
<f:selectItem id="_3dDimension" itemLabel="3D" itemValue="3d" />
<f:ajax render="doublePrecisionCheckbox" listener="#{custom.executeMacro('setDoublePrecisionValue')}"
event="change" execute="@form"/>
</h:selectOneMenu>
</div>
<div style="float:right; padding-top:8px; width:49%;">
<h:outputText value="Options" style="padding-bottom: 2px"/>
<div>
<h:selectBooleanCheckbox id="doublePrecisionCheckbox" value="#{custom.vars.doublePrecision.value}"
style="float:left;padding-right:5px"/>
<h:outputText value="Double precision" style="float:left; padding-top:3px"/>
</div>
</div>
<div style="clear:both">
<div style="float:right; padding-top:10px; width:49%">
<h:outputText value="Processing options" style="padding-bottom: 2px"/>
<h:selectOneRadio id="processingRadio" value="serial" onchange="showHideCores()" >
<f:selectItem id="serial" itemLabel="Serial" itemValue="serial" />
<f:selectItem id="parallel" itemLabel="Parallel" itemValue="parallel" />
</h:selectOneRadio>
<div id="numberOfCoresDiv" style="padding-top:4px; margin-left:10px; display:none; ">
<h:outputText value="Number of processes" style="padding-bottom: 2px"/>
<t:div>
<rich:inputNumberSpinner id="numberOfCores" value="#{custom.vars.cores.value}" inputSize="1"
style="margin-top:5px; padding-left:15px"/>
</t:div>
</div>
</div>
</div>
<div style="float:left; width:98%;padding:3px 0px">
<div style="padding-top:5px; width:100%;clear:both; ">
<h:outputText value="Use journal file" style="float:left; padding-top:2px"/>
<t:div id="journalFileDiv" style="float:left;">
<t:div id="innerJournalFileDiv">
<ing:browseWorkingDirectory value="#{custom.vars.journalFile}" width="99%" id="journalFile"
render="innerJournalFileDiv"/>
</t:div>
</t:div>
</div>
</div>
<div style="width:98%; padding-top:8px; clear:both;">
<h:outputText value="Other commandline options" style="float:left; width:100%;"/>
<h:inputText id="otherCommandLine" value="#{custom.vars.otherCommandLine.value}" style="float:left;
width:100%; margin-top:2px"/>
</div>
<t:div id="queuesDiv" style="width:99%; padding-top:8px; clear:both;">
<h:outputText value="Queues" style="float:left; width:100%;"/>
<ing:selectQueue value="#{custom.vars.queue}" hasAppKey="#{custom.vars.appKey.value}" style="width:100%"/>
</t:div>
<t:div id="commandLineDiv" style="padding-top:10px; float:right;">
<ing:viewCommandLine label="Command line"/>
</t:div>
</div>
</ui:component>
</body>
</html>
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 209
Defining Custom Dialogs, Wizards and Applications
In addition to components described in Defining a Custom User Interface (p. 196), the following built-in
EKM components are used:
This built-in component shows a list of available queues. To following code is used to add the Queues
drop box to the interface:
<ing:selectQueue value="#{custom.vars.queue}" hasAppKey="#{custom.vars.appKey.value}" style="width:100%"/>
Required attributes:
• value. The variable for the queues defined by the user in the initial macro. In this example, a queue variable
whose type is QueuesVariableInterface is defined in the initial macro.
• hasAppKey. The application key for which queues need to be found. This variable is defined in the initial
macro. In this example, an appKey variable is defined in the initial macro.
Optional attributes:
• styleClass. The CSS class to be applied to the component. If not defined, the default EKM style is applied.
• id. A unique identifier for this component. The value must be unique within the closest naming container.
This built-in component enables the user to browse the working directory on the server and select an
input file. It consists of an input box and browse button. When a file/folder is selected it will be shown
in the input box. The following code is used to add the file selector component to the interface:
<ing:browseWorkingDirectory value="#{custom.vars.journalFile}" width="99%" id="journalFile"
render="innerJournalFileDiv"/>
Required attributes:
• value. The variable for the journal file defined in the initial macro. In this example, a journalFile variable
whose type is ServerFileVariableInterface is defined in the initial macro.
• render. A comma-separated list of component ids that will be rendered after clicking a node in the tree.
This built-in component enables the user to view the command line. When the user clicks the View
Command Line link, a pop-up box will be displayed that shows the current command line. The following
code is used to add the command line component to the interface:
<ing:viewCommandLine label="Command line"/>
Optional attributes:
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
210 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Custom Dialog Boxes
• linkStyleClass. The CSS class to be applied to the link. If not defined, the default EKM style is applied.
• popupStyleClass. The CSS class to be applied to the pop-up box. If not defined, the default EKM style is
applied.
• id. A unique identifier for the component. The value must be unique within the closest naming container.
• An initial macro
• An action macro
You can define the macros on the Script tab of the Edit Job Template dialog box when creating the
job template in which the custom interface will be used. See Creating a Custom Job Template in the
User’s Guide for more information.
• The name of the XHTML file that defines the content of the custom interface
• The name of the action macro that is used when the Execute button is clicked in the Start Job dialog box
• The variables used to store inputs specified by the user in the custom interface
def init(ui, jobTemplate):
ui.setCustomUi("ui/fluent_launcher.xhtml")
ui.setActionMacro("action")
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 211
Defining Custom Dialogs, Wizards and Applications
The argument is the path of the XHTML file that defines the content of the custom interface. The location
of the XHTML file (and other resource files such as images, CSS files, JavaScript files, and so on) is dictated
by the customResourcesPath setting in the ekm.xml file, which by default is set to
EKM_HOME/conf/resources. The XHTML file can be placed in any sub-folder in the custom resources
folder. You can then use the path /custom/<relative path of file in custom resources
folder> to refer to the XHTML file in the custom resources folder. Job templates can be added to
EKM by any user who may or may not have access to the EKM server’s file system. EKM handles this issue
in the following ways:
• The resource files needed for the custom interface are added the job template as an archive (in .zip, .tar,
.tar.gx or .tgz format).
• The resource archive becomes a child of the job template object in EKM.
• When a custom interface needs to be opened, the resource archive is extracted to the following location:
Because you do not know the ID of an object before it has been added to EKM, you cannot use an ab-
solute path to specify the location of the XHTML file. When you specify a relative path, EKM will create
the full path behind the scenes before the dialog box is opened. If the XHTML file is at the top level of
the archive, then you can simply specify the file name (for example, test-variables.xhtml).
However, if the file is in a folder then you will need to include the parent folder in the path (for example,
folder-name/test-variables.xhtml).
The second line specifies the action macro that will be called when the Execute button is clicked in
the Start Job dialog box.
ui.setActionMacro("action")
When the initialization is complete, you can then add the variables used in the interface. This is done
using the addVar () method of the CustomUiInterface as shown in the following line:
ui.addVar("dimension", ui.VARIABLE_TYPE_STRING, "2d", False)
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
212 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Custom Dialog Boxes
The default value must be an instance of the java.util.Date class. You can set the default to
the current time by calling Calendar.getInstance().getTime().
To use the Queues drop-down box as defined in the Example: Creating a Custom Interface for Fluent
Batch Jobs (p. 210) section, you must add a variable of type VARIABLE_TYPE_QUEUE in the initial
macro:
queueVar=ui.addVar("queue", ui.VARIABLE_TYPE_QUEUE, "", False)
queueOptions=[]
selectableQueues=jobTemplate.getSelectableQueues()
for queue in selectableQueues:
if queue not in queueOptions:
queueOptions.append(queue)
queueVar.setSelectableQueues(queueOptions)
This will create a variable of type QueuesVariableInterface. Optionally, you can get the list of
selectable queues as defined in the job template using the setSelectableQueues() method. If
the list of selectable queues is also specified for the queues variable, only the selectable queues
containing the application will be shown in the drop-down list.
To use the server file selection component defined in the Example: Creating a Custom Interface for
Fluent Batch Jobs (p. 210) section, you must add a variable of type VARIABLE_TYPE_SERVER_FILE in
the initial macro:
journalFile=ui.addVar("journalFile", ui.VARIABLE_TYPE_SERVER_FILE, "", False)
journalFile.setFilterTypes("jou")
This will create a variable of type ServerFileVariableInterface. Optionally, you can specify
a comma-separated list of file types using the setFilterTypes() method. If filter types are spe-
cified, only files of those type in the working directory will be shown in the tree.
For multi-valued variables, the default value must be a list. For example:
ui.addVar("listBox", dialog.VARIABLE_TYPE_STRING, new String[] {"List Option 1", "List Option 2"}, true);
In the above line, the variable listBox is a multi-valued variable whose default value is a list with two
elements: List Option 1 and List Option 2.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 213
Defining Custom Dialogs, Wizards and Applications
An action macro is called when the user clicks Execute in the Start Job dialog box. This macro processes
user inputs and executes commands. The code for the tutorial example is shown below.
def action(ui, jobTemplate):
jobTemplate.addParam("-hidden")
defaultAppKey=jobTemplate.getAppKey()
jobTemplate.setAppKey(defaultAppKey)
dim= ui.getVar("dimension").getValue()
precision=ui.getVar("doublePrecision").getValue()
if precision:
precisionString="dp"
else:
precisionString=""
if dim:
jobTemplate.addParam(dim+precisionString)
journalFile=ui.getVar("journalFile").getValue()
if journalFile:
jobTemplate.addParam("-i")
jobTemplate.addParam(journalFile)
cores= ui.getVar("cores").getValue()
if cores:
jobTemplate.addParam("-t")
jobTemplate.setCores(int(cores))
jobTemplate.addParam(cores)
otherCommandLine= ui.getVar("otherCommandLine").getValue()
if otherCommandLine:
jobTemplate.addParam(otherCommandLine)
queue=ui.getVar("queue").getValue()
if queue:
jobTemplate.setQueue(queue)
You must update the values in JobTemplateInterface; in other words update the job execution
settings with the values specified in the variables of CustomUiInterface. The updated job settings
will be used to execute the job.
An ajax macro is used to partially update the interface when a user interacts with it. For example, if the
user enables a check-box or radio button, you may need to re-render a portion of the interface so that
different content is displayed.
You can define an ajax macro for any component specified in the XHTML file using the f:ajax tag of
jsf, as shown below:
<f:ajax render="componentId1, componentId2" listener="#{custom.executeMacro('ajaxMacro')}"
event="change" execute="@form"/>
The executeMacro method of CustomUiInterface has a single String argument, which is the
name of the ajax macro. In this example the name of the macro is ajaxMacro and it has a single ar-
gument, ui, that is an instance of CustomUiInterface. You can change the value of any variable
in CustomUiInterface using another variable and render the corresponding component again to
see the changes.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
214 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining and Using Custom Applications
1. Save the XHTML file and all required resource files in an archive file (.zip, .tar, .tar.gz or .tgz) on
your local computer. In this example, the name of the resource archive is Fluent Launcher.zip.
2. In the Edit Job Template dialog box, select the UI tab, and specify the name of the initial macro (for ex-
ample, init) and the location of the resource archive, as shown below:
For more information, see Using a Custom Interface for Job Execution in the User’s Guide.
1. Create custom application files in a scripting language (p. 179) or in Java that defines the application. For
a script-based application, this will include back-end logic for executing the application as well as a resource
archive for defining the front-end user interface.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 215
Defining Custom Dialogs, Wizards and Applications
2. Create a new application for the custom application files by selecting (New) > Custom Application on
the Home/My Applications or Administration/Shared Applications page (if accessible). Once you have
filled in the dialog box and clicked OK, the new custom application you set up will be saved as an EKM
Application (p. 274) type object and placed in the folder you specified.
3. Click on an application to execute it. The dialog box that is defined for the application will open, allowing
you to input values.
Note that the Custom Application action is only available to admin users.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
216 of ANSYS, Inc. and its subsidiaries and affiliates.
Executing a Custom Application
3. Click under Application folder to select the repository folder where you would like to save
the application. For easy access you may want to save it in the /Home/My Applications folder or
the /Administration/Shared Applications folder.
4. Click under Script file to select a script file for the application. Select the sample mixing-
tank-simulation.py file on your local system. This is the script file that provides the back-end of the
application.
5. In the Macro name for dialog creation edit box, enter init for the macro name that creates the custom
dialog box. This is the name of the macro that is defined in the script file.
6. Click under Resource archive to select the archive file (.zip, .tar or .tar.gz) that contains
the user interface resources needed to define the front-end user interface. Select the mixing-tank-
simulation.zip archive file on your local system.
7. Click OK. The application named Mixing Tank Simulation of type EKM Application will be created
and added to the repository folder that you specified.
You can also click to display the Application launcher, and launch the custom application from
there.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 217
Defining Custom Dialogs, Wizards and Applications
The custom user interface that opens will vary depending on the application. When you click OK in the
custom application dialog box, the inputs that you have specified in the dialog box will be processed
by the back-end, and the desired operations will be executed before the dialog box is dismissed.
Figure 13.5: Custom Mixing Tank Simulation Dialog Box (p. 218) shows the dialog box of the mixing tank
custom application created in the previous step. When you click OK, Fluent launches in the background
and simulates the mixing tank using the parameters you supplied. Note that for this example, the Fluent
solver application must be defined (without the -post command line parameter).
A job object is created for the simulation process in the Job Monitor, where you can monitor its status.
You can then navigate to the output folder you specified and review the Simulation Details Report that
was created for the simulation. This is shown below in Figure 13.6: Report for Custom Mixing Tank
Simulation (p. 219).
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
218 of ANSYS, Inc. and its subsidiaries and affiliates.
Modifying an EKM Application
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 219
Defining Custom Dialogs, Wizards and Applications
1. Go to the location where the custom application is saved (for example, Home/My Applications or Ad-
ministration/Shared Applications), and then right-click the application and select Edit > Application.
This opens the Edit Custom Application dialog box.
2. To select a new script file, or reload the script file if it has changed, click under Script file.
3. Change the name of the macro for dialog box creation, if required.
4. If the user interface has changed, click under Resource archive and select the new archive
(.zip, .tar or .tar.gz) for user interface resources.
5. Click OK. The changes will be applied to the application and will take effect the next time that you execute
the application.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
220 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 14: EKM Connector End User API
The EKM Connector End User API is a library that can be used to develop client applications that interact
with an EKM repository. The programs can be developed in Java, C#, or Python. Python programs must
be executed using either the Jython or IronPython interpreter. You can develop applications to:
After the installation is complete, do the following to build and run the Java and Jython examples:
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 221
EKM Connector End User API
2. Change the EKM_BASE environment variable to EKM_ROOT170, where EKM_ROOT170 is the directory
in which the ekm-client directory resides.
5. On Unix machines, use the chmod command to make all of the .sh files in EKM_ROOT170/ekm-cli-
ent/bin executable.
6. On Unix machines, use the chmod command to make the ant script in EKM_ROOT170/ekm-cli-
ent/programs/apache-ant-1.9.1/bin executable.
Once this has been done, the samples can be built and run in place on the server where the library was
installed.
1. Copy the ekm-client directory from the server install to a location on the client machine. The only
prerequisite for the client machine is that it has the Java Development Kit (JDK) version 1.8.0_40 or later
installed on it.
3. Change the EKM_BASE environment variable to the directory in which you placed the ekm-client
directory.
4. Change the JAVA_HOME environment variable to point to the JDK installation on the client machine.
7. On Unix machines, use the chmod command to make all of the .sh files in EKM_ROOT170/ekm-cli-
ent/bin executable.
8. On Unix machines, use the chmod command to make the ant script in EKM_ROOT170/ekm-cli-
ent/programs/apache-ant-1.9.1/bin executable.
1. Execute the jython script in EKM_ROOT170/ekm-client/bin. This should open a jython console. For
example:
Jython 2.5.3 (2.5:c56500f08d34+, Aug 13 2012, 14:48:36)
[Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)] on java1.8.0_40
Type "help", "copyright", "credits" or "license" for more information.
>>>
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
222 of ANSYS, Inc. and its subsidiaries and affiliates.
Using the Library in Client Applications
The first command imports the ConnectionFactory class into the interpreter. The second
command opens a connection to the EKM server. In the second command, replace host:port
with the hostname and port number of the EKM server (for example, http://localhostmyekmserv-
er.mycompany.com:8080), user with the EKM username, and password with the EKM user’s
password. After entering the open command, you should see something similar to the following
in the interpreter:
ConnectionFactory.open("http://ekmserver:8080", "ekmuser", "Ekmpass123!")
09:46:21,874 DEBUG RepositoryConnectionManager:? - Open started: Default @ ekmserver[http://ekmserver:8080/,De
09:46:23,880 INFO RemoteRepositoryAdapter:? - Using cache: false
09:46:23,997 DEBUG RepositoryConnectionManager:? - Open completed
This indicates the installation was successful and you are now connected to the EKM server.
First, method names in the library follow the standard coding style for each language.
Java
Methods are camelcase and start with lowercase letters. For example, findByPath
C#
Methods are camelcase and start with uppercase letters. For example, FindByPath
Accessing attributes of objects also follows standard conventions for each language.
Java
Attribute values are retrieved using “getter” methods. For example, someObject.getPath()
Attribute values are assigned using “setter” methods. For example, someObject.setName(“foo”)
C#
Attribute values are retrieved by name or “getter” methods. For example, someObject.Path or someOb-
ject.getName()
Attribute values are set using assignment or “setter” methods. For example, someObject.Name =
“foo” or someObject.setValue(“foo”)
The Python code reflects these differences depending on whether the interpreter uses Java (Jython) or
.NET (IronPython).
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 223
EKM Connector End User API
the username, and password of the user logging into EKM. After the connection is opened, the applic-
ation can make use of the library’s functionality to access and manage data on the server. The one thing
the application should always do when exiting is close the connection. This will ensure that a license
acquired by the user is released.
Java
package samples.java;
import com.ansys.ingress.client.api.Connection;
import com.ansys.ingress.client.api.ConnectionFactory;
try {
conn = ConnectionFactory.open(
"http:// ekmserveraddr:8080", // Host URL
"ekmadmin", // User ID
"Adminuser123!" // Password
);
System.out.println(">>>>> Connection " + conn + " opened");
} finally {
if (conn != null) {
conn.close();
}
System.out.println(">>>>> Connection " + conn + " closed");
}
}
Python (Jython)
from com.ansys.ingress.client.api import ConnectionFactory
if __name__ == "__main__":
conn = None
try:
conn = ConnectionFactory.open(
"http://ekmserveraddr:8080", # host
" ekmadmin " , # username
" Adminuser123!") # password
print ">>>>> Connection " + str(conn) + " opened"
finally:
if conn:
conn.close()
print ">>>>> Connection " + str(conn) + " closed"
Python (IronPython)
# Load EKM assemblies
import client_init
if __name__ == "__main__":
conn = None
try:
# Change the username and password below as needed
conn = ConnectionFactory.Open(
"http://ekmserveraddr:8080", # host
"ekmadmin", # username
"Adminuser123!") # password
print ">>>>> Connection " + conn.GetName() + " opened"
finally:
if conn:
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
224 of ANSYS, Inc. and its subsidiaries and affiliates.
Using the Library in Client Applications
conn.Close()
print ">>>>> Connection " + conn.GetName() + " closed"
C#
Connection conn = null;
try
{
//
// Modify the workspace, user name, and password to reflect
// the actual EKM server you are using.
///
conn = ConnectionFactory.Open(
"http://ekmserveraddr:8080", // Host URL
"ekmadmin", // EKM user
"Adminuser123!" // User's password
);
Console.WriteLine(">>>> Connection " + conn.GetName() + " opened");
}
finally
{
if (conn != null)
{
conn.Close();
Console.WriteLine(">>>> Connection " + conn.GetName() + " closed");
}
}
}
• AdministrationManager – provides methods for managing users and groups, interacting with a user’s recycle
bin, and query the server for configuration data
• DataManager – provides methods for managing data on the EKM server. This includes uploading and
downloading files and folders.
The Connection object has methods for getting each of these interfaces. For example, to get the
DataManager in Java, you invoke getDataManager on the Connection object.
Java
DataManager dm = conn.getDataManager();
Python (Jython)
dm = conn.getDataManager()
Python (IronPython)
dm = conn.GetDataManager()
C#
DataManager dm = conn.GetDataManager();
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 225
EKM Connector End User API
• Search for all objects that have a property containing a specific keyword
Each of these operations returns one or more instances of a ModelObject. The ModelObject is a
representation of the object stored in the EKM repository.
Java
DataManager dm = conn.getDataManager()
ModelObject object = dm.findByPath("/Data/Shared Data");
Python (Jython)
dm = conn.getDataManager()
object = dm.findByPath("/Data/Shared Data")
Python (IronPython)
dm = conn.GetDataManager()
object = dm.FindByPath("/Data/My Data/My Projects")
C#
DataManager dm = conn.GetDataManager()
ModelObject obj = dm.FindByPath("/Data/Shared Data");
Java
ModelObject object = dm.findByID("d23ae05b-3a07-446c-a052-1eae22ce06ec");
Python (Jython)
object = dm.findByID("d23ae05b-3a07-446c-a052-1eae22ce06ec");
Python (IronPython)
object = dm.FindByID("d23ae05b-3a07-446c-a052-1eae22ce06ec");
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
226 of ANSYS, Inc. and its subsidiaries and affiliates.
Using the Library in Client Applications
C#
ModelObject obj = dm.FindById("d23ae05b-3a07-446c-a052-1eae22ce06ec");
Java
Set<ModelObject> objects = dm.findByKeyword("test");
if (objects.size() == 0)
System.out.println(">>>>> No objects found with keyword \"test\"");
else
for (ModelObject obj : objects)
System.out.println(">>>>> Object with keyword \"test\" found at " +
obj.getPath());
Python (Jython)
objects = dm.findByKeyword("test")
if objects.size() == 0:
print ">>>>> No objects found with keyword \"test\""
else:
for obj in objects:
print ">>>>> Object with keyword \"test\" found at " + obj.getPath()
Python (IronPython)
objects = dm.FindByKeyword("test")
if objects.Count == 0:
print ">>>>> No objects found with keyword \"test\""
else:
for obj in objects:
print ">>>>> Object with keyword \"test\" found at " + obj.Path
C#
HashSet<ModelObject> results = dm.FindByKeyword("test");
if (results.Count == 0)
Console.WriteLine(">>>>> No objects found with keyword \"test\"");
else
foreach (ModelObject result in results)
Console.WriteLine(">>>>> Object with keyword \"test\" found at " + result.Path);
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 227
EKM Connector End User API
Java
// Execute a saved query in the user's "My Queries" folder.
Set<ModelObject> objects = dm.executeSavedQuery("my-query", false);
// Execute a saved query in the "Shared Queries" folder.
Set<ModelObject> objects = dm.executeSavedQuery("shared-query", true);
Python (Jython)
# Execute a saved query in the user's "My Queries" folder.
objects = dm.executeSavedQuery("my-query", False)
# Execute a saved query in the "Shared Queries" folder.
objects = dm.executeSavedQuery("shared-query", True)
Python (IronPython)
# Execute a saved query in the user's "My Queries" folder.
objects = dm.ExecuteSavedQuery("my-query", False)
# Execute a saved query in the "Shared Queries" folder.
objects = dm.ExecuteSavedQuery("my-query", True)
C#
// Execute a saved query in the user's "My Queries" folder.
HashSet<ModelObject> objects = dm.ExecuteSavedQuery("my-query", false);
// Execute a saved query in the "Shared Queries" folder.
HashSet<ModelObject> objects = dm.ExecuteSavedQuery("shared-query", true);
This executes a query that searches only Workbench project archive objects. In addition, you must
specify the query operation to perform. This is one of match all rows or match any rows:
QueryOperation queryOp = new QueryOperation();
queryOp.setMatch(QueryMatch.ALL);
Next, you need to add rows to the query operation. This is where you specify the actual properties and
values to search:
List<QueryRow> rows = new ArrayList<QueryRow>();
QueryRow row = myQuery.createRow(“property”, Condition.EQUAL, “value”);
queryOp.setRows(rows);
You can also limit the query to a specific location in the EKM server. This is done by setting the path
of the query. This path must be an actual EKM path. To do this, make sure to fix up the path prior to
setting it in the query:
String path = PathUtils.fixUpPath(“/Data/My Data”, “AnEkmUsername”);
myQuery.setPath(path);
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
228 of ANSYS, Inc. and its subsidiaries and affiliates.
Using the Library in Client Applications
14.2.4. C.R.U.D.
C.R.U.D. stands for Create, Read, Update, and Delete. Searching for objects, as described previously,
covers the Read portion of the acronym. The following section will cover the other portions.
Java
Map<String, ModelSpec> types = dm.getModelSpecs();
for (String type : types.keySet())
System.out.println(">>>>> " + type + " : Label : " + types.get(type).getLabel());
Python (Jython)
types = dm.getModelSpecs()
for type in types:
print ">>>>> " + type + " : Label : " + types[type].getLabel()
Python (IronPython)
types = dm.GetModelSpecs()
for type in types.Keys:
print ">>>>> " + type + " : Label : " + types[type].Label
C#
Dictionary<string, ModelSpec> specs = dm.GetModelSpecs();
foreach (string type in specs.Keys)
Console.WriteLine(">>>> " + type + " Label: " + specs[type].Label);
In the above examples, the type is the internal type name (for example, AdobePdfFile) and getLabel
/Label returns a localized, human readable label (for example, Adobe Acrobat Document). Once the in-
ternal type name of a new object has been determined, it can be used to create the object. This is
shown in the examples below.
Java
dm.createModelObject("/Data/My Data/My Workbench Projects", "Folder");
Python (Jython)
dm.createModelObject("/Data/My Data/My Workbench Projects", "Folder")
Python (IronPython)
dm.CreateModelObject("/Data/My Data/My Workbench Projects", “Folder”)
C#
dm.CreateModelObject("/Data/My Data/My Workbench Projects", “Folder”);
Since folders are one of the more likely object types to be created by the library, a convenience method
is provided to do this.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 229
EKM Connector End User API
Java
dm.createFolder("/Data/My Data", "My Projects");
Python (Jython)
dm.createFolder("/Data/My Data", "My Projects")
Python (IronPython)
dm.CreateFolder("/Data/My Data", "My Projects")
C#
dm.CreateFolder("/Data/My Data", "Test");
Java
1. ModelObject folder = dm.findByPath("/Data/My Data/My Projects");
2. folder.setDescription("Folder for my personal projects");
3. VariantFactory vf = conn.getVariantFactory();
4. Variant value = vf.createVariant(25);
5. folder.setProperty("maxNumberProjects", value);
6. dm.updateModelObject(folder);
Python (Jython)
1. folder = dm.findByPath("/Data/My Data/My Projects")
2. folder.setDescription("Folder for my personal projects")
3. vf = conn.getVariantFactory()
4. value = vf.createVariant(25)
5. folder.setProperty("maxNumberProjects", value)
6. dm.updateModelObject(folder)
Let’s look at this example in more detail. All property values stored in an object in EKM are stored as a
Variant. A Variant is a data structure that can store any type of data including strings, numbers, lists,
and even references to other objects. Therefore, when you set a property using the setProperty
operation, you must first create a Variant instance. This is done using the VariantFactory. This is
shown on lines 3-5 in the examples above. Once the object has been modified, you must update it on
the server as shown on line 6 in the examples above. Doing the above operation in C#/IronPython is
slightly different.
Python (IronPython)
1. folder = dm.FindByPath("/Data/My Data/My Projects")
2. folder.SetUserProperty(“description”, VariantFactory.CreateVariant("My test folder"));
3. value = VariantFactory.CreateVariant(25);
4. if folder.Properties.ContainsKey("maxNumberProjects"):
5. folder.SetUserProperty("maxNumberProjects", value)
6. else:
7. folder.AddProperty(ModelSpec.TAGS_CATEGORY, "maxNumberProjects", value);
8. dm.UpdateModelObject(folder);
C#
1. ModelObject folder = dm.FindByPath("/Data/My Data/My Projects");
2. folder.SetUserProperty(“description, VariantFactory.CreateVariant("My test folder"));
3. Variant value = VariantFactory.CreateVariant(25);
4. if (!folder.Properties.ContainsKey("maxNumberProjects"))
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
230 of ANSYS, Inc. and its subsidiaries and affiliates.
Using the Library in Client Applications
The key difference here is that when setting a “user property” in C# or IronPython, you must first check
to see if it exists, and add the property if it does not. This is shown on lines 4-7.
Deleting Objects
The function of deleting objects on the server is shown in the examples below.
Java
dm.deleteModelObject("/Data/My Data/My Projects");
Python (Jython)
dm.deleteModelObject("/Data/My Data/My Projects")
Python (IronPython)
dm.DeleteModelObject("/Data/My Data/My Projects")
C#
dm.DeleteModelObject("/Data/My Data/My Projects");
Java
ModelObject folder = dm.findByPath("/Data/My Data/My Projects");
Set<PermissionAction> actions = new HashSet<>();
actions.add(PermissionAction.DELETE);
if (dm.hasPermission(folder, actions))
dm.DeleteModelObject(folder.getPath());
Python (Jython)
folder = dm.findByPath("/Data/My Data/My Workbench Projects")
actions = [PermissionAction.DELETE]
if dm.hasPermission(folder, actions):
dm.deleteModelObject("/Data/My Data/My Projects")
Python (IronPython)
folder = dm.FindByPath("/Data/My Data/My Projects")
actions = List[PermissionAction]()
actions.Add(PermissionAction.DELETE)
if dm.HasPermission(folder, actions):
dm.DeleteModelObject(folder.Path)
C#
ModelObject folder = dm.FindByPath("/Data/My Data/My Projects");
HashSet<PermissionAction> actions = new HashSet<PermissionAction>();
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 231
EKM Connector End User API
actions.Add(PermissionAction.DELETE);
if (dm.HasPermission(folder, actions))
dm.DeleteModelObject(folder.Path);
Java
ModelObject folder = dm.createFolder("/Data/My Data", "My Projects");
if (dm.lock(folder, true)) {
try {
// Modify the folder
} finally {
dm.unlock(folder, true);
}
} else {
System.err.println(“>>> Unable to lock the folder for exclusive use”);
}
Python (Jython)
folder = dm.createFolder("/Data/My Data", "My Projects")
if dm.lock(folder, True):
try:
# Modify the folder
finally:
dm.unlock(folder, True)
else:
print “>>>> Unable to lock the folder for exclusive use”
Python (IronPython)
folder = dm.CreateFolder("/Data/My Data", "My Projects")
if dm.Lock(folder, True):
try:
# Modify the folder
finally:
dm.Uunlock(folder, True)
else:
print “>>>> Unable to lock the folder for exclusive use”
C#
ModelObject folder = dm.CreateFolder("/Data/My Data", "My Projects");
if (dm.Lock(folder, true))
{
try
{
// Modify the folder
}
finally
{
dm.Unlock(folder, true);
}
}
else
Console.WriteLine(“>>>> Unable to lock folder for exclusive use”);
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
232 of ANSYS, Inc. and its subsidiaries and affiliates.
Using the Library in Client Applications
To use the version control system, an application must first add an object to the version control system.
Then the object must be checked out prior to modifying it. After an object is modified and updated, it
must be checked back in to create a new version of the object. If an object no longer needs to be
tracked, an application can also remove it from version control. At any time, an application can get the
history of a versioned object. The history includes version number, the user that modified the object,
comments related to the modification, and the date the version was created. Similar to locking and
unlocking, any time an object is added to version control, checked out, checked in, or removed, the
application must indicate if the action should be applied to all of the children of the object.
The examples below show how an application can access and use the version control system.
Java
ModelObject folder = dm.createFolder("/Data/My Data", "My Projects");
folder = dm.addToVersionControl(folder, true);
folder = dm.checkout(folder, true);
folder.setDescription("foo bar");
dm.updateModelObject(folder);
folder = dm.checkin(folder, "Set the description", true);
Map<String, VersionHistoryItem> history = dm.getVersionHistory(folder);
for (Map.Entry<String, VersionHistoryItem> entry : history.entrySet()) {
System.out.println(">>>>> Version number: " + entry.getKey());
VersionHistoryItem item = entry.getValue();
System.out.println(">>>>> Comment: " + item.getComment());
System.out.println(">>>>> User: " + item.getUsername());
System.out.println(">>>>> Date: " + item.getDate());
}
folder = dm.checkout(folder, true);
dm.removeFromVersionControl(folder, true);
Python (Jython)
folder = dm.createFolder("/Data/My Data", "My Projects")
folder = dm.addToVersionControl(folder, True)
folder = dm.checkout(folder, True)
folder.setDescription("foo bar")
dm.updateModelObject(folder)
folder = dm.checkin(folder, "Set the description", True)
history = dm.getVersionHistory(folder)
for key in history:
print ">>>>> Version number: " + key
item = history[key]
print ">>>>> Comment: " + item.getComment()
print ">>>>> User: " + item.getUsername()
print ">>>>> Date: " + str(item.getDate())
folder = dm.checkout(folder, True)
dm.removeFromVersionControl(folder, True)
Python (IronPython)
folder = dm.CreateFolder("/Data/My Data", "My Projects")
folder = dm.AddToVersionControl(folder, True)
folder = dm.Checkout(folder, True)
folder.SetUserProperty(ModelSpec.DESCRIPTION_PROPERTY,
VariantFactory.CreateVariant("My test folder"));
dm.UpdateModelObject(folder)
folder = dm.Checkin(folder, "Set the description", True)
history = dm.GetVersionHistory(folder)
for kvp in history:
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 233
EKM Connector End User API
C#
ModelObject folder = dm.CreateFolder("/Data/My Data", "My Projects");
folder = dm.AddToVersionControl(folder, true);
folder = dm.Checkout(folder, true);
folder.SetUserProperty(ModelSpec.DESCRIPTION_PROPERTY,
VariantFactory.CreateVariant("My test folder"));
folder = dm.UpdateModelObject(folder);
folder = dm.Checkin(folder, "Set the description", true);
Dictionary<string, VersionHistoryItem> history = dm.GetVersionHistory(folder);
foreach (KeyValuePair<string, VersionHistoryItem> entry in history)
{
Console.WriteLine(">>>> Version number: " + entry.Key);
VersionHistoryItem item = entry.Value;
Console.WriteLine(">>>> Comment: " + item.Comment);
Console.WriteLine(">>>> User: " + iteme.Username);
Console.WriteLine(">>>> Date: " + item.Date);
}
folder = dm.Checkout(folder, true);
dm.RemoveFromVersionControl(folder, true);
Java
ModelObject destination = dm.findByPath(“/Data/My Data/My Projects”);
List<String> files = new ArrayList<>();
files.add(“/projects/my-project.wbpj”);
TransferEventListener listener = new MyTransferEventListener();
dm.upload(files, destination.getPath(), new ArrayList<String>(), listener), true;
//
// Wait for the upload to complete and check the status
// to ensure it was successful.
//
List<String> toDownload = new ArrayList<>();
toDownload.add("/Data/My Data/My Projects/my-project.wbpz");
dm.download(toDownload , System.getenv("TEMP"), true, listener);
//
// Wait for the download to complete and check the status
// to ensure it was successful.
//
Python (Jython)
toUpload = [“/projects/my-project.wbpz”]
destination = dm.findByPath(“/Data/My Data/My Projects”)
listener = MyTransferEventListener()
dm.upload(toUpload, destination.getPath(), None, listener, True)
#
# Wait for the upload to complete and check the status
# to ensure it was successful.
#
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
234 of ANSYS, Inc. and its subsidiaries and affiliates.
Using the Library in Client Applications
Python (IronPython)
toUpload = List[str]()
toUpload .Add(“/projects/my-project.wbpz”)
destination = dm.FindByPath("/Data/My Data/My Projects")
listener = MyTransferEventListener()
dm.Upload(toUpload, destination.Path, listener, True)
#
# Wait for the upload to complete and check the status
# to ensure it was successful.
#
toDownload = List[str]()
toDownload .Add("/Data/My Data/My Projects/my-project.wbpz")
dm.Download(toDownload, os.environ["TEMP"], True, listener)
#
# Wait for the download to complete and check the status
# to ensure it was successful.
#
C#
List<string> toUpload = new List<string>();
toUpload.Add(“/projects/my-project.wbpz”);
ModelObject destination = dm.FindByPath(“/Data/My Data/My Projects”);
TransferEventListener listener = new MyTransferEventListener();
dm.Upload(toUpload, destination.Path, listener, true);
//
// Wait for the upload to complete and check the status
// to ensure it was successful.
//
List<string> toDownload = new List<string>();
toDownload.Add("/Data/My Data/My Projects/my-project.wbpz");
dm.Download(toDownload, Environment.GetEnvironmentVariable("TEMP"), true, listener);
//
// Wait for the download to complete and check the status
// to ensure it was successful.
//
Java
AdministrationManager mm = conn.getAdministrationManager();
ModelObject user = mm.createUser(“jsmith”);
ModelObject group = mm.createGroup(“engineers);
List<String> users = new ArrayList<>();
users.add(user.getName());
mm.addUsersToGroup(users, group.getName());
user = mm.findUser(user.getName());
group = mm.findGroup(group.getName());
if (!mm.belongsTo(user, group))
System.err.println(">>>>> " + user.getName() + " not member of " + group.getName());
else
mm.removeUsersFromGroup(users, group.getName());
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 235
EKM Connector End User API
Python (Jython)
mm = conn.getAdministrationManager()
user = mm.createUser(“jsmith”)
group = mm.createGroup(“engineers”)
users = [user.getName()]
mm.addUsersToGroup(users, group.getName())
user = mm.findUser(“jsmith”)
group = mm.findGroup(“engineers”)
if not mm.belongsTo(user, group):
print ">>>>> " + user.getName() + " not member of " + group.getName()
else:
mm.removeUsersFromGroup(users, group.getName())
Python (IronPython)
mm = conn.getAdministrationManager()
user = mm.CreateUser(“jsmith”)
group = mm.CreateGroup(“engineers”)
users = List[str]()
users.Add(user.Name)
mm.AddUsersToGroup(users, group.Name)
user = mm.FindUser(user.Name)
group = mm.FindGroup(group.Name)
if not mm.BelongsTo(user.Name, group.Name):
print ">>>>> " + user.Name + " not member of " + group.Name
else:
mm.RemoveUsersFromGroup(users, group.Name)
C#
AdministrationManager mm = conn.GetAdministrationManager();
ModelObject user = mm.CreateUser(“jsmith”);
ModelObject group = mm.CreateGroup(“engineers”);
List<string> users = new List<string>();
users.Add(user.Name);
mm.AddUsersToGroup(users, group.Name);
user = mm.FindUser(user.Name);
group = mm.FindGroup(group.Name);
if (!mm.BelongsTo(user.Name, group.Name))
Console.WriteLine(">>>> " + user.Name + " not member of " + group.Name);
else
mm.RemoveUsersFromGroup(users, group.Name);
Java
String script=
"obj = ekm.getObjectByPath(\"/Data/Shared Data\")\n" +
"print \"Found object: \" + str(obj)\n";
dataManager.executeScript(script);
System.out.println(">>>>> Current server date/time is " + adminManager.getServerTime();
ModelObject group = adminManager.createGroup("ParentGroup");
String id = group.getID();
adminManager.deleteMember(group.getName());
List<String> idsToRestore = new ArrayList<String>();
idsToRestore.add(id);
adminManager.restoreRecycleBin(idsToRestore);
adminManager.deleteMember(group.getName());
adminManager.clearRecycleBin();
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
236 of ANSYS, Inc. and its subsidiaries and affiliates.
Submitting and Monitoring Jobs
Python (Jython)
script = \
"obj = ekm.getObjectByPath(\"/Data/Shared Data\")\n" + \
"print \”Found object: \” + str(obj)\n" dataManager.executeScript(script)
print ">>>>> Current server date/time is " + str(adminManager.getServerTime())
group = adminManager.createGroup("ParentGroup")
id = group.getID()
adminManager.deleteMember(group.getName())
ids = [id]
adminManager.restoreRecycleBin(ids)
adminManager.deleteMember(group.getName())
adminManager.clearRecycleBin()
Python (IronPython)
script = \
"obj = ekm.getObjectByPath('/Data/Shared Data')\n" + \
"print 'Found object: ' + str(obj)\n"
dataManager.ExecuteScript(script)
print str(adminManager.GetServerTime())
group = adminManager.CreateGroup("ParentGroup")
ids = List[str]()
ids.Add(group.ArchiveId)
adminManager.DeleteMember(group.Name)
adminManager.RestoreRecycleBin(ids)
adminManager.DeleteMember(group.Name)
adminManager.ClearRecycleBin()
C#
StringBuilder script = new StringBuilder("a = 1\n");
script.Append("print 'a = ' + str(a)\n");
script.Append("b = 2\n");
script.Append("print 'b = ' + str(b)\n");
script.Append("print 'a + b = ' + str(a + b)\n");
dataManager.ExecuteScript(script.ToString());
Console.WriteLine(am.GetServerTime());
ModelObject parent = adminManager.CreateGroup("ParentGroup");
string id = parent.ArchiveId;
adminManager.DeleteMember(parent.Name);
List<string> idsToRestore = new List<string>();
idsToRestore.Add(id);
adminManager.RestoreRecycleBin(idsToRestore);
adminManager.DeleteMember(parent.Name);
adminManager.ClearRecycleBin();
Java
JobManager rjm = conn.getJobManager();
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 237
EKM Connector End User API
System.out.println("=============================");
System.out.println("GetJobStatus: " + jobStatus);
System.out.println("IsReleased: " + jobState.isIsReleased());
System.out.println("=============================");
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
238 of ANSYS, Inc. and its subsidiaries and affiliates.
Submitting and Monitoring Jobs
Thread.sleep(1000);
}
while (jobStatus == JobStatus.Running || jobStatus == JobStatus.Queued);
processWebResult(webResult);
ReleaseData releaseData = new ReleaseData(true, false);
String releaseDataStr = releaseData.serialize();
String releaseJobResultStr = rjm.ReleaseJob(uniqueCallId, jobSpaceId, batchJobId, releaseDataStr);
webResult = AbstractSerializableData.deSerialize(releaseJobResultStr, new TypeToken<WebResult<?>>() {});
processWebResult(webResult);
...
// helper function
public static <T extends Object> T processWebResult(WebResult<T> webResult) throws IngressException {
ServiceCallOutcome outcome = webResult.getOutComeEnum();
if (outcome.equals(ServiceCallOutcome.Failure) || outcome.equals(ServiceCallOutcome.Exception)) {
Throwable cause = new Throwable(webResult.getStackTrace());
IngressException e = new CommonsException("job.generalError", cause, webResult.getFailureMessage());
throw e;
}
T resultData = webResult.getData();
return resultData;
}
Python (IronPython)
# set this path to one that contains commands.xml and SecInput.txt
job_files_path = "C:\\temp\\job_files"
jm = conn.getJobManager()
configQueueName = "Local"
markerName = tempfile.NamedTemporaryFile('w+b', delete=False).name
associatedUncPathsForClientDirectory = List[str]([]).AsReadOnly()
jobSpaceCreationData = JobSpaceCreationData(markerName, client_directory_path, str(uuid.uuid4()), associatedUnc
jobSpaceCreationResult = jm.CreateJobSpace(jobSpaceCreationData);
jobSpaceId = jobSpaceCreationResult.JobSpaceId
submitData = RsmSubmitData()
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 239
EKM Connector End User API
submitData.AutomaticInputs = True
submitData.AutomaticOutputs = True
submitData.ClientDirectory = client_directory_path
submitData.CommandsXmlFileName = "commands.xml"
submitData.DisplayName = "MyJob"
submitData.JobType = "TEST"
submitData.ConfiguredQueue = configQueueName
uniqueCallId = str(uuid.uuid4())
solverTranscriptFileSearchPatterns = List[str](["force.out"]).AsReadOnly()
submitReturnVal = jm.SubmitJob(uniqueCallId, jobSpaceId, submitData.Serialize(), PortalSubmitData(jobSpaceId, "
batchjobid = None
if submitReturnVal is not None:
print "submitReturnVal:" + submitReturnVal
webResult = Serializer.DeserializeWebResult[str](submitReturnVal)
batchjobid = webResult.Data
print "Batch Job Id = " + batchjobid
else:
print "submitReturnVal is null."
C#
//set this path to one that contains commands.xml and SecInput.txt
string jobFilesPath = "C:\\temp\\job_files";
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
240 of ANSYS, Inc. and its subsidiaries and affiliates.
Submitting and Monitoring Jobs
stat = jobState.JobStatus;
Console.WriteLine("=============================");
Console.WriteLine("GetJobStatus: " + stat);
Console.WriteLine("IsReleased: " + jobState.IsReleased);
Console.WriteLine("=============================");
Thread.Sleep(5000);
}
while (stat == JobStatus.Running || stat == JobStatus.Queued);
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 241
EKM Connector End User API
Important
These samples all have hard-coded server addresses, user names, and passwords. You will
need to modify them accordingly for your current installation.
The example below shows how to execute the sample applications using Ant.
F:\ekm170\v170\ekm-client>run-samples
Buildfile: F:\ekm170\v170\ekm-client\build-samples.xml
init:
[mkdir] Created dir: F:\ekm170\v170\ekm-client\build
compile:
[javac] F:\ekm170\v170\ekm-client\build-samples.xml:72: warning: 'includeantruntime' was not set, defaulting to
[javac] Compiling 9 source files to F:\ekm170\v170\ekm-client\build
run-samples:
[output omitted]
BUILD SUCCESSFUL
Total time: 39 seconds
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
242 of ANSYS, Inc. and its subsidiaries and affiliates.
Writing and Running a Python Script Using IronPython
To run one of these programs, open a command prompt or shell, change to the ekm-cli-
ent/samples/jython directory and type jython program-name. For example:
F:\ekm170\v170\ekm-client>cd samples\jython
F:\ekm170\v170\ekm-client\samples\jython>jython OpenCloseConnection.py
15:19:35,573 DEBUG RepositoryConnectionManager:? - Open started: temp[http://lebmmoales764:8080,null]
15:19:37,725 DEBUG RepositoryConnectionManager:? - Setup completed
15:19:37,726 INFO RemoteRepositoryAdapter:? - Using cache: false
15:19:37,849 DEBUG RepositoryConnectionManager:? - Open completed
>>>>> Connection Default@lebmmoales76412[http://lebmmoales764:8080,Default] opened
15:19:38,025 DEBUG RepositoryConnectionManager:? - Connection closed: Default@lebmmoales76412[http://lebmmoales764:8
>>>>> Connection Default@lebmmoales76412[http://lebmmoales764:8080,Default] closed
F:\ekm170\v170\ekm-client\samples\ironpython>ipy OpenCloseConnection.py
>>>>> Connection Default@lebmmoales7641 opened
>>>>> Connection Default@lebmmoales7641 closed
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 243
EKM Connector End User API
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
244 of ANSYS, Inc. and its subsidiaries and affiliates.
Writing and Running a Python Script Using IronPython
clr.AddReferenceToFile("bin//EkmClientApi.dll")
clr.AddReferenceToFile("bin//log4net.dll")
Next, the script needs to import any classes needed. For example, this script only needs specific access
to the ConnectionFactory class:
from com.ansys.ingress.client.api import EkmConnection
Finally, the script can open the connection and perform some task. The full script contained in
ListEkmFolder.py is provided below:
import clr
clr.AddReferenceToFileAndPath("bin//CookComputing.XmlRpcV2.dll")
clr.AddReferenceToFile("bin//CSConnector.dll")
clr.AddReferenceToFile("bin//EkmClientApi.dll")
clr.AddReferenceToFile("bin//log4net.dll")
import sys
if __name__ == "__main__":
conn = None
try:
conn = ConnectionFactory.Open(
"http://lebmmoales764:8080",
"ekmadmin",
"Adminuser123!"
)
print ">>>>> Connection " + conn.GetName() + " opened"
dm = conn.GetDataManager()
specs = dm.GetModelSpecs()
path = raw_input(">>>>> Enter path of object to list: ")
object = dm.FindByPath(path)
if object is None:
print ">>>>> Object not found at path: " + path
else:
print ">>>>> Contents of " + path
children = object.GetChildNames()
for name in children:
child = dm.FindByPath(object.Path + "/" + name)
print ">>>>> " + child.Name + " Type: " + specs[child.GetTypeName()].Label
except:
print sys.exc_info()[0]
print sys.exc_info()[1]
finally:
if conn:
conn.Close();
print ">>>>> Connection " + conn.GetName() + " closed"
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 245
EKM Connector End User API
Javadoc: ekm-client/doc/java/html/index.html
C# doc: ekm-client/doc/cs/html/index.html
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
246 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 15: Units: Defining and Configuring Using XML
EKM enables you to assign units to properties when you are defining a custom type. Units for built-in
types, however, are stored in a consistent system within the database and cannot be changed internally.
You can however, add units for built-in types that will display property values in the units that are
defined. Note that this only affects the presentation of property values in the user interface and not
the actual values that are stored.
The following terms are used for describing unit functionality in EKM:
• quantity: This refers to a physical quantity that can be measured in various units. For example, length
is a quantity that can be measured in various units such as m, f, and so on.
• unit: This refers to the unit of measurement of a physical quantity. For example, m and ft are units
for the quantity length.
• unit system: This refers to a consistent set of units for measuring various quantities. For example,
SI, British, and so on.
Units are defined for a particular workspace in the Units.xml file in the /Administration/Con-
figuration folder. This chapter describes the Units.xml file and explains how you can add units,
quantities, and unit systems that are displayed in the user interface. Changes to this file can be made
only in restricted configuration mode. Refer to Restricted Configuration (p. 35) for details on how you
can start and end the restricted configuration mode.
You can use the units and quantities defined in the Units.xml file to define properties of type Double
in custom types described in Defining Properties Using XML (p. 95). You can assign a quantity and
a unit for each Double property. If you assign a quantity and not a unit, then the property value
will be shown in the preferred unit system that is defined for the user in their preferences. Refer to the
Setting User Profiles and Preferences chapter in the EKM User's Guide for details.
The overall process for defining a unit XML file and configuring it for a workspace is as follows:
• Download the unit definition file (Units.xml) and add a unit (p. 249), quantity (p. 250) or unit sys-
tem (p. 250) using the schema definition for units (p. 248) and an XML editor.
• Start restricted workspace configuration mode if it has not already been started. See Starting Restricted
Configuration (p. 37).
• Upload the unit file using the (Upload) > Files/Archives Using the Browser method to the /Ad-
ministration/Configuration folder.
• Accept the workspace configuration. See Accepting the Configuration (p. 39).
The remainder of this chapter presents information on how to define new units in EKM using XML.
Topics include:
15.1. Schema Definition for Units
15.2. Adding a New Unit
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 247
Units: Defining and Configuring Using XML
XSD files are contained in the EKM_HOME/schema folder and are identified by the .xsd extension.
Important
Figure 15.1: Partial Listing of units.xsd Schema Definition (p. 248) shows the partial listing for units.xsd,
the XML schema definition (XSD) that is used for defining units in EKM. The complete listing is provided
in the EKM_HOME/schema folder.
<xsd:complexType name="Unit">
<xsd:attribute name="name" type="xsd:string" use="required" />
<xsd:attribute name="multFactor" type="xsd:double" use="required" />
<xsd:attribute name="addFactor" type="xsd:double" use="optional" />
</xsd:complexType>
<xsd:complexType name="Quantity">
<xsd:sequence>
<xsd:element name="unit" type="ekmUnits:Unit" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
<xsd:complexType name="Quantities">
<xsd:sequence>
<xsd:element name="quantity" type="ekmUnits:Quantity" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="UnitSystemQuantity">
<xsd:attribute name="name" type="xsd:string" use="required" />
<xsd:attribute name="unit" type="xsd:string" use="required" />
</xsd:complexType>
EKM also supplies a default Units.xml file that contains some predefined units, quantities, and unit
systems. The schema listing in Figure 15.1: Partial Listing of units.xsd Schema Definition (p. 248) show
that the units file consists of a root element named units and has the following child elements:
• quantities: contains a list of quantity element as children. Each quantity element has a list of
units elements as children.
• unitSystems. This has a list of unitSystem element as children. Each unitSystem element has
a list of quantity elements as children.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
248 of ANSYS, Inc. and its subsidiaries and affiliates.
Adding a New Unit
Figure 15.2: Partial Listing of Units.xml (p. 249) shows a partial listing of the Units.xml file. The complete
listing can be found in the EKM_HOME/conf folder in your EKM server setup, or in the /Administra-
tion/Configuration folder in the EKM repository.
• name: This is the name of the unit. For example, C is the name for centigrade unit in Figure 15.3: Quant-
ity and Unit Definition (p. 249).
• multFactor: This is the factor that needs to be multiplied to the unit value to convert it to SI. For
example, 1R = 0.555556K. SI units will always have multFactor equal to 1.0.
• addFactor: This is an optional attribute that needs to be added to the unit value to convert it to SI.
For example, 1C = (1+273.15)K. If the addFactor is not specified it is assumed to be 0.0.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 249
Units: Defining and Configuring Using XML
• Add a new quantity element to the units/quantities element. This element must have an attribute
name that holds the value of the quantity’s name and contains a list of child unit elements. See Fig-
ure 15.3: Quantity and Unit Definition (p. 249) for a sample quantity listing.
• Add the quantity to the various unitSystem elements. This is used to specify the unit to be used
for that quantity in each unit system. See Figure 15.4: Unit System (p. 250) for an example of quantity
elements within a unitSystem element.
The unitSystem element also has a number of child quantity elements. Each quantity element
has attributes name and unit. This specifies the unit name to be used for a particular quantity. For
example, Figure 15.4: Unit System (p. 250) shows a sample listing for a unitSystem named British. The
unit for the quantity energy is BTU. Thus if the user has specified the British unit system as the preferred
unit system in their user preferences, then the value of property with quantity energy will be displayed
in BTU units.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
250 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 16: Miscellaneous Tasks
This chapter presents information on how to perform miscellaneous administrative tasks in EKM. Topics
include:
16.1. Configuring a Common Scripts Library
16.2. Gathering Usage Statistics
16.3. Connecting to Remote File Servers
16.4. Managing Logs
16.5. Using VCollab for 3D Visualization in EKM
16.6. Using the EKM Server Diagnostics Tool
16.7. Lifecycle Approval Process for Process Templates
16.8. Using a Custom Background Image on the EKM Sign-in Page
16.9. Adding Custom Text to the EKM Sign-in Box
16.10. Customizing the Heading on the EKM Title Bar
Some sample scripts that make use of EKM's scripting interface are packaged in the EKM_HOME/ex-
amples/conf/scripts directory where the EKM server is installed. This folder is referenced by a
built-in remote folder named /Data/Shared Data/Sample Files. You can place any or all of
these scripts in the common /Administration/Configuration/Scripts folder for it to be
globally available in all contexts.
Important
The overall process for configuring a scripts library for a workspace is as follows:
• Start restricted workspace configuration mode if it has not already been started. See Starting Restricted
Configuration (p. 37).
• Accept the workspace configuration. See Accepting the Configuration (p. 39).
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 251
Miscellaneous Tasks
The usage report presents details on how many times a user has logged in, number of bytes uploaded
or downloaded, the number of searches executed and the number of processes or custom applications
executed. It keeps a record of the last 12 months and keeps track of the cumulative usage for each
user.
Note
When a new connection to a file or folder in a remote server is made, EKM creates a soft reference to
the remote file/folder and extracts metadata from it that can be used for report generation, searching,
and so on. However, before a user can create a remote file or folder connection, an EKM administrator
must define the remote file server in EKM. This is done from the Administration/Remote File
Servers folder using the New Remote File Server action. You can do this following the instructions
below in Defining a New Remote File Server (p. 252). There are also two remote file servers that are built-
in to EKM and are already defined. See Using Built-in Remote File Servers (p. 254) for details.
1. Go to the Administration section and select the Remote File Server page.
2. Select (New) > Remote File Server. This will open the New Remote File Server dialog box.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
252 of ANSYS, Inc. and its subsidiaries and affiliates.
Connecting to Remote File Servers
4. Enter the type of server or choose one from the drop-down list. Currently, File Server is the only
available option.
5. In the Server address field, enter the path of the remote file server or a folder within the file server. For
example:
\\fileserver\cae-folder
/nfs/fileserver/cae-folder
6. Select Extract keywords for full-text search if you want keywords to be extracted from files in this
server after upload or transfer to EKM. If you clear this option, then users can reference files in the server
but keywords won't be automatically extracted and you will not be able to search by keywords.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 253
Miscellaneous Tasks
7. Select Extract metadata if you want metadata to be extracted from files in this server after upload or
transfer to EKM. If you clear this option, then users can reference files in the server but metadata will not
be automatically extracted. This may be useful if you have a large repository of legacy data that you want
to quickly expose in EKM, but do not want the overhead of metadata extraction.
8. Click OK to create the file server. You can display the File Server Properties for the object using the
Properties display. You can also modify the server properties for the remote file server using the Edit
Properties dialog box.
The server address for the EKM Root Directory file is EKM_ROOT170, which is the directory where the
EKM server is set up.
The EKM Root Directory server, by default, is only referenced by the Sample Files folder in
/Data/Shared Data. However, as an admin user, you can create a Remote Folder or File that points
to any other location in EKM_ROOT170.
For more details on EKM_HOME and EKM_ROOT170, refer to EKM Path Variables.
You cannot delete the Audit Logs file server but you can change the location (server address) where
the log files are written to by editing the properties for the Audit Log object on the Administration/Re-
mote File Servers page.
EKM automatically synchronizes data on the Administration/Logs page at regular intervals. The frequency
and time of synchronization can be configured only by an EKM system administrator in the ekm.xml
configuration file. Alternatively data can be manually synchronized.
The log file is kept for 30 days and then automatically deleted. You can configure the duration of the
log file in the ekm.xml configuration file. See Configuring EKM Server Settings (p. 51) for details.
When you click on a log file, the contents of the file will be displayed as text in the file list window. A
sample audit log is shown in Figure 16.2: Sample Log Display (p. 255).
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
254 of ANSYS, Inc. and its subsidiaries and affiliates.
Using VCollab for 3D Visualization in EKM
• For each CAE file type from which you want to extract CAX images, you must specify the following attributes:
– imageName: To extract CAX files, the value of this attribute must be file.cax.
– imageApplication: For CAX files, the value of this attribute must be extractCaxImage.
– showContentViewAsDefault: The value for this type attribute must be false if you want the visu-
alization view to be the default view when you open the file in the EKM web client.
For more information about editing type attributes see Defining Type Attributes for a Custom
Type (p. 78).
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 255
Miscellaneous Tasks
• To make the extraction of CAX images possible, you must install VMoveCAE on the EKM server. You must
then edit the external application being used for image extraction (for example, extractCaxIm-
age.app.xml) and specify the execution path of VMoveCAE in the application’s settings. For more inform-
ation see Editing an External Application Definition (p. 143).
• To be able to visualize extracted image files in VCollab within EKM, each user must have either VCollab
Presenter or VCollab Presenter Lite installed on their system.
See http://www.vcollab.com for more information on VCollab products and VMoveCAE supported file
formats. VCollab 2012 release is supported in EKM for 3D visualization.
With these steps completed, when you upload a configured CAE file to a repository, EKM will automat-
ically extract a CAX image from the file and save it as a new EKM object of type VCollab File with the
appropriate extension. You can then display the 3D image by selecting (More) > Display > Image
when the CAE file is selected, or by selecting the Image tab if the CAE file is already open. The VCollab
viewer will be loaded in the EKM file list window and will display the 3D simulation image. You can
visualize the 3D image using the interactive tools that are available in the VCollab viewer. For more
details, see Displaying 3D Simulation Images Using VCollab.
• Delete WorkflowApprove.lc.xml. All process templates are executable by default. No approval is re-
quired.
Note
By default, the 'admin' group will be assigned promote privilege, but it can be configured
for assignment to some other group by admin.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
256 of ANSYS, Inc. and its subsidiaries and affiliates.
Adding Custom Text to the EKM Sign-in Box
1. Shut down the EKM server. Refer to the chapter on Starting and Connecting to EKM in the Installation
Guide for details.
2. If not already present, create a text file named custom.properties and save it in \Apache\htdocs.
3. Add the following entry to the custom.properties file, then save the file:
login.backgroundImage=/../../loginPageBackGroundImageFolder/loginPage-
BackGroundImage.png
Note
To revert the background to the default that ships with EKM, simply remove the login.back-
groundImage entry from the custom.properties file. Remember that you will need
to stop and restart the server in order for the change to take effect.
1. Shut down the EKM server. Refer to the chapter on Starting and Connecting to EKM in the Installation
Guide for details.
2. Go to EKM_HOME/bundles/en (or other language folder if using a different locale). If not already
present, create a text file named custom.properties.
3. Add a login.header entry to the custom.properties file which contains your custom text, as
shown in the example below:
login.header=ALERT! You are about to access CONFIDENTIAL, PROPRIETARY and TRADE SECRET INFORMATION of Your Or
The custom text will be displayed in the sign-in box when users launch EKM:
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 257
Miscellaneous Tasks
1. Shut down the EKM server. Refer to the chapter on Starting and Connecting to EKM in the Installation
Guide for details.
2. Go to EKM_HOME/bundles/en (or other language folder if using a different locale). If not already
present, create a text file named custom.properties.
3. In a text editor, add a home.header entry to the custom.properties file which contains your custom
text:
home.header=custom text
For example, if you want the heading to say ANSYS Engineering Knowledge Manager, you would
specify home.header=ANSYS Engineering Knowledge Manager.
4. Save the custom.properties file, and then restart the EKM server. The custom text will be displayed
on the title bar when users launch EKM.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
258 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 17: Backing Up and Restoring EKM
As with any application that stores important data, it is critical to establish a system of regular backups
of the EKM data and application files. In the event that data loss or corruption occurs, data can be restored
to the EKM server from a recent backup, minimizing data loss and interruption.
This chapter discusses where EKM stores data, how a member of the admin group can back it up, and
how to restore data to EKM in the event that data recovery is necessary.
Topics include:
17.1. Data Stored by EKM
17.2. Backing Up EKM
17.3. Restoring EKM
• EKM database
In order to fully back up EKM, it is necessary to back up the data at all of these locations.
The EKM database stores both user data and application data. Files that are uploaded to EKM are stored
outside the EKM database in the EKM data directory, but the EKM database contains records related to
those files. These records include references to the files in the EKM data directory, and metadata extracted
from the files. The EKM database also stores in-program objects such as users, groups, processes, and
so on.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 259
Backing Up and Restoring EKM
For each EKM version, a version-specific root directory (EKM version root) is installed under the parent
EKM_ROOT directory. For EKM 17.0, this directory is EKM_ROOT170. This directory corresponds to the
v170 directory under EKM_ROOT. For example:
Windows: \\server\share\ekm\v170
Linux: /server/share/ekm/v170
The EKM version root directory contains the EKM server home directory: EKM_ROOT170/ekm-server,
referred to as EKM_HOME.
The EKM version root directory also contains the EKM service control scripts: EKM_ROOT170/bin.
• EKM database
A backup of EKM that is made while EKM is running is referred to as a “hot” backup because the system
is running (“hot”) while the backup is taking place.
A backup of EKM that is made while EKM is stopped is referred to as a “cold” backup because the system
is not running (“cold”) while the backup is taking place. This requires stopping the application server
and database server that are used with EKM.
It is expected that in most installations, hot backups of EKM will be conducted regularly while cold
backups will be conducted less frequently on special occasions such as before an upgrade or during
periods of scheduled maintenance.
It is essential to perform backups of EKM on a regular basis. This section will discuss the backup pro-
cedure for EKM so that you can implement an appropriate backup procedure and schedule for your
EKM installation.
2. Back up the EKM Data, Version Root, Job Data, and Repository Directories (p. 262).
It is important to follow this procedure strictly in the sequence given below, as the order of operations
is relevant. A brief discussion of the order of operations will illustrate the backup procedure and explain
the relationships between the steps. Each step will also be discussed individually, in order to specify
what is required at each step.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
260 of ANSYS, Inc. and its subsidiaries and affiliates.
Backing Up EKM
Sequence:
1. The EKM database is backed up at time T1, using a database dump procedure that ensures consistency
of the dump at time T1. All application and user data in the EKM database are captured at time T1.
2. The EKM data directory is backed up at time T2_start where T2_start >= T1. This means that the backup
of the EKM data directory starts at the same time or after the EKM database backup. This operation
completes at time T2_end. All the data files stored in EKM are captured at time T2_start. Files added
between T2_start and T2_end are not relevant as described below.
The EKM version root, job data and repository directories can be backed up at any time.
Important
It is ABSOLUTELY CRITICAL that if garbage collection runs while a backup is in progress that
it does not delete any files that were still in use at time T1, as this can cause the backups to
become inconsistent, and data loss/corruption could result if they are used to restore from.
This can be ensured by setting the interval for dataStoreGC scheduled task to be greater
than the time it takes for a complete backup of the datastore. See the description of the
dataStoreGC setting in Scheduling Automatic Tasks (<scheduledTasks>) (p. 62) for more
details.
When restoring, the restore of the EKM database will take place with data from time T1, and the restore
of the EKM data directory will take place with data from time T2_start. This is not a problem because
of how the EKM data directory and EKM database are related. The end result is that a consistent set of
EKM data from time T1 will be restored to EKM. The internal workings of the EKM database and EKM
data directory ensure that the data in the EKM database and EKM data directory will be synchronized
to contain only data present at time T1. Any leftover, non-referenced data in the EKM data directory
will be cleaned up the next time the garbage collection (p. 261) is run (see Cleaning Up Unused Files)*.
*When the EKM database from T1 and the EKM data directory from T2_start are restored, the following
conditions apply:
1. Changes to the EKM database after time T1 are not captured because the backup captures the state
of the EKM database at time T1.
2. Additions made to the EKM data directory after T1 are discarded the next time the garbage collec-
tion (p. 261) is run, as they are not referenced by the EKM database backup from time T1.
3. Deletions from the EKM data directory after T1 are not carried out, as data files deleted from the EKM
data directory do not actually get deleted until the next time the garbage collection (p. 261) is run.
Note that this cleanup must not run between times T1 and T2_end.
4. Updates/edits to existing files in the EKM data store are implemented internally as adds/deletes, so
the previous rules governing additions and deletions apply to modifications of existing items.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 261
Backing Up and Restoring EKM
Note
For the MySQL database server, use the mysqldump command to back up the EKM
database. EKM uses the ACID-compliant InnoDB storage engine under MySQL, as opposed
to the default MyISAM storage engine, so certain options to the mysqldump command
must be used. These options are demonstrated in the example below.
Here is the suggested command-line for dumping the ekm database using mysqldump:
MYSQL_HOME/bin/mysqldump --databases ekm --single-transaction --hex-blob > ekm.sql
where MYSQL_HOME is the directory where the MySQL database server is installed.
17.2.1.3. Backing up the EKM Data,Version Root, Job Data, and Repository Directories
Once you have backed up the EKM database you can back up the EKM data, version root, job data, and
repository directories.
To back up these directories, take a full copy of each directory, including all files and subdirectories. It
is recommended that an enterprise-quality commercial backup solution be used to perform the file
backups of these directories.
• \datastore
• \jobdata
• \repository
• \v170 (EKM_ROOT170)
A partial restore, say of just the EKM version root directory, might be necessary if the files in this directory
were corrupted or accidentally deleted.
A restore of the EKM program/user data would be necessary if data within the EKM application got
corrupted. In this case, the EKM database and the EKM data directory would need to be restored.
In all cases, the EKM database and EKM data directory must be restored together because they are very
closely linked.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
262 of ANSYS, Inc. and its subsidiaries and affiliates.
Restoring EKM
• Restoring the EKM Data, Version Root, Job Data, and Repository Directories (p. 263)
For the MySQL database server, use the mysql command to restore the EKM database from the dump
created by the mysqldump command, as described in Backing up the EKM Database (p. 262). Here is
the suggested command-line for restoring the ekm database:
MYSQL_HOME/bin/mysql < ekm.sql
where MYSQL_HOME is the directory where the MySQL database server is installed.
After restoring the EKM database and EKM data directory, it is also necessary to clear the search indices
as instructed in Clearing the Search Indices (p. 263).
Important
When restoring the EKM database, it is also necessary to restore the EKM data directory from
the same backup set.
17.3.1.2. Restoring the EKM Data, Version Root, Job Data, and Repository Directories
You can restore these directories from your EKM data directory backup. This is a simple filesystem restore,
with no special commands to run.
After restoring anything from the EKM data or repository directory, clear the search indices as instructed
in Clearing the Search Indices (p. 263).
Important
When restoring the EKM data directory, it is also necessary to restore the EKM database from
the same backup set.
2. For each subdirectory in the workspaces directory (such as Default, root and so on), delete the index
subdirectory and all of its contents.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 263
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
264 of ANSYS, Inc. and its subsidiaries and affiliates.
Appendix A. Java Security Manager and EKM Scripting
The EKM server makes use of the Java Security Manager to prevent scripts executing on the server from
performing malicious operations. These operations could be done intentionally by a knowledgeable
script developer or inadvertently by a novice one. One of the main things the security manager prevents
is allowing scripts to arbitrarily read and write files anywhere on the server’s file system. By default,
scripts in EKM 17.0 will only be able to read and write files in the EKM_TEMP directory of the server.
Other limitations placed on scripts are the ability to start processes and access network resources exposed
to the server. In instances where a script has attempted to perform some privileged operation, the
system will report an access violation. For example, if a script attempted to write a file to the server’s
root directory, the following error would be encountered:
access denied (java.io.FilePermission C:\foo.txt write)
In some instances, there may be EKM users that have valid reasons to develop scripts that perform
operations expressly forbidden by the default security policy. In these instances, you have a way to
grant the script the necessary privileges to perform the operation. This is done by modifying the
scripting security policy. The scripting security policy is defined in a file called script.policy that
is located in EKM_HOME/conf. The default file is as follows:
//
// The following permissions apply to scripts executed within the context of an
// EKM server.
//
grant {
permission java.io.FilePermission "${jboss.home.dir}/modules/-", "read";
permission java.io.FilePermission "${jboss.home.dir}/standalone/deployments/-", "read";
permission java.io.FilePermission "${jboss.home.dir}/standalone/tmp/-", "read";
};
Note
The default script policy grants read access to the /modules and /standalone/deploy-
ments and /standalone/tmp directories under JBOSS_HOME. The EKM scripting interface
(Jython in particular) must be able to access these locations in order to function. Other loca-
tions under JBOSS_HOME do not have read access because they may contain sensitive in-
formation.
To grant privileges to scripts running on the server, you must insert the appropriate permission entries
within the brackets "{}" of the grant statement. For detailed information on the syntax of the policy
file, refer to the Java documentation located here:
http://docs.oracle.com/javase/7/docs/technotes/guides/security/PolicyFiles.html#FileSyntax
Because a likely permission needed by scripts is to access files or folders outside of the server’s EKM_TEMP
directory, the following is an example entry in the policy for providing scripts with this capability.
grant {
permission java.io.FilePermission "C:\\users\\jsmith\\data", "read";
};
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 265
Java Security Manager and EKM Scripting
In the above example, scripts executing on the server are granted permission to read files in
C:\users\jsmith\data as well as the server’s EKM_TEMP directory. If the scripts also needed to
access files within subdirectories of C:\users\jsmith\data, the permission entry would look as
follows:
grant {
permission java.io.FilePermission "C:\\users\\jsmith\\data\\-", "read";
};
The "-" at the end of the path indicates that this permission is applied to the specified directory as well
as any subdirectories. If write permission is needed within a directory, the entry would look like this:
grant {
permission java.io.FilePermission "C:\\users\\jsmith\\data", "read,write";
};
Once the script.policy file has been edited with the appropriate permission entries and saved,
you simply need to execute the script again. Assuming the appropriate permission entries were placed
in the policy, the script will execute without any access violations.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
266 of ANSYS, Inc. and its subsidiaries and affiliates.
Appendix B. Built-in Types - Reference
EKM uses an object-oriented system for data typing with EKM Object (p. 275) as the base type for all
data types. All other types directly extend EKM Object or extend some other type that is an extension
of EKM Object. When a type extends another type, it inherits all the features of the base type such as
properties, actions, displays and type attributes, and it can add new features of its own. This section
provides a detailed description of each built-in data type used in EKM. For each type, the base type
that it extends from is specified along with any new properties and type attributes added by the type.
For file types, it also notes the valid file extensions. Non-localized names of types and properties are
provided in parenthesis. Localized names are displayed in the user interface, whereas non-localized
names are used in configuration files (such as process templates and lifecycles) and macros.
Note
For general information on data types, see Object Types in the User's Guide.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 267
Built-in Types - Reference
Properties:
• Physics Types (physicsTypes): types of physics involved (Structural, Fluid Flow, and so on)
• Calculation Types (calculationTypes): types of calculations involved (Static, Transient, and so on)
Properties:
• Execution Process (executionMonitor): a reference variable for the process used to monitor the analysis
• Execution Process Template (executionWorkflow): the process template used to execute the analysis
• Last Successful Execution Start Time (lastSuccessfulExecutionStartTime): the last time the execution
was successfully started
• Process Template Variable (executionWorflowVar): a reference variable defined in the process that will
be executed when the analysis project is updated
Type Attributes:
• executionWorkflow: the path of the process template that will be executed when the analysis project
is updated
• executionWorflowVar: a reference variable defined in the process that will be executed when the ana-
lysis project is updated
Properties:
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
268 of ANSYS, Inc. and its subsidiaries and affiliates.
ANSYS Database/Mechanical APDL Database (AnsysDatabase)
• Properties (properties): This file can contain any number of ‘Nexxim Circuit', 'Nexxim Netlist, 'Planar EM
Circuit' and 'System Circuit'.
Properties:
• Creation Date (creationDate): the date this simulation file was created
• Large Deformation (largeDeformation): whether large deflection effects are included or not
• BC Types (bcTypes): boundary condition types like constraints, forces, surface loads and body loads in
this simulation
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 269
Built-in Types - Reference
• Material Models (materialModels): material models like creep, hyperelasticity and plasticity in this sim-
ulation
Properties:
Properties:
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
270 of ANSYS, Inc. and its subsidiaries and affiliates.
Batch Task (BatchWorkItem)
Properties:
• Status (status): A numeric code representing the current status of the running job
0 = Queued
1 = Running
2 = Cancelled
3 = Completed
4 = Failed
-1 = Invalid/Not Initialized
• Job Template (jobTemplate): Reference to the job template used for this job
• Execution Start Time (executionStartTime): The start time of the last execution of the job
• Execution End Time (executionEndTime): The end time of the last execution of the job
• Application (application): Reference to the application used in the last execution of the job
Properties:
• Queue Type (queueType): The type of job submission system (rsmNative, lsf, pbs, torque, windowsHpc, sge)
Properties:
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 271
Built-in Types - Reference
• Job (job): Reference to the Job (p. 282) that is associated with this batch task. When the job completes
and is removed, this will be blank.
Type Attributes:
• showContentViewAsDefault: Boolean flag that specifies whether the content view should be set to
default (false)
• extractImageOnUpload: Boolean flag that specifies whether an image should be automatically extracted
after the file is uploaded
Type Attributes:
• childObjectPrefix: Prefix used for child names in the catalog. All children of the catalog will start with
this prefix and end with a unique id.
Properties:
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
272 of ANSYS, Inc. and its subsidiaries and affiliates.
Data Extraction Monitor (DataExtractionMonitor)
Type Attributes:
Type Attributes:
Properties:
• Objects for Comparison (comparisonObjects): list of objects used for creating the Comparison Report
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 273
Built-in Types - Reference
Properties:
• URL Type (urlType): type of the application (script, JAVA or external URL)
• URL (applicationUrl): application identifier (for script based applications it is name of the initialization
macro)
Properties:
• Result Report Macro (resultReportMacro): When you click on the script in the web user interface, the
generated report is shown, rather than the script content. If this macro is not defined, the script contents
are shown.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
274 of ANSYS, Inc. and its subsidiaries and affiliates.
EKM Type (Type)
• Is Internal (_isInternal_): specifies whether the object is internal and should be hidden from the view
Type Attributes:
Properties:
• Host Name (hostname): The fully qualified host name of the server
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 275
Built-in Types - Reference
Properties:
Properties:
• Environment Variables (environmentVars): One or more environment variables (name, value) definitions.
(optional)
• Label (label): The name of the application as it appears in dialog boxes and other interface components.
Properties:
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
276 of ANSYS, Inc. and its subsidiaries and affiliates.
File (File)
Properties:
• Date Content Created (contentCreationTime): date when the file content was created. If the file was
uploaded using the browser, this is the date on which the file was uploaded to EKM. If the file was up-
loaded using the File Transfer Client, this is the last modification date of the file on the user's system
prior to upload.
• Date Content Modified (contentModificationTime): date when the file content was last modified. Initially
this will be the date on which the file was uploaded to EKM.
• Remote Item Location (remoteItemLocation): The location of the file in the remote server (shown only
if the file is located on a remote file server)
• Remote File Server (externalResource): The reference to the remote file server containing the file (shown
only if the file is located on a remote file server)
Type Attributes:
• extendBuiltInExtraction: (new object types only) Specifies whether additional extractors that are specified
will extend or replace the built-in extractors. When the value is set to true (default), the additional
extractors that you specify for metadata extraction in the metaDataApplication setting and sim-
ulation details report extraction in customReportApp setting will extend the built-in extractors so
that custom extract occurs after the built-in extraction. When the value is false, the additional extractors
will replace the built-in extractors so that built-in extraction does not occur at all.
• metaDataApplication: The name of the application used to extract metadata from this file.
• typeValidatorClass: The Java class used for finding the type of a file. This is used for automatic type as-
signment during uploads.
• showContentViewAsDefault: Specifies whether or not the content view of the CAE File is the default
view in the web interface.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 277
Built-in Types - Reference
Properties:
• Extract metadata (extractMetaData): Indicates whether metadata should be extracted from files on this
server
• Extract keywords for full-text search (extractKeywords): Indicates whether keywords should be extracted
from files on this server
Properties:
• Fluent Version (fluentVersion): which version of Fluent generated this case file
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
278 of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS File (HfssProject)
Properties:
Properties: This file can contain multiple "Material" and "Design" models.
A "Design" can have multiple "Analysis" models, each of which can have the following properties:
• Minimum Frequency (Eigenmode) (minimumFrequency): Minimum frequency in the case of a design with
the solution type of eigenmode.
An "Analysis" can have multiple "Frequency Sweep" models, each of which can have following properties:
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 279
Built-in Types - Reference
Properties:
Properties:
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
280 of ANSYS, Inc. and its subsidiaries and affiliates.
Interactive Job Submission Queue (InteractiveQueue)
Properties:
• Connection URL (connectionURL): Allows iPad users to open the VNC iPad app to connect to the remote
session
Properties:
• Queue Type (queueType): The type of job submission system (LSF, PBS, Moab, Torque, Neutro, SGE)
• Job Submission Queue (schedulerQueue): The job scheduler that submits jobs for execution
• Remote Type (remoteType): The remote serialization type (for example VNC or DVC)
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 281
Built-in Types - Reference
Properties:
Properties:
• Queue Type (queueType): The underlying job submission system to which a queue is mapped — that is,
the scheduler that will run the jobs.
– lsf (LSF)
– pbs (PBS)
– sge (SGE)
– moab (Moab)
– torque (Torque)
– neutro (Neutro)
Properties:
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
282 of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell File (AnsoftMaxwell)
Properties:
This file can have multiple ‘Maxwell 2D Designs’, ‘Maxwell 3D Designs’, and ‘RMxprt Designs’.
• Motion Types (Transient Solver) (motionTypes): Motion Types (for Transient solver only)
• Include Insulator Field (DC Conduction Solver) (includeInsulatorField): Whether insulator field is included
(for DC Conduction Solver only)
• Motion Types (Transient Solver) (motionTypes): Motion Types (for Transient solver only)
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 283
Built-in Types - Reference
• Operation Types (operationTypes): Operation types of solution setups added in the design
• Number Of Poles In Rotor (SRM, GRM) (numberOfPolesInRotor): Number of poles in rotor. (for Switched Re-
luctance Motor and Generic Rotating Machines)
• Number Of Poles In Stator (SRM, GRM) (numberOfPolesInStator): Number of poles in stator (for Switched
Reluctance Motor and Generic Rotating Machines)
• Source Type (GRM) (sourceType): Source type (for Generic Rotating Machines)
• Structure Type (GRM) (structureType): Structure type (for Generic Rotating Machines)
• Stator Type (GRM) (statorType): Stator type (for Generic Rotating Machines)
• Rotor Type (GRM) (rotorType): Rotor type (for Generic Rotating Machines)
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
284 of ANSYS, Inc. and its subsidiaries and affiliates.
Queue (Queue)
Properties:
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 285
Built-in Types - Reference
Properties:
• Remote Item Location (remoteItemLocation): The location of the folder in the remote server
• Remote File Server (externalResource): The reference to the remote file server containing the folder
Properties:
Properties:
• Component Names (componentNames): the names of all components used in the project
• Component Libraries (componentLibraries): the names of all component libraries used in the project.
This file can contain multiple 'Simplorer Design’, each of which has following properties:
– Solution Setups (solutionSetups): the names of solution setups that are associated with a given design
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
286 of ANSYS, Inc. and its subsidiaries and affiliates.
Workbench Journal File (WorkBenchJournalFile)
Properties:
Properties:
• Open this URL in a new window (openNewWindow): if true, opens the URL in a new browser window
Properties:
• Cache Server (cacheServer): Reference to the EKM Server (Server) (p. 275) representing the cache server
assigned to the user. If blank, user is not configured to use a cache server.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 287
Built-in Types - Reference
Properties:
• System Names (systemNames): The names of systems defined for the project.
• System Types (systemTypeNames): The types of systems defined for the project.
• Design Points (designPointNames): The names of design points defined for the project.
Type Attributes:
Properties:
• Engineering Data File (engineeringDataFile): reference to the engineering data file used
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
288 of ANSYS, Inc. and its subsidiaries and affiliates.
Task (WorkItem)
• This file can contain multiple WorkBench Simulation models or Mechanical models, each of which has
the following properties:
– Materials (materials):
– Parts (parts):
Properties:
• Monitoring Task (monitoringWorkItem): reference to the task (if any) monitoring this process
• Process template (workflow): reference to the template from which this process has been started
• Process template resource (workflowResource): Class path of an internal workflow associated with the
process
Properties:
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 289
Built-in Types - Reference
• Node (node): name of the node in the process corresponding to the task
• Reassignment Note (assignmentNote): The note shown when a task is reassigned to another user
• User (user): name of the user to which the task has been assigned
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
290 of ANSYS, Inc. and its subsidiaries and affiliates.
Appendix C. Lifecycles: Defining and Configuring Using XML
As an alternative to using EKM Studio, you can use an XML editor to define a lifecycle definition file. A
lifecycle XML file must adhere to the schema definition (p. 291) for lifecycles, and must be saved with
the .lc.xml extension so that it can be recognized by EKM and typed as a Lifecycle object.
Note
The file extension .lcxml was used in previous versions of EKM and is an allowable extension.
Once you have created a lifecycle XML file you will need to upload and configure the file as described
in Basic Steps for Creating, Configuring, and Managing Lifecycles (p. 155).
Lifecycle XML files are defined according to a XML Schema Definition file that describes the structure
or "grammar" that the XML code must adhere to. Schema definitions provide the building blocks that
will enable you to write valid XML files. lifecycle.xsd is supplied with your installation in the
EKM_HOME/schema folder.
Important
EKM_HOME is the directory where the EKM server application is installed. This is typically
EKM_BASE/ekm-server, where EKM_BASE is the EKM base directory.
This section and the proceeding sections assume that you have a basic understanding of XML constructs
and syntax. If you are unfamiliar with these technologies, you will need to review them before proceeding.
http://www.w3.org offers extensive tutorials and documentation. In particular, it is recommended that
you review the documentation on XML schemas found at: http://www.w3.org/TR/xmlschema-0. While
creating or editing XML files it is recommended that you use schema-aware XML editors. This will allow
you to easily create configuration files that are syntactically correct and reduce the likelihood of errors.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 291
Lifecycles: Defining and Configuring Using XML
XSD files are contained in the EKM_HOME/schema folder and are identified by the .xsd extension.
Important
EKM_HOME is the directory where the EKM server application is installed. This is typically
EKM_BASE/ekm-server, where EKM_BASE is the EKM base directory.
Figure 1: Partial Listing of lifecycle.xsd Schema Definition (p. 292) shows the partial listing for life-
cycle.xsd, the XML schema definition (XSD) that is used for defining lifecycles in EKM. The complete
listing is provided in the EKM_HOME/schema folder.
The listing shows that a lifecycle file consists of a root element named lifecycle. The lifecycle element
must contain the following:
See Defining a Lifecycle XML File (p. 293) for a description of each element.
<xsd:complexType name="Stage">
<xsd:sequence>
<xsd:element name="permission" minOccurs="0"
maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="type" minOccurs="1"
maxOccurs="unbounded">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="access" />
<xsd:enumeration value="create" />
<xsd:enumeration value="delete" />
<xsd:enumeration value="modify" />
<xsd:enumeration value="download" />
<xsd:enumeration value="lifecycle" />
<xsd:enumeration
value="fullControl" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="member" type="xsd:string"
minOccurs="1" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
292 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Lifecycles Using XML
C.1.2.1. Types
A single lifecycle can be associated with one or more than one types. The type element is used for
defining this association.
• name: used to specify the name of the type associated with this lifecycle. If you are associating the life-
cycle with a built-in type, you will need to use the non-localized type name as described in Ap-
pendix B (p. 267).
• enabledByDefault: used to specify whether the lifecycle is enabled by default when an instance
of the type is created. Its value can be either true or false. If set to true, this means that whenever
an object of this type is created, it will be associated with this lifecycle with the start stage as the current
stage. If set to false, the lifecycle will need to be enabled manually.
C.1.2.2. Stages
A stage defines a phase of the lifecycle. Within a stage you can define permissions that specify who
can access the object, modify it, or perform other operations on the object that is associated with the
lifecycle. You can also specify whether the objects needs to be automatically deleted from the repository
and if so after how many days.
• name: specifies the name of the stage. As with child names in custom types, node names cannot contain
the following special characters:
• demoteAllowed: specifies whether the object in this stage can be demoted to a previous stage. Its
value can either be true or false. If it is unspecified, its value is assumed to be true.
• expirationDays: specifies the number of days after which the object should be automatically deleted
from the repository. Usually this will only be specified in the last phase of the lifecycle, if you want an
obsolete object to be automatically deleted after a certain period of time. If it is unspecified, its value
is assumed to be 0, which means that the object is not deleted automatically and will be preserved
indefinitely.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 293
Lifecycles: Defining and Configuring Using XML
A stage definition may also contain any number of permission child elements. They are used to
specify permissions applicable in the current stage. A permission element consists of the following
child elements:
• type: specifies the type of the permission. One or more than one type elements can be specified in
a permission element. Valid values of type are:
– access: specifies who can access (or view) this object in the user interface
– lifecycle: specifies who can perform lifecycle operations such as promote and demote
– fullControl: specifies who has full control over the object. Full control means all permissions are
available, including the ability to change permissions.
• member: specifies the name of the user or group for which the permission is specified. One or more
than one member elements can be specified in a permission element. Its value must correspond to
a user or group name defined in EKM. You can also use * to specify the user who created the object.
The example in Figure 2: Stage Example 1 (p. 294) shows a lifecycle stage named Obsolete which does
not have any permissions associated with it, whose demoteAllowed attribute is set to false and
whose expirationDays attribute is set to 365 days. This means that once the object goes to this
stage, only the user designated as the Root User for a workspace can access this object, it cannot be
demoted to a previous stage and it will reside in the repository for 365 days before it is automatically
deleted.
The example in Figure 3: Stage Example 2 (p. 294) shows a lifecycle stage named Release with three
permission elements. The all group is given access and download permissions. Turbine Group
and Combustion Group have been given modify permission and Turbine Group Lead and
Combustion Group Lead have been given lifecycle permission. Because the expirationDays
attribute is not set, the object in this stage will not be automatically deleted. Also, because demoteAl
lowed is not specified, the object in this stage can be demoted to a previous stage.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
294 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Lifecycles Using XML
<type>lifecycle</type>
<member>Turbine Group Lead</member>
<member>Combustion Group Lead</member>
</permission>
</stage>
C.1.2.3. Transitions
A transition is used to specify the subsequent and preceding stages of the any lifecycle stage. A transition
can also optionally specify a signoff process for moving to the next stage.
• source: specifies the name of the lifecycle stage from which the transition begins
• destination: specifies the name of the lifecycle stage at which the transition ends
• Like process templates, lifecycles should have exactly one start stage. The start stage is the stage that
is not the destination of any transition. Unlike process templates, lifecycles can have more than one
end stage. The end stage is the stage that is not the source of any transition.
• Like process templates, lifecycles must be acyclic. For example, if you have a transition from stage A to
stage B, then you can’t have a transition from stage B to stage A. Similarly, if you have defined transitions
from stage A to stage B and from stage B to stage C, you can’t have a transition from stage C to stage
A. In this way, lifecycles, like process templates, are always Directed Acyclic Graphs.
• promoteValidationMacro: specifies the name of the macro that is used to perform validation
before a promote request can be processed
• promoteActionMacro: specifies the name of the macro that is used to perform an automatic action
after a promotion request has been processed
• demoteValidationMacro: specifies the name of the macro that is used to perform validation before
a demote request can be processed
• demoteActionMacro: specifies the name of the macro that is used to perform an automatic action
after a demote request has been processed
These optional macros are usually specified in the optional script element at the beginning of a life-
cycle definition. See the Defining Macros and Custom Dialogs chapter in the EKM User’s Guide to learn
more about macro definition and scripting. All these macros take the following arguments:
• an instance of ModelObjectInterface that specifies the object associated with the lifecycle.
These optional macros do not return any values. The validation macros may throw an exception if val-
idation fails. The action macros specify commands that are to be executed when the stage change
succeeds. For example, the following XML listing shows a transition with all four macros defined, followed
by the definition of each macro. This is a dummy example that is used for illustration purposes, only.
<transition source="Draft" destination="Release"
promoteActionMacro="promoteToReleaseAction"
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 295
Lifecycles: Defining and Configuring Using XML
promoteValidationMacro="promoteToReleaseValidation"
demoteActionMacro="demoteToDraftAction"
demoteValidationMacro="demoteToDraftValidation" />
<script>
promoteToReleaseValidation(model, nextStage) {
if (!model.getChildNames().contains("test-child"))
throw new RuntimeException("test-child doesn't exist");
}
promoteToReleaseAction(model, nextStage) {
ekm.startTransaction();
model.addChild(ekm.createObject("auto-created-folder", "Folder"));
ekm.commitTransaction();
}
demoteToDraftValidation(model, nextStage) {
if (model.getChildNames().contains("test-child"))
throw new RuntimeException("test-child exists");
}
demoteToDraftAction(model, nextStage) {
ekm.startTransaction();
model.getChild("auto-created-folder").delete();
ekm.commitTransaction();
}
</script>
In the listing, the promoteToReleaseValidation macro verifies that the object associated with
the lifecycle has a child named test-child and the demoteToDraftValidation macro verifies
that such a child does not exist. The promoteToReleaseAction adds a folder named auto-cre-
ated-folder to the object and the demoteToDraftAction removes this folder.
A transition definition may also contain any number of promoteSignoff or demoteSignoff child
elements. These elements are used to specify any number of signoff processes that can be associated
with promotion or demotion. Multiple signoff elements can be defined to model a multi-level signoff
process. For example if you specify two promoteSignoff elements, it means that the promotion
process will involve a two-level signoff. The first level signoff will need to be completed before the
second level signoff can begin.
• level: specifies the name of signoff level. There are no character restrictions for the level definition.
• members: specifies the names of users and groups involved in the signoff at this level. If you specify
more than one user or group, you will need to separate their names by a comma. For example: group-
1, group-2. In some cases, you may want to use the same lifecycle definition for various teams. In this
case, say the stages and transitions are the same and the only difference is the members that are involved
in the signoff process. For these situations, you can define a macro for determining the member names.
This macro could use some logic, based on object type or path, for example, to determine the list of
members to be used in a given context.
If you want to make use of this feature, you must do the following:
– Define the macro in the script tag as described above. The macro should take two arguments:
the object associated with the lifecycle and the name of the next stage. It should return either
an array or a list of strings. Each item in the list or array should correspond to a user or group
name. If it returns null or an empty list or array, then the signoff process will advance to the
next signoff level if it exists. If no more levels exist, the signoff process will be completed and
the request will be approved. The following XML listing shows a sample macro definition of
this type. In the example, the list of approvers will be “user1” if the object associated with the
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
296 of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Lifecycles Using XML
lifecycle is in the /Data/Shared Data/bar folder, “user1” and “user2” if the object is in
/Data/Shared Data/foo, or null if the object is in any other folder.
<script>
releaseLevel1(model, nextStage) {
if (model.getPath().startsWith("/Data/Shared Data/foo"))
return new String[] {"user1", "user2"};
else if (model.getPath().startsWith("/Data/Shared Data/bar")) {
list = new LinkedList();
list.add("user1");
return list;
}
}
</script>
– Define the members to be $ followed by the macro name as shown in the following listing:
<promoteSignoff members="$releaseLevel1" level="1""/>
• inclusive: specifies whether all members of the signoff committee need to approve the signoff at
this level. Its value can be either true or false. If it is set true or it is not specified (in which case its
value assumed to be true), then all members of the signoff committee must approve the signoff at
this level. If it is set to false, then any member can approve the level signoff.
• dueDays: specifies the number of days allowed for the signoff. If a user has not approved or rejected
the signoff by then, a daily email reminder is sent to the user. If it is not specified, then the value is as-
sumed to be 7.
The example in Figure 4: Transition Example 1 (p. 297) shows a transition from Draft stage to In-Work
stage. It has a single-level promote signoff involving Turbine Group. Because the inclusive attribute
is set to false, the signoff will be completed when any user from the Turbine Group accepts or
rejects the signoff.
The example in Figure 5: Transition Example 2 (p. 297) shows another transition from In-Work stage
to Release stage. It has a two-level promote signoff. The first level involves Combustion Group
Lead and Turbine Group Lead and the second level involves VP Engineering. Because the
inclusive attribute is not specified, all users in the first level will need to accept the signoff before it can
advance to the next level.
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 297
Release 17.0 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
298 of ANSYS, Inc. and its subsidiaries and affiliates.