4 Replies Latest reply on May 13, 2015 5:48 AM by Alexandre Gragnano

    EPDM - Predict the next revision name

    Alexandre Gragnano

      Hello everyone,

       

      I am new in this forum and in the SolidWorks environment. I am developer in C# and I am learning the SolidWorks & EPDM APIs.

       

      I am currently searching a way to 'predict' the next revision name of an EPDM file. I am able to find last revision names but not the future.

       

      Example: generate a revision name 'C' (if revision configuration is "A, B, C...") with a method which takes the revision number in argument (here 3).

       

      Note: I am aware this prediction can not be accurate in case of date components are present in the revision scheme. I just want to know what should be this revision name if I release now.

       

      EDIT:

       

      The method to increment virtually the revision of the file:

      - Call IncrementRevision Method (IEdmRevisionMgr)

      - Get the revision name generated <= this is what I want to do

      - Do not call Commit Method (IEdmRevisionMgr)  to ignore changes

       

      Thanks for some help.

      Best regards.

        • Re: EPDM - Predict the next revision name
          Jim Sculley

          You can't know what revision a file will have next because it depends on the path the file takes to get to the state that has a revision number associated with it. For example, if I have an Approved state with a letter revision starting at 'A', you can have multiple transitions that lead to the approved state. Each of those transitions can increment the revision, zero or more times, and possibly tweak the elements of the revision number directly.  So thre 'next' revision of a file may seem like a straightforward thing in your workflow, but for more complex workflow, there isn't one possible next revisions, there are several possible next revisions.

           

          My question to you is:  Why do you think you need to know the next revision number?  What problem are you trying to solve?

           

          Jim S.

            • Re: EPDM - Predict the next revision name
              Alexandre Gragnano

              Hi Jim,

               

              Thank you for your help. Your response is clear and helped me to understand revisions in a larger context.

              I tried to "predict" the next revision name because the company I work for release the documents when clients validate it and in a tool I am developing, I need to know this future revision name. I suppose it is not a good practice?

                • Re: EPDM - Predict the next revision name
                  Jim Sculley

                  Can you explain your workflow and what your tool is supposed to do in a little more detail?  It sounds like you are sending documents to the client to approve, and that you want these documents to have a revision number.  This is, of course, very common.  I handle this by creating an EPDM variable (named TB_REVISION) and linking it to a custom property in the document.  When the file transitions to a state such as 'Custom Approval Pending' a transition action sets the variable to the next revision (this is a build in capability in transition actions).  The file itself does not yet have the EPDM revision set on it.  That doesn't happen until the file goes to the final Approved state.  So everyone reviewing the document sees the next revision number in the document, but the file itself doesn't have that Revision number until it reaches the final state where everyone has approved it.

                   

                  Jim S.

                    • Re: EPDM - Predict the next revision name
                      Alexandre Gragnano

                      Hi Jim,

                      See below the main workflow stream of my company:

                                         +------------------+
                                         | Work in progress |
                                         +------------------+
                                                   |
                                       Submit to internal approval
                                                   |
                                                   V
                                      +---------------------------+
                                      | Pending internal approval |
                                      +---------------------------+
                                                   |
                                       Submit to external approval
                                                   |
                                                   V
                                      +---------------------------+
                                      | Pending external approval |
                                      +---------------------------+
                                                   |
                                            Approve document
                                                   |
                                                   V
                                              +----------+
                                              | Approved |  <= Increment revision ("", "A", "B", "C"...)
                                              +----------+

                      In this stream, I tried to get the future revision name of "Approved" state in the previous state "Pending internal approval".

                      Knowing now how can it works in a larger context, I understand that it is not possible to "predict" this revision name in an universal way.

                      But concerning the workflow itself, maybe a better way should be (?):

                                                   |  <= Define an initial revision letter ("A")
                                          +------------------+
                                          | Work in progress |  <= Increment revision number ("A1", "A2", "A3"...)
                                          +------------------+
                                                   |
                                       Submit to internal approval
                                                   |
                                                   V
                                      +---------------------------+
                                      | Pending internal approval |
                                      +---------------------------+
                                                   |
                                       Submit to external approval  <= Add a marker to the revision name ("A3+")
                                                   |
                                                   V
                                      +---------------------------+
                                      | Pending external approval |
                                      +---------------------------+
                                                   |
                                            Approve document
                                                   |
                                                   V
                                              +----------+
                                              | Approved |  <= Remove number and marker ("A")
                                              +----------+

                      Note: all versions become revisions in this way.