6 Replies Latest reply on Jan 12, 2012 8:44 AM by Tim Read

    Is this a bug in EPDM Dispatch?

    Tim Read

      I have a Dispatch script that will only run if a datacard variable is a particular value.


      The first time I run it the correctly detects the invaild datacard variable and displays the error message I put in the script.


      The problem is that if I immediately run the Dispatch script a second time on the same file then is fails to detect the invalid datacard variable and will excute the rest of the script.


      Any ideas if this is just a bug or am I doing the 'test' in my script incorrectly?




        • Re: Is this a bug in EPDM Dispatch?
          Jared Snow

          I am having similar Dispatch inconsistencies...driving me a little nuts.  Please let this be answered!

            • Re: Is this a bug in EPDM Dispatch?
              Tim Read

              So far I have not been able to make these "IF" statements work consistently...


              I have all but abandoned this particular Dispatch script - It is in our planning to have it developed as an Add-In which will remove this issue completely.

                • Re: Is this a bug in EPDM Dispatch?
                  Jason Capriotti

                  We use the IF statement quite a bit for in dispatch and it works consistently. However, I haven't use the not equals != option yet so maybe its the problem.


                  I don't think you need the first check "!=Main". Just put if it's equal to "Main" then go to "Main Branch". If its not true, it will continue to the next line which is your "NotMainBranch" section.


                  I do something similar to what you are with files in our ECO process. If the file is transition from "Release" to "Inwork", I have it prompt for an ECO number and apply the number to the data card, set a check box that it's "In Process", and then check the file out to the user. Later in the process the file goes to a review state which if rejected goes back to "Inwork". To prevent it from prompting for the ECO number again, I use the if to check if the "In Process" box is checked to skip it.


                  I did find a bug with checking for checkbox values, sometimes it returns 1 and sometimes -1. I have to check for both cases. ECO checkout.jpg

                    • Re: Is this a bug in EPDM Dispatch?
                      Tim Read

                      I wondered if your sugesstion that the != was causing the issue so I dug into this again... with an interesting result.


                      I created a simple testing Dispatch script.

                      I run the script from the menu.

                      The first time I run it it works perfectly.

                      The second time I run it it completely skips the first "Block" (the first "OK MessageBox" does not pop up).

                      The third time I run it it working perfectly again....


                      I think I have answerd the question - This is a bug.



                • Re: Is this a bug in EPDM Dispatch?
                  Jared Snow

                  I contacted my local Solidworks support rep and he did some research for me...his response:


                  "There appears to be an SPR for this issue that is open, although the details are unclear. The SPR relates to variables not being able to be validated when the item isn’t checked out (sounds exactly like what you have going on)."


                  Try running your dispatch scripts on files that are checked out vs. checked in--I bet they'll do fine with files that are checked out.

                    • Re: Is this a bug in EPDM Dispatch?
                      Tim Read

                      It's not that :-(


                      Same behaviour on files checked in & checked out... I have already sent this off to our VAR.


                      It appears to be the script itself that is not running the first block for some unknown reason.  The first thing I do in my test script is pop-up an OK message box. On the 1st, 3rd, 5th,... time I run the script it pops up. On the 2nd, 4th, 6th,.. time I run the script it does not, it skips straight to the Edit box at the end of the script.