14 Replies Latest reply on Mar 28, 2017 9:09 AM by Bryan Nathan

    Check Out during transition

    Bryan Nathan

      I would like to implement a process to check out a file upon certain workflow transitions. Specifically, when we trigger a revision I would like the part to be automatically checked out to the person who initiated the transition. This seems like a basic function yet I cannot figure out how to do it. Anyone doing something similar?

        • Re: Check Out during transition
          S. Casale

          I see what you are doing there, but I wouldn't do it. I know it's not necessarily polite to be as forward. I apologize if it comes across wrong.

           

          I intend my users be fully cognizant when they check out/in files with the manual selection function. Too much room for checking out/in files that weren't intended while the software may provide a list of hundreds of items.

           

          I allow my users two states to checkout files, WIP and Modification WIP which is a revision. My users don't usually change states as they don't like to, so I move everything to release (part of my workflow as final check).

            • Re: Check Out during transition
              Bryan Nathan

              There are only 3 of us who trigger Released -> Under Editing (for a revision). When we do this we always then check out the drawing so we can enter the ECN number (and make it easier to find). We don't suffer from 100's of files being in checked out state for unknown reasons and this would be an added convenience. I think it is safe to do (I can always remove it if we suffer unexpected repercussions).

                • Re: Check Out during transition
                  Amos Avery

                  In addition to my comments below about using Dispatch for check-out, you might also consider just using Dispatch to enter the ECN Number if that's your only reason for check-out.  We have an action that prompts the user for the ECN Number, then checks out all of the files, applies the ECN number and checks them back in.  You could even leave them checked out so the ECN Number task is automated but you can still open them up and do other things.

                    • Re: Check Out during transition
                      Tom Helsley

                      I do a similar thing, but for a different purpose.  Because the variable is not version-free, I have to:

                      1. Check out the file
                      2. Write to the data card variable
                      3. Check in the file.

                      However, for some strange reason, the script fails on one file or another.  It's totally random WRT files, but totally consistent for the files that have problems.  First, I get a message that says "Error Checking in file  The file could not be found."  Then I get another message that says, "Ignoring the checked out file '123456.sldprt'."  The variable on the data card is updated just fine, but for some reason it cannot check in the file and complete the transition.

                       

                      I wonder if anyone else has had this problem.

                • Re: Check Out during transition
                  Amos Avery

                  Dispatch is a good tool for this.  By using the For all documents block, you can check out all files selected for the Transition.

                  By setting the transition conditions to the State in question, it will fire automatically whenever that State is entered.

                  One disadvantage with Dispatch is that you will need a new Action for every State you plan to transition into.

                    • Re: Check Out during transition
                      Tom Helsley

                      Amos Avery wrote:

                      ... One disadvantage with Dispatch is that you will need a new Action for every State you plan to transition into.

                      Not necessarily, Amos.  You can use the Jump command to test for the current state.  If it is equal to the desired state, then continue with the check out.  If it isn't, then go to the end of the block and bypass the check out.

                        • Re: Check Out during transition
                          Bryan Nathan

                          Thank you Avery because that is exactly what I wanted to do. But I had the reservation which Tom has addressed. I think this combination would work, I'll give it a try.

                          • Re: Check Out during transition
                            Amos Avery

                            Hi Tom.  I understand using the Jump command and testing for the state, but I'm curious how you configure the State Transition Conditions so that you would need the test.  My understanding is that you can only choose one state.  I can see how this logic would be helpful if you were using a Right-Click option for files that could be in multiple states but this is not automatic.  Can you elaborate?  In the past I have had to make duplicate Actions for each state I wanted the automatic task to operate on.  If the file should be checked out automatically in states 2, 5 and 9 but not in 1, 3, 4, 6, 7 & 8, then I would need 3 Actions with identical steps but each one configured for the 3 states in question respectively.  How would you configure it to run all the time automatically so that the test you describe would be needed?

                              • Re: Check Out during transition
                                Tom Helsley

                                Oh, good question.  I have a couple different cases where I check for the current workflow state:

                                • In one case, I have two different workflows with the same state name and the script runs after the state change. 
                                • In another case, I have multiple transitions going to the same state, but the script runs before the state change.

                                The exact details in my cases are kind of hard to explain, and it requires some trial and error to see what works and what doesn't.  If the state names are not the same and the conditions don't fit into what I described above, then you might have to use two different actions. 

                                  • Re: Check Out during transition
                                    Bryan Nathan

                                    My initial trial of this ran into some difficulties. My goal is to implement the check out during "Project Major Revision". However, I do not want it to check out during the Reject transitions. If the dispatch script runs after the state change then the state is "Under Editing" and my Jump routine won't work. If the dispatch script runs before the state change then it cannot check out the file because users don't have permission to checkout the file while it is in the other states. Furthermore I think if I were to check out the file before the state change it may interfere with some other variable assignments I have in the transition.

                                     

                                    Workflow.jpg

                                     

                                    My new plan is to have our programmer (who implemented auto PDF generation, STEP file generation, etc.) write a small routine to check out the file. I can then call the routine as an ACTION within the transition.

                                      • Re: Check Out during transition
                                        Tom Helsley

                                        Activating the script after the state change sounds correct.  I'm not sure why you need the jump.  I usually use the jump with current state when the action activates before a state change.

                                          • Re: Check Out during transition
                                            Bryan Nathan

                                            I need the jump routine because I don't want to check out the file when using the two Reject Routines (see workflow image above). I only want it to run for the Project Major Revision. The dispatch only has an option to attach it to a State (in my can Under Editing). How can I filter our the two Reject Options.

                                             

                                            By the way, I am still using a 2015 version of Dispatch (it didn't update when we went to 2017 and I haven't investigated).

                                              • Re: Check Out during transition
                                                Tom Helsley

                                                Oh, right.  That makes sense.  You might have to get creative on this.  I can see a couple different possibilities.

                                                 

                                                First option:

                                                • Add a hidden variable to the data card (e.g. "Rejected", "TempVar", or "New Rev", etc.).  Let's assume the first name "Rejected" for this example.
                                                • Add an action to each transition that writes a different value to that variable, (e.g. "1" or "True" for the "Reject" transtiions, and "0" or "False" for the "Project Major Revision" transition.
                                                • In your dispatch script, get that variable, and use it in a Jump command to determine if the file should be checked out, have a data card value modified, etc..

                                                 

                                                Second option:

                                                • Add an intermediate state that the script runs at.
                                                • Use an automatic transition after that state to take the file back to the "Under Editing" state.

                                                 

                                                I like the first option the most.  The second option may have a problem with the automatic transition happening before the script runs.  You'll have to try both to see what you like the most.

                                                EDIT:  I also prefer using a general variable name like "TempVar" or "WF Routing" because I can use it for other workflow transitions as well.