Enterprise Knowledge Language (EKL) – Basics

 

Overview

  • Enterprise Knowledge Language (EKL) is a programming language available in 3DEXPERIENCE, and is oriented to provide a quick development environment which includes knowledge packages, types, methods and functions to enable easy customization to automate task execution on Client or Server
  • EKL language is used to define programs and procedures that are specific for various kinds of Knowledge artifacts that are available for different 3DEXPERIENCE apps.
  • EKL is an Interpreted object oriented language based on DS C++ automation programming language.
  • Automation: Allows to create & manipulate existing classes, but does not allow to declare new classes. There is an extension, called KML(Knowledge Modeling Language) that adds some object modeling capabilities. This is part of Design Apps Developer Role (KAC) Know-How Apps Authoring suite, which is a series of apps that allows developers to define and manage custom applications (also known as Know-How apps) developed within the 3DEXPERIENCE platform.
  • Enterprise Knowledge Language (EKL) is used by a series of toolkits & products on top of V6 architecture. EKL is used for the below purpose:
    • Business Rules
    • Validation Rules
    • Generative Rules
    • Associative Rules
    • User Interface Logic Rules
  • Customers will use EKL to implement & execute rules from a Knowledge Automation or a Quality assurance perspective.
  • Administrators (at customer site) will use it to describe Business Rules that will adapt our products & foundations to their business processes.
  • DS Developers will also use it to describe & deliver Business Rules default implementation for their modelers.

 

Enterprise Knowledge Language (EKL) Categories

 

  • Mathematical Enterprise Language (M-EKL) 
    • Groups the language operators and the numerical functions (math, measures, …) necessary to express the sets of equations used to valuate parameters in Engineering Rules Capture.
  • Core Enterprise Language (C-EKL) 
    • Formulas
    • Design tables functions
    • Rules and checks provided in the Engineering Rules Capture app.
    • Constraints satisfaction feature provided in Design Optimization.
    • C-EKL adds the following language elements:
      • Keywords for control structures, like the “if… then… else” conditional statement in rules. Specific functions, like the ones dedicated to messages and prompts for user inputs, geometry construction or strings and lists manipulation. Additional operators, like the “=>” operator, which corresponds to a kind of “imply” keyword for checks.
    • C-EKL is used in the following Knowledge artifacts that are related to the update process through their parameters:
      • Formulas
      • Rules and checks provided in the Knowledge Advisor product
  • Advanced Enterprise Language (A-EKL) 
    • Basic attributes and methods
    • Search capabilities
    • Value pointers manipulation
    • Applications-specific services
    • A-EKL language inherits most of the operators, keywords and functions of C -EKL. 3DEXPERIENCE Native Client applications aim at creating design objects enriched by a knowledge type. A-EKL is the level of language to manipulate them as knowledge objects through tightly integrated knowledge artifacts.
      • Actions and reactions in Knowledge Advisor
      • Expert Rules in Knowledge Expert
      • Behaviors in BKT
      • Patterns in PKT
    • A-EKL also provides a full set of functionalities to manipulate 3DEXPERIENCE Native Client features as Knowledge Objects.
      • Knowledge Objects: basic attributes and methods
      • Search capabilities
      • Value pointers manipulation
      • Applications-specific services (constructors)
  • Extensible Enterprise Language (X-EKL)
    • Contains the applicative packages available in EKL and is also the way to add functions to the EKL language
    • Custom Functions are added using CAA development (users development).
    • User functions. BKT lets you create interactively new functions that may be used within A-EKL

EKL Language Levels

 

Enterprise Knowledge Language (EKL) Structure

 

3DEXPERIENCE Objects are manipulated using a federated object model composed of the following:

  • Types
    • A hierarchy of types (one type inherits only from one type)
  • Attributes
    • Each type has a list of attributes:
      • Simple (Boolean, String, Real, Integer, etc..)
      • Reference to other objects
      • List (of values or reference objects)
      • Components (aggregated objects or list of aggregated objects)
  • Functions & Methods
    • Methods are Defined on types (and inherited)
    • Functions work on objects
  • Arguments
    • Functions & methods have a list of arguments
      • Overloading is supported but polymorphism is not supported
      • Optional arguments are supported (with no default value – default value is defined in the implementation of the functions)
      • Variable arguments

 

