Jim Sculley

Serious Problem with EPDM API in SOLIDWORKS 2020

Discussion created by Jim Sculley on Feb 28, 2020
Latest reply on May 7, 2020 by Jim Sculley

I have a PDM add-in that I wrote more than 5 years ago that has been working without problems on our SW/PDM 2017 systems.  I have been testing this add-in with the 2020 version of SW/PDM and have discovered a serious problem.  I have distilled the problem down to a simple example.  I have this workflow:

 

 

The ‘TRUE’ and ‘FALSE’ automatic transitions have the following conditions:

 

 

I’ve attached a .cex file of the workflow.

 

The problem I am having is that the EdmCmdType.EdmCmd_PreState and EdmCmdType.EdmCmd_PostState are firing differently in 2020 compared to 2017.  I created a simple test add-in that hooks into these two events and prints out the source and destination states.  I’ve attached the Visual Studio project files.

 

 I create a test file in my vault and use the SEND transition to start the process.  Since the file does not have a value for the TEST_COND variable, it should end up in the AUTO PROCESS state and indeed this does happen in both the 2017 and the 2020 vaults.  However, the actual events that are fired do not match what happens to the files.

 

When I run this in my 2017 vault, the output looks like this:

===================

Pre State Event: source=START destination: EVALUATE

Pre State Event: source=EVALUATE destination: AUTO PROCESS

Post State Event: source=START destination: EVALUATE

Post State Event: source=EVALUATE destination: AUTO PROCESS

====================

 

When I run this in my 2020 vault the output looks like this:

===================

Pre State Event: source=START destination: EVALUATE

Pre State Event: source=EVALUATE destination: FINISH

Post State Event: source=START destination: EVALUATE

Post State Event: source=EVALUATE destination: FINISH

===================

The 2017 behavior is correct.  The 2020 behavior is wrong.  My real add-in is heavily dependent on the pre and post state event hooks.  It is unusable now.  

 

If anyone has a test vault handy that they can try this out in to see if they can duplicate the problem I would appreciate it.  I've already sent this to my VAR and to API support.

Outcomes