Running the CATPDMExtractEV4Batch Batch Process

The extraction of data from the VPDM can be automated by running the CATPDMExtractEV4Batch batch process. This batch is driven via a command line giving as input the root of the assembly on which the extraction will be done.

Note: It is not possible to extract alternate shape documents irrespective of the document type or extension such as cgr, CATShape in VPM V4 batch, as these documents are not reported by the interop service available in CATPDMExtractEV4Batch.
  1. To retrieve the help information:

    CATPDMExtractEV4Batch -help

  2. To run the extraction:

    CATPDMExtractEV4Batch [-part Env.PART_LIST.PartListName[.Version]]
    [-adddoc Env.DocTable.DocName.DocType[.Revision]]
    [-separator string] [-namingRules XMLNamingRulesPath] [-noDraftingUpdate]
    -out ouputpath [-delete] [-epexml outputXmlFile] [-report xmlReportFile]
    [-connect xxx] [-role xxx] [-user xxx] [-pwd xxx] [-spwd xxx]


Arguments

Connection Information

-connect xxx : Server name.
-role xxx : Role used for ENOVIAVPM connection.
-user xxx : User for ENOVIAVPM connection.
-pwd xxx : User password for ENOVIAVPM connection.
-spwd xxx : Secure password for ENOVIAVPM connection.

General Information

-help Help
-part : Environment and PartList name of the root of the assembly to extract. Note that if you are extracting a single part, -adddoc should be used to specify the document directly. If you use -part, nothing will be extracted because the documents attached directly to the root part are not extracted.
-adddoc : Environment, document table, document name and document type to load if not attached in an assembly. Can be used also to extract standalone documents. Several adddoc statements are possible.
-separator string: used to specify a string to be used as a delimiter for the -part and -adddoc keywords (instead of the default delimiter, ".").
-out outpath : Path of the folder in which the session will be saved.
-delete : Force deletion for files already existing in output folder before extraction.
-epexml : To generate an XML template file that can be used by reconciliation batch.
-report : To generate an XML report listing extracted documents.
-namingRules: Define the XML file in which renaming rules are defined. Those rules use predicates on VPMD attributes of the Part or the document. Rules priority is mapped on rules order inside the XML files(Only the first rule encountered with predicate set to true will be used)
-noDraftingUpdate: Enables to inhibit the update of CATDrawing before save. It is highly recommended not to use this option in case of assembly drawing on top of storage mode set to structure exposed.

Note that:

  1. The -part and -adddoc options are optional.

  2. More than one ENOVIAVPM document can be added to the session: each document can be added by an -adddoc statement.

  3. Documents are extracted to path given by -out argument. If documents already exist with the same name the extraction will fail.

  4. When using the -part option, in order to specify the version of the PartList to be extracted, the attribute PART_LIST.C_PART_VERSION must be defined in the ENOVIA VPM V4's RESULT mask. If the correct version is not being extracted, please see your System Administrator to verify this attribute is defined.

Declaration of naming rule convention for Extract:

Declaration is done in an XML file that contains a list of Naming Extract Rules. Each rule is made of one condition and one naming operator. If the condition is verified, the naming operator will be used to generate the file name used when saving the file to disk.

Condition is made of a series of Predicates and each predicate is defined by an attribute id, a comparison operator and a value. The attribute can be selected from VPDM attributes or internal attributes of the document, or from the root product of this document for a CATPart or a CATProduct. Internal attributes are standard attributes such as document type, Part or document name or it could be specific to the VPDM system; for instance for ENOVIAVPM, we can access an environment or a table. The attribute of a Root Product of CATPart or CATProduct, has an attribute id that starts with the string “Part.”.

Naming Operator is a series of string elements that will be concatenated to define the name of the file. You do not have to add the file extension it will be automatically done by the program.

<NamingRule>
<ExtractRule id="CATProduct_name">
<Condition>
<Predicate type=internal id=Type operator=“=” value=CATProduct”/>
<Predicate type=internal id=StorageMode operator="=" value=STRUCTURE_EXPOSED”/>
</Condition>
<NamingOperator>
<Element type=internal id=VPM.Environment" length=8 padding=“ ”/>
<Element type=VPDM” id=Part. Part Number” />
<Element type=string id=“_" />
<Element type=VPDM” id=Part. Part Version” />
</NamingOperator>
</ExtractRule>
<ExtractRule Name=R2”>

</ExtractRule>
<NamingRule>

Example of XML naming rule file

For ENOVIA VPM V4:NamingRuleForVPM.xml

For ENOVIA V5 VPM: NamingRuleForEV5.xml

List of xml node and attribute of XML naming file

XML Node

Attribute

Description

NamingRule

Root of the XML document

ExtractRule

Define a new Naming rule for EPE extraction utilities. <ExtractRule Name=“R1”>

Id

Rule identifier.

Condition

Define the condition to activate an extraction rule.

Predicate