Enterprise Knowledge Language (EKL) Object Hierarchy

EKL Language Object Hierarchy

 

Enterprise Knowledge Language (EKL) – Pros & Cons

  • EKL Pros
    • Attribute reading and tree navigation is very fast in interactive session.
    • Smart trigger (init, save, instantiate, import / export, etc.).
    • Easy coding (Visual Basic style)
    • Some apps / models have openings only in EKL.
    • An extensive list of APIs are available to choose from, for performing tasks that are related to Authoring Tools/3D Application.
  • EKL Cons
    • Restricted navigation: Propagate, update, check restrictions
    • Navigating a tree can be complicated in EKL. Authoring code is limited and may not be available for all links, models and types.
    • Use of EKL is limited to Triggers (Business Rules).
    • Complicated interactive launch in all apps
    • Some data types don’t have basic EKL methods. For example sheets / layouts.
    • We generally don’t know to do Authoring code in EKL => Creation / deletion, instantiation => To be done in CAA.
    • There are limitations to using Proxy objects because of the need to use APIs to access them.
    • As compared to JPOs, if BL is written with EKL, then upgrade from one version to another version is more difficult as merging is required.

 

Enterprise Knowledge Language (EKL) – Core Syntax – Comments & Variables

  • Comments to the scripts, to describe function, variable definition, etc.
    • Single-Line Comment : Single-line comments can be inserted into scripts using the “/” syntax:
    • Others: The /* and */ comment characters are supported.
  • Variable is a storage location associated with an identifier that contains a value. The EKL lets work with two types of variables: literals and objects.
  • Variable should be declared at the beginning of the script
  • Where Let is the keyword and the statement of the variable definition.
  • Name_of_the_Variable is the variable name and (Type) is the object’s internal type in EKL (String, Integer, etc.).
  • You can use the Set keyword for type casting the variable. Set keyword performs the assignment without checking the type. Result is NULL if type is not supported.
  • Multiple variable declaration is supported as shown in the EKL hierarchy diagram

 

Enterprise Knowledge Language (EKL) – Core Syntax – Operators

  • EKL Operators are special symbols that perform specific operations on one, two, or three operands, and then return a result
  • EKL Operators allow to manipulate and compare variables and other inputs, used throughout the code
Arithmetic operators
 + Addition operator (also concatenates strings)
Subtraction operator
* Multiplication operator
/ Division operator
( ) Parentheses (used to group operands in expressions)
= Assignment operator: Can be used with values, enumerates, objects (object A = object B if B is a subtype of A). Note that this operator is not available in the Set of Equations editor.
** Exponentiation operator
 
Logical Operators
and Logical conjunction on two expressions
or Logical disjunction on two expressions
 
Comparison Operators
<> Not equal to (Applies to values and objects)
== Equal to (Applies to values and objects)
>= Greater or equal to (Applies to values only)
<= Less than or equal to (Applies to values only)
< Less than (Applies to values only)
> Greater than (Applies to values only)
 
Type Operator
: Equivalent to the set keyword.

 

Enterprise Knowledge Language (EKL) – Core Syntax – Key Identifiers

  • Loops
    • For <variablename> while <condition>
    • Loop stops only when an expression becomes false
    • For <variablename> inside <list variable name>
    • Loop based on elements of list
  • Decisions
    • If…else if…else
    • Ternary Operator
  • Functions & Methods
  • Attributes & Constants
  • Message Functions
  • Notify & Report
Core Syntax – Control Flow
  • Control Flow statements can be used when working with the Enterprise Knowledge Language.
  • Control Flow statements are statements used to determine the order in which function calls and statements are executed when a script is running.
    • Involves the usage of the if – else if – else statements
    • This statement tells the program to execute only if a given condition evaluates to true.
