Dispatch again: failing sometimes?

I have a legacy dispatch that kicks in when we put our models"under revision”, it increases a variable by +1 since it is not apparently possible with a normal transition action.

I rewrote the dispatch, to handle its limitation of running every time the file state was changed, independently from the transition direction.

e.g. from “approved” to “under revision” was handled the same way as going from "waiting for approval” back to “under revision”

I worked around that limitation with a variable check, if the difference between two variables is already 1 I skip the +1 increase action, otherwise I increase the variable by 1 and add a comment in the file history to record that dispatch took action.

This is why I know it failed to run for a certain file: there is no comment in the file history about the dispatch action. The user that reported it noticed the variable in the datacard was not increased by 1 as it should, after the transition, he remembers to have changed the state from the SW PDM addin and eventually there was an error dialog, but the user is not sure and does not remember well what happened.

I tried to change the state for the same file from our test server, the dispatch kicked in correctly, and there is a comment in the file history recording the dispatch action. I do not know what to think anymore… was dispatch crashing on that PDM client? Is dispatch not robust enough to be trusted?

I tried multiple times with that single file, rolling back and doing the state change, again and again, and dispatch never failed.

I just cannot think of a way to make dispatch fail on purpose. It could fail if the file cannot be checked out, before the variable is increased, but it is unlikely the case here since the user should have the file checked in as approved state, and he has the rights to make the transition to “under revision”, check out the fuke and edit it.

Is there any chance the user changed that state of multiple files, some of which met conditions for the action and some of which did not? Because according to the KB:

“When a group of files is submitted to a dispatch action, the action will be performed on all files if the last ‘selected’ file in the submitted list meets the action criteria. If the last file in the list does not meet the criteria (e.g. a variable value needs to be set to allow the action to take place), no files will have the dispatch action even though some of the files in the submitted list do meet the criteria.”

4 Likes

very nice findings. Thank you.

Unfortunately I cannot think of a likely scenario, since the dispatch is triggered by a state change only and the user is prompted for multiple state changes and stopped for lack of rights or some other condition that is not met.

it cannot be triggered manually so it fails for “reasons”. I tried to make it fail in every conceivable way, but I cannot recreate the issue.

I think I need to dump the pdm log file from the client and take look, but probably nothing is logged for a dispatch.

I’ve only seen it fail when, in my case, the original script forgot the “For all documents” and “End for all documents” that loops through all the selected docs in the transition. Additionally, I’d double check any user defined variables that are obtained from the data card and ensure that a config name is specified, if applicable, or it’s blank for non configured files.

These are just gotchas that I’ve run into. Adding an “OK message box” to the beginning of the dispatch action will tell you if it’s run, even if a subsequent step fails.

1 Like

good advice. I have digged in the variables and configurations for a while during the debug, and placed some dialog box to check the conditions flow until it looked robust enough.

I actually run into the issues you mentioned, but I think I fixed them and I tried to reproduce this single user problem in our test vault with an old backup.

I used the same PDM user that reported the issue to perform the actions.

it worked 4 times out of 4. I rolled back the transition and run it again, from explorer and sw with a single or multiple files passing the same transition and it works as expected.

Selecting files that cannot be transitioned will stop at the transition confirmation screen.

I digged a bit more, there are quite a bit of files failing to trigger the dispatch.

I am dumping the .cog files from the PDM clients the users used to change the state and comparing the time stamp from the files history with their error logs.

there are some errors when dispatch is expected to start for the couple of clients I am analyzing atm.

the timestamp of the error is the same as the file history, by the second, unlikely a coincidence.

one of the errors is

The following database error has occurred:

State: 08S01,Native:0,Origin:[Microsoft][ODBC Driver 17 for SQL Server]

Location:

User::mbGetGroups()

Description:

Communication link failure