Rollback Puts Files in Wrong State

Discuss SolidWorks PDM
User avatar
JSculley
Posts: 643
Joined: Tue May 04, 2021 7:28 am
Answers: 55
x 9
x 876

Rollback Puts Files in Wrong State

Unread post by JSculley »

Trying to do some clean up in my vault by searching for files that are in a 'Changes Pending' state, which means that they are being revised from our 'Approved' state. Some of these files were put in this state by accident, so no revision is actually necessary, so I rollback the model and drawing. I've done this hundreds of times over the years, and for some reason, every now and then, the process fails in a strange way. The rollback process seems to succeed, but the files end up in a state one position further back in the workflow than they should be. A simplified version of the workflow looks like this (text in pipe characters are states, others are transitions):

Code: Select all

|CAD WIP|  ---> Submit ----> |Approval Pending| ---> No Approval Required ---> |Approved| ---> Changes Required -->
                                           /\
                                           |
| Changes Pending | ---> Submit Changes ---|
A file in 'Changes Pending' will have a history that looks like this:
image.png
image.png (7.21 KiB) Viewed 1600 times
I select the 'Revision: 0' line and perform the rollback. For a good rollback, things look like this:
image.png
This history shows the rollback, and the file is in the Approved state.

For a bad rollback, it looks like this:
image.png
The file ends up in the 'Approval Pending' state instead of 'Approved'. Furthermore, transitions out of 'Approval Pending' are all automatic, and the file meets the conditions of the 'No Approval Required' transition so it should end up at 'Approved' anyway, but there it sits, stuck in 'Approval Pending'. If I send it on its way from there, it goes to the 'Approved' state, but the Revision gets bumped, which is what I was trying to avoid in the first place.

Does anyone have any insight into what might cause this behavior? I've have not noticed any pattern to when it happens and when it doesn't. Today I had several files fail just minutes after several others succeeded.
User avatar
AlexB
Posts: 498
Joined: Thu Mar 18, 2021 1:38 pm
Answers: 28
x 267
x 444

Re: Rollback Puts Files in Wrong State

Unread post by AlexB »

Just a shot in the dark, but do any of your "Approval Pending" files have the same version number as the "Approved" files? I feel like it may look at the task of "roll back to revision 0" as "roll back to version 18"

I feel like I've seen this before but I'll run some tests in my sandbox vault to see if I can simulate/reproduce this.

For the record, what year and sp are you running?
User avatar
jcapriotti
Posts: 1858
Joined: Wed Mar 10, 2021 6:39 pm
Answers: 29
Location: The south
x 1201
x 1989

Re: Rollback Puts Files in Wrong State

Unread post by jcapriotti »

It seems random but sometimes the transition "Approved" to "Release" in our workflow happens after the Revision label is applied, and sometimes before. So if you select the Revision label and do a rollback, it rolls back the transition as well if the transition occurred after. In that case I select the transition to do the roll back.

Not sure if this is still happening or an old bug.
Jason
User avatar
bnemec
Posts: 1943
Joined: Tue Mar 09, 2021 9:22 am
Answers: 10
Location: Wisconsin USA
x 2542
x 1398

Re: Rollback Puts Files in Wrong State

Unread post by bnemec »

Along with Jason and Alex. I think the key here might be the statement that all the transitions out of 'Approval Pending' are automatic. I'm not 100% but it seems files will not take any automatic transition until something "kicks" them. For example, files already in a state when a new automatic transition is created; even if the files match the conditions of the new automatic transition, they're still going to sit in their current state until something triggers PDM service (on the client) to evaluate the possible automatic transitions.

So why the pseudo-random behavior? As Jason pointed out there's sometimes check in during the transition, AFAIK it's just for transition actions that change data card variable. I >think< the behind the scenes of the roll-back is it needs a record in one of the history tables to roll back to. If there's no history of the file being in the Approved state then you see it in the Approval Pending state after rollback.
User avatar
JSculley
Posts: 643
Joined: Tue May 04, 2021 7:28 am
Answers: 55
x 9
x 876

Re: Rollback Puts Files in Wrong State

Unread post by JSculley »

AlexB wrote: Tue Jan 24, 2023 12:16 pm Just a shot in the dark, but do any of your "Approval Pending" files have the same version number as the "Approved" files? I feel like it may look at the task of "roll back to revision 0" as "roll back to version 18"

I feel like I've seen this before but I'll run some tests in my sandbox vault to see if I can simulate/reproduce this.

For the record, what year and sp are you running?
Since the problem doesn't present itself until after the rollback, the version info is gone. All our files arrive in the 'Approved' state via the exact same process, so I wouldn't expect the problem to show the kind of randomness it does.

This is SW2017 SP5 with PDM 2019 SP5. A goofy mix, that hopefully I'll be able to upgrade to 2022 or better in the near future.
User avatar
jcapriotti
Posts: 1858
Joined: Wed Mar 10, 2021 6:39 pm
Answers: 29
Location: The south
x 1201
x 1989

Re: Rollback Puts Files in Wrong State

Unread post by jcapriotti »

Another option maybe. We don't use rollback much anymore. When users transition a file to WIP and decide they need it rolled back to Release, we have a workflow transition from WIP to Release that sets the revision to increment by 0. They are required to checkout the file and overwrite it with a copy of the previous released version before sending it down this workflow. The 0 increment creates a second revision label the same as the released version. Too bad I can't tell it to move to a new version instead.
Jason
User avatar
JSculley
Posts: 643
Joined: Tue May 04, 2021 7:28 am
Answers: 55
x 9
x 876

Re: Rollback Puts Files in Wrong State

Unread post by JSculley »

jcapriotti wrote: Tue Jan 24, 2023 12:42 pm It seems random but sometimes the transition "Approved" to "Release" in our workflow happens after the Revision label is applied, and sometimes before. So if you select the Revision label and do a rollback, it rolls back the transition as well if the transition occurred after. In that case I select the transition to do the roll back.

Not sure if this is still happening or an old bug.
Nothing more frightening than a piece of software that gives two different outputs for identical inputs. I'll have to remember to check the next time before I do a rollback to see if the history is scrambled. I may have posted about this one time in the old forum and you may have replied with this same information. It seems familiar.
User avatar
jcapriotti
Posts: 1858
Joined: Wed Mar 10, 2021 6:39 pm
Answers: 29
Location: The south
x 1201
x 1989

Re: Rollback Puts Files in Wrong State

Unread post by jcapriotti »

JSculley wrote: Wed Jan 25, 2023 9:14 am Nothing more frightening than a piece of software that gives two different outputs for identical inputs. I'll have to remember to check the next time before I do a rollback to see if the history is scrambled. I may have posted about this one time in the old forum and you may have replied with this same information. It seems familiar.
I think it's related to how this History view sorts which is by date. Since the Revision label and transition are occurring at the same time, maybe there is a micro-second difference. Not sure.
Jason
Post Reply