Core Syntax – Loop
  • Loop is a sequence of instructions. It is used to repeat a block of code.
    • The for statement execute a loop based on the element of a list, where For…While Loop with a Counter
    • The for statement to execute where For…While Loop for each object in the list
Core Syntax – Functions and Methods
  • Function is a block of code that accomplishes a specific task and returns a value. A function takes an input, processes it, and returns a result. EKL provides a library of functions that can be accessed using the language browser. Also specific functions can be created by using Know-how Capture, to work with Reusable Functions.
  • Method is a code block associated with a Type, and which has access to its Attributes.
  • Functions & Methods perform operations on inputs, and can return data after the operation has been done.
Core Syntax – Attributes and Constants
  • Attributes represent all the information contained in a given type, i.e. VPMReference, VPMInstance, etc. Examples of attributes are Name, Description, etc.
    • The syntax for accessing attributes of a give type can be as shown in the diagram
  • Constants: It is an identifier for a simple value. As the name suggests, this value cannot change. The following constants are specified or recognized by Native Apps when programming Rules and Checks. As a result, they can be used anywhere in a relation in place of the actual values.
    • PI, E –> mathematical numerical constants
    • true, false –> Boolean
    • NULL –> to test if a variable is set or unset
Core Syntax – Types
  • Core Types and Functions
    • Feature abstract type provides a list of attributes available on each object.
    • Feature type is the basic type for all objects in 3DEXPERIENCE (all objects inherit from this particular type).
    • Feature type enables to manipulate, in a generic way, the 3DEXPERIENCE object mode by:
      • Naming and Commenting
      • Typing and Attributes
      • Navigation in the tree
      • Reading and writing attributes
      • Creating and deleting Objects

Enterprise Knowledge Language (EKL) – Message Functions

EKL provides 2 types of notification capabilities. They are discussed below

 
Popup Message

Show a notification message with the necessary information. User has to acknowledge the message to proceed further. Uses the API called PopupMessage(“string”, <string>)

 
Notify

Displays a silent notification on the top right corner of the screen. Notify message doesn’t block the user from performing the activity on the system. It disappears after a second. Uses an API called Notify(“string”, <string>)

 

Enterprise Knowledge Language (EKL) – Debug Variables

For any scripting or programming language debugging is crucial task for developer to find out issues with the code. EKL provides below variables to active traces on the output console. To enable traces specify below mentioned environment variables in the Environment text file.

  • CNEXTOUTPUT=CONSOLE
    • To display output console for 3DEXPERIENCE Native App / CATIA
  • CKE_CUSTO_TRACES=1
    • Display traces generated by the PLM / EKL customization engine on console
  • CKE_EVAL_TRACES=1
    • Display output values of the variables at run-time

FAQs on Enterprise Knowledge Language (EKL)

  • What does EKL stand for?
    • EKL stands for Enterprise Knowledge Language
  • EKL Full Form
    • EKL Full Form is Enterprise Knowledge Language
  • Is EKL Scripting Language?
    • Yes, EKL is Scripting Language.
  • Is EKL Language is available on CATIA?
    • EKL Language is available on CATIA and ENOVIA on 3DXEPREINCE Platform
  • What is EKL?
    • EKL is popular scripting language on 3DEXPERIENCE Platform from Dassault Systems

3DEXPEREINCE Enterprise Knowledge Language (EKL) YouTube Video

🎓 Checkout our course on 3DEXPEREINCE Enterprise Knowledge Language (EKL) at

https://plmcoach.com/3dexperience-ekl-training/

————————————————–
🌍 For PLM / CAD Training Visit

https://plmcoach.com

Follow PLM Coach on Social Media:

YouTube LinkedIn | Facebook

Twitter | Pinterest

📧 Contact PLM Coach:

Follow the link to Training Inquiry Form to provide your details

https://www.surveymonkey.com/r/PLMInfoV3

Follow the link to Text PLM Coach on WhatsApp

https://wa.me/917989703878

☏ Mobile Number ► +91-7989703878

💌 Email ► info@plmcoach.com

————————————————–

Scroll to Top