Introduction
This document intended to provide a detailed guide and examples on how to write EKL script to get variant effectivity on System and operations.
Version – 2026xGA (For older version of 3DEXPERIENCE platform check older version of this article)
Pre-requisites
Licenses – These EKL scripts call 3DSpace web services, which require specific licenses to execute as mentioned in below table. (These are referred from developer documentation of web services)
Mfg. Process / System related web services
• MGA (DELMIA Process Management)
• CSV (Industry Innovation) For Reading Web Services
Model configuration, effectivity or IP Configuration related web services
• CFG (Configuration Management), for all dscfg web services
• CSV (Industry Innovation), For Reading Web Services
Disclaimer: Licenses mentioned above are as per 2026x documentation.
Logical Flow
The sequence of the scripts/ steps for this get effectivity EKL script is the following.
Example
Disclaimer: This code is just an example and should only be used by people who know the Enterprise Knowledge Language (EKL) and the DELMIA data model very well. The intent is not to provide a ready to deploy product code. So we are not responsible for any issues you may face with this code.
Note: The above script only support objects of System Type like General System, Workplan etc. For operation, it is needed to edit the script as given in the "Requirement 1" of the "Here under some Use Case about possible adaptation of the script" section of this page.
Detail Explanation
How to call web services
Steps followed for calling all web services.
- Create HTTP client.
- Define header for the HTTP client.
- Build web service URI.
- Perform GET/POST request.
- Retrieve the returned response code if it is zero / as per documentation then ok else error case.
- To retrieve the required content from the response traverse through returned data node or buffer.
For example – Below script calls web service to get effectivity of system instance.
// Get Effectivity on Instance found in above step
// Create an HTTP client
client = CreateHTTPClient()
// Defines Headers
client.AddRequestHeaders("Content-Type: application/json")
client.AddRequestHeaders("Accept: application/json")
client.AddRequestHeaders("SecurityContext: "+securityCtx)
client.AddRequestHeaders("ENO_CSRF_TOKEN: "+csrfToken)
Let jsonBody(String)
// Defines URI and Body
iURI = serverURL +"/resources/v1/modeler/dscfg/invoke/dscfg:getEffectivityContent"
jsonBody = "{"
jsonBody = jsonBody + "\\"ids\\":[\\""+strSelctSystemInstPID+"\\"],"
jsonBody = jsonBody + "\\"domain\\":\\"ALL\\","
jsonBody = jsonBody + "\\"view\\":\\"ALL\\","
jsonBody = jsonBody + "\\"format\\":\\"XML\\""
jsonBody = jsonBody + "}"
//Performs a POST request
oBuffer = client.Post(iURI, "HTTPDEFINED", jsonBody, oDTN)
// Checking if request return code is OK (rc = 0)
if (client.ReturnCode == 0)
{
// success
let jsonStr(String)
let rootJSON(JSONNode)
jsonStr = oDTN.ToJSON()
set rootJSON = new("JSONNode", "Root",NULL)
rootJSON.Parse(jsonStr)
Let memberList(List)
memberList = rootJSON.GetAttributeObject("effectivitiesContent")
if (memberList <> NULL AND memberList.Size() > 0)
{
Let firstMember(JSONNode)
Let variantMember(JSONNode)
firstMember = memberList.GetItem(1)
if(firstMember.HasAttribute("Effectivity_Variant"))
{
Let variantEffectivityValue(String)
variantEffectivityValue = firstMember.GetAttributeString("Effectivity_Variant")
oStrEffectExprsn = variantEffectivityValue
}
}
}
else
{
// failure
PopupMessage("client.ReturnCode - #, oBuffer - #", client.ReturnCode, oBuffer)
}Here under some Use Case about possible adaptation of the script
1. Requirement 1: Get effectivity of Operation objects in structure (OOTB and Specialized Types)
In above example we saw detailed explanation of how the script is written to get the effectivity of System object, there might be requirement where we need to get effectivity of Operation objects. In this case, user need to modify above script and reuse them.
Below are some of the changes required in the script to use it for other operations.
- Object selection
Based on from which type of object we want to retrieve effectivity we will set its type.
| Mfg. Item | Eng. Item | System | Resource |
|---|---|---|---|
| MfgProcessOccurrence | ProductOccurrence | ProdSystemOccurrence | ResourceOccurrence |
2. Requirement 2: Get effectivity expression in different format
Based on the values we pass as JSON load to web service the response we get will change and then we can utilize as per our need.
In our example, we used below values:
jsonBody = "{"
jsonBody = jsonBody + "\\"ids\\":[\\""+ strSelctSystemInstPID +"\\"],"
jsonBody = jsonBody + "\\"domain\\":\\"ALL\\","
jsonBody = jsonBody + "\\"view\\":\\"ALL\\","
jsonBody = jsonBody + "\\"format\\":\\"XML\\""
jsonBody = jsonBody + "}"We have different values available for different inputs for the JSON body. If we follow below table then we can have effectivity in different format or different view etc… (Below table is available in developer’s assistance documentation)
| Domain | string Domain is used to filter the effectivity information. Valid values for domain are EVOLUTION, VARIANT, ALL, Default. |
| view | string View is used to filter the effectivity information. Valid values for view are CURRENT, PROJECTED, ALL, Default. |
| format | string Format is used to define how effectivity expressions are returned in response. Valid values for format are TXT, XML. |
If we need to get effectivity expression in TEXT format and we want EVOLUTION effectivity with PROJECTED view then above JSON must be changed as below,
jsonBody = "{"
jsonBody = jsonBody + "\\"ids\\":[\\""+ strSelctSystemInstPID +"\\"],"
jsonBody = jsonBody + "\\"domain\\":\\"EVOLUTION\\","
jsonBody = jsonBody + "\\"view\\":\\"PROJECTED\\","
jsonBody = jsonBody + "\\"format\\":\\"TXT\\""
jsonBody = jsonBody + "}"How to Deploy
Follow below steps to deploy the above EKL script
- Download the Provided EKL Script
- Create one new "Physical Product" to act as a container for the EKL action and give it some suitable name. For ex. "Get_Variant_Effectivity_EKL_scripts"
- Create a new "Knowledge Action" in the newly created Physicals Product and give it a suitable name. Follow the sample video available on this page to know "How to create Knowledge Action".
- Set the input arguments as explained at the top of the script in the "Input output argument" comment.
- Save the script
- Execute the script
Author
Author - @RR
Person of Contact - @KA
