Introduction
This document is intended to provide a detailed guide and examples on how to customize the business rule for the publication NC files as Documents.
Version – Validated on 2025x FD01 (FP)
Pre-requisites: User must be assigned with Owner Role
Licenses –
- CSV (Collaborative Industry Innovator)
- NSR (NC Shop Floor Programmer) or any other role with any Machining App
Disclaimer: Licenses mentioned above are as per 2025x documentation.
This particular Business Rule is already setup in the platform installation folder and triggered when publishing the NC file documents.
Below video demonstrates the OOTB behavior of the business rule. It also shows, how to set up the custom business rule in Data Setup and its execution and intended result.
Example Business Rule
Detail Explanation
This business rule is for defining how the NC files generated should be published on Manufacturing Program. It is already implemented with some basic settings in the installation folder of 3dExperience Platform. In this page we will see how we can modify this business rule to implement additional settings for the documents that are generated when NC files are published.
By implementing this business rule, we can control following aspects of the published document
- The type of the document-> Whether to create a Document or an Engineering Document
- The Name and Description of the document
- Whether to create new revision of the document if one already exists or to create new document, each time the NC file is published
- Valuate the custom attributes
Following script will explain how each of the above-mentioned aspects can be controlled in Business Rule.
Set the type of the Document
/* Type of PublishedDocument */ /* Default type is (CBP) "Document" */ /* To require Engineering document, set "VPMDocument" */ /* Type of specialized document can also be set here */ /* ------------------------------------------------------------------------------------------------ */ sDocumentType = "Document" Parameters->SetAttributeString("DocumentType", sDocumentType)
Set Name and Description of the document
/* Name of PublishedDocument */ /* Default is file name */ /* Example: to prepend the machine name */ Set sDocumentName = Parameters->GetAttributeString("DocumentName") set oNCMachineInstance = ThisObject if (oNCMachineInstance <> NULL) { sVName = oNCMachineInstance->GetAttributeString("PLM_ExternalID") sNewDocumentName = sVName + sDocumentName } Parameters->SetAttributeString("DocumentName", sNewDocumentName) Parameters->SetAttributeString("DocumentDescription", "Published Document for NC File " + sDocumentName)
Set the revision setting
/* To indicate if a new revision of Document will be created if one already exists */ /* Default is false */ /* ------------------------------------------------------------------------------------------------ */ bDocumentRevision = false Parameters->SetAttributeBoolean("CreateNewDocumentRevision", bDocumentRevision)
Valuate Custom Attributes
/* Attributes of specialized document */ /* Example: to set the simulation time in a custom attribute SimulationTime */ set oMfgProgram = Parameters->GetAttributeObject("ManufacturingProgram") if (oMfgProgram <> NULL) { ListDocAttr.Append(List("SimulationTime", oMfgProgram->GetSimulationTime())) Parameters->SetAttributeObject("ListDocumentAttributes", ListDocAttr) }
Current Limitation:
Currently we have one limitation in the implementation of this Business Rule in terms of evaluation of the custom attributes. The valuation of the custom attributes is working only with the custom document type and the custom attribute created on it. Otherwise, the business rule fails to create the published document with valuation of custom attribute on out of the box ENOVIA Document type.
The correction of this limitation is in progress.
Business Rule Setup
Business Rule opening Id - DELNCDocPublication_BL_ID
The Business Rule can be executed in two different ways.
DataSetup App: If you create the script through DataSetup, it remains persistent in the database, is stored on the server and available to all. The script opening ID will be available under Machining Resources.
CATRule/CATRuleExit: If you create the script using a CATRule, you must store the files
DELNCDocPublication.CATRule
andDELNCDocPublication.CATRuleExit
in..\resources\knowledge\scripts
. You can then edit the CATRule file or create a new CATRule and CATRuleExit files with an Opening ID of DELNCDocPublication_BL_IDYou can then execute the Business Rule when upgrading tool resources.
Note: Be careful while using this method as the setup is done on local machine and it is not available to all users. Each user will have to do the setup individually.
Important Note: If you are implementing the business rule using Data Setup method, make sure to comment out the Scripts from DELNCDocPublication.CATRule
file as by default this script is uncommented and is triggered when publishing the NC file.
Reference
-
Author
Person of Contact - @Sheetal MARDE
Special Thanks to @Vivek BAGALKOT and @Pavankumar K M for providing support in this topic.