Pre-Processing Function
The pre-process function is a JPO public function called with a context and a packed string array. The function must return a Map. For example:
public Map importRevisionsPreProcess (Context context, String[] args)
The arguments array is the paramMap
used by the Import Module Versions command and contains these values:
Parameter | Description |
---|
objectId | The context object id |
choice | The choice string for which versions to import:- allTagged
- branch
- branchTagged
- versions
- all
|
version | The value from the Branch / Versions field of the Import DesignSync Revisions dialog box. |
FixDSFA | The true or false value from the Update DesignSync connection for selected existing revisions field of the Import DesignSync Revisions dialog box. |
fixTags | The true or false value from the Update tags for selected existing revisions field of the Import DesignSync Revisions dialog box. |
sync | The true or false value from the Synchronize derivation information at end of import field of the Import DesignSync Revisions dialog box. |
The returned Map can include the Action key that can have one of these values:
Value | Description |
---|
CONTINUE | (case sensitive) Processing continues. If any other value for the Action key is received, the import process is aborted. |
Error | The error string is reported to the user as the reason for failure. If an error string is not provided, the process returns a generic error message indicating that the pre-process function failed. |
If the function throws an error, the import process is aborted with a generic message that the pre-process function failed and includes the text of the returned error.
Post-Processing Function
The pos-process function is a JPO public function called with a context and a packed string array. The function must return a Map. For example:
public Map importRevisionsPostProcess (Context context, String[] args)
The arguments array is the paramMap
passed to the pre-process function, extended with these values:
Parameter | Description |
---|
versionIds | A HashMap of the imported objects. Each entry is a version numeric from DesignSync, and a string true/false value (true means the revision was created in the Import process, false means that the revision already existed), followed by | and the objectId of the Product revision. |
importData | The XML string returned from the DesignSync server. Use the JAXB system to parse this structure. See Apps/SemiTeamCollab/V6R2017x/Modules/ENOSemiTeamCollabBase/AppExternal/XSD/importModuleVersions.xsd for the structure of the XML returned and for sample code to parse that data. |
The returned Map can include the Action key that can have one of these values:
Value | Description |
---|
CONTINUE | (case sensitive) Processing continues. If any other value for the Action key is received, the import process is aborted. |
Error | The error string is reported to the user as the reason for failure. If an error string is not provided, the process returns a generic error message indicating that the post-process function failed. |
If the function throws an error, the import process is aborted with a generic message that the pre-process function failed and includes the text of the returned error.
The import process uses a single transaction. If any error occurs, including from the post-process function, then no data is created. If the user selected the Synchronize derivation information at end of import check box, that is performed in a separate transaction.