About InsertingThe insert program MQL command regenerates special macros in the Java source as it is placed back into a JPO (reverse name-mangling See Name Macros). If the JPO does not exist, the insert command creates it automatically. insert program FILENAME | DIRECTORY; For example: insert program ENOVIA_INSTALL/java/custom/testjpo_mxJPO.java OR insert program ENOVIA_INSTALL/java/custom/ The later will insert all the .java files in the specified directory. When programs are inserted, the package statement is stripped from the source code, and the package name is prepended to the name of the class to create the program object; in the above example, it will be named ENOVIA_INSTALL.java.custom.testjpo. In order to use the insert feature, the JPO source must follow the Java language naming convention for class code (i.e., no spaces, special characters, etc.) and also include "_mxJPO". All characters including and after "_mxJPO" are removed during insertion (refer to Name Macros.) Extracting and Inserting JPOsMacro processing is used by all program objects (JPO as well as Tcl) before they are run to allow value replacement for a macro in a program. In the resulting code the number of backslashes is halved when it finds 2 in a row. The extract command calls the macro processing code, so the files it produces can be executed by Java outside of ENOVIA Live Collaboration. This means that the insert command also needs to take macro processing into account. Therefore, (since version 10.5.1) the insert command doubles up any backslashes in JPO code going into the database. For example: If a JPO is written with a command that has 3 backslashes, when it is executed within ENOVIA Live Collaboration it goes to Java with 2 backslashes. If the same program is extracted, the command now includes 2 backslashes. If this same program is then inserted into ENOVIA Live Collaboration, it gets 4 backslashes (which provides the same code to Java as if it had 3 backslashes.) |