Define a predicate for a condition.

type

Define the type of attribute to test. Value could be: internal or VPDM.

id

Identifier of the attribute to be tested. If Id is prefixed by Part. The string attribute will be found on the child Part (root product).

operator

Test operator, it could be: = or LIKE.

value

Value to be used for predicate evaluation.

NamingOperator

Element

One element to be used to build a name by concatenation.

type

Defines the type of attribute to test. Value could be:

String Id is the string value to be inserted in the name.

internal Id is the name of an internal attribute to be used.

VPDM Id is the name of a VPDM attribute to be used.

id

Identifier of the attribute to be used. If Id is prefixed by Part. String attribute will be found on child Part (root product).

length

Number of characters to be inserted.

If the string is too small, we will pad with padding characters, if defined. Otherwise length is only considered as a maximal length of the string to be concatenated.

If the string is too large only the length first characters will be used.

padding

Optional: Enables the use of a character string as padding if attribute length is smaller than the value defined in length.

List of internal attributes

Attribute

Description

General internal attributes

Name

Current identifier of the document or the part.

Type

File extension for document or Part.

StorageMode

PUBLICATION_EXPOSED or STRUCTURE_EXPOSED.

Environment

ENOVIA5 or VPM1. Indicates the environment:

ENOVIA V5 VPM or ENOVIAVPM.

Internal attributes for ENOVIAVPM

VPM.Environment

ENOVIAVPM environment.

VPM.Table

ENOVIAVPM table.

Internal attributes for ENOVIA VPM V5:

EV5.Type

Could be PRC, PV or DR.

PRC stands for Product Root Class

PV stands for Part Version
DR stands for Document Revision

Examples

When running batches, you must always use the command catstart, of which the following is an example (for more details, see the Infrastructure Guide, Basic Tasks, Starting a Session on Windows):

catstart -run "CATPDMExtractEV4Batch -adddoc RECV5_EXTRACT1_PART1.CATPart -out c:\temp\ "

  1. Extraction of a single Part:

    CATPDMExtractEV4Batch -adddoc VPMENV1.DOCUMENT.RecVpmV4TestPart1.CATPart -out c:\temp\

  2. Extraction of two CATParts and CATDrawing based these CATParts:

    CATPDMExtractEV4Batch -adddoc VPMENV1.DOCUMENT.RecVpmV4TestPart1.CATPart -adddoc VPMENV1.DOCUMENT.RecVpmV4TestPart2.CATPart -adddoc VPMENV1.DOCUMENT.RecVpmV4TestDrw.CATDrawing -out c:\temp\

  3. Extraction of an assembly:

    CATPDMExtractEV4Batch -part VPMENV1.PART_LIST.RecVpmV4Root -out c:\temp\

  4. Extraction of an assembly drawing with its assembly:

    CATPDMExtractEV4Batch -part VPMENV1.PART_LIST.RecVpmV4Root -adddoc VPMENV1.DOCUMENT.RecVpmV4TestDrw.CATDrawing -out c:\temp\
    -connect SAMPLE -role VPMADMIN.ADMIN.DEFAULT -user xxx -spwd xxx

  5. BlackBox assembly (CATProduct):

    CATPDMExtractEV4Batch -adddoc VPMENV1.DOCUMENT.RecVpmV4BlackBox.CATProduct -out c:\temp\

  6. Managing the file name after Extraction can be done by using:

    CATPDMExtractEV4Batch -part VPMENV.PART_LIST.GEAR.CATProduct -out /u/users/xxx/GEAR/extract1 -delete -namingRules "/u/users/xxx/namingrules.xml" -connect SAMPLE -role VPMADMIN.ADMIN.DEFAULT -user xxx -pwd xxx

  7. Suppressing the updation of CATDrawing before save, while extracting can be done by using:
    CATPDMExtractEV4Batch -adddoc VPMENV.DOCUMENT.DocTeDr.CATDrawing -out /u/users/xhq/J15/Extract1 -noDraftingUpdate -connect SAMPLE

Limitations

  1. Configured data is not supported.

  2. Impact graph:

    The session to extract is not completed with "impacted by" or "impacted on" documents.

  3. Getting traces:

    The batch is based on CATIA V5 ApplicationFrame infrastructure, therefore a CATIA V5 window may appear when running the batch.
    The batch therefore needs a running window manager.
    The batch runs as a background task and its traces are not displayed in the window from which it was started. Traces can be retrieved using CNEXTOUTPUT environment variable.

  4. -spwd option:

    • This information cannot be hidden if running processes are listed using ps -ef | grep pwd command.

    • –spwd and –pwd options are incompatible options.

Diagnostics

Possible exit status values are:

  • 0: Successful completion.
  • 4: Failure due to one or more of the standalone documents (-adddoc documents).
  • 8: Failure due to any of the following:
  • Query failed
  • Load of PDM data failed
  • Save of loaded data failed
  • 202: Connection failed.