7 Replies Latest reply on Mar 7, 2012 3:48 PM by Brian Dalton

    Set one card variable based on another... ??

    Brian Dalton

      I'd like to take the value of a two-part revision variable (A.02, B.03, etc.) and place just the Alpha part into a separate card variable, and do it automatically.

      I've looked into using an input formula, but it seems that these formulas only calculate when the user manually types values into the source variable field, not when a variable is updated by the system, for instance upon a state change.

      Next, I thought I'd look at Dispatch, but I need to read the source variable, then write a modified version of it to the destination variable, and although Dispatch has a Set Card Variable command, it apparently doesn't have a Get Card Variable command, which seems to me a glaring omission.

      Need I write an add-in for this seemingly simple task?

        • Re: Set one card variable based on another... ??
          Kishore Garakipati

          With Dispatch Option, you can try with "Variables" section where you can select "Variable Value from selected file(s) datacard" where you can get the variable value automatically. You will have to declare a dispatch variable and then try using the String function available with Dispatch to get the desired alpha part of the revision variable.

           

          Hope the information helps...!!

            • Re: Set one card variable based on another... ??
              Brian Dalton

              Thanks, Kishore.. That method of getting a file's variable is sure well hidden...

               

              I have an error, though, when I try to use it.  Setting the variable to the value of a card variable is not intuitive.  It says it wants the file with path.  I set the value to use PathToSelectedFile and NameOfSelectedFIle from the File Variables section, but it says they can't be found.  How should this be done?

                • Re: Set one card variable based on another... ??
                  Brian Dalton

                  Tried to post an image, but the forum seems to be having a bad hair day... All the interfaces are screwed up and it chokes every time I try to attach....

                    • Re: Set one card variable based on another... ??
                      Brian Dalton

                      OK, this seemed like it would work, but if I run the Dispatch action after the transition, it revs the file, then creates another version after that in order to update the variable, which is not acceptable (latest version must = latest released revision) and if I run it before the transition, it uses the previous revision letter instead of the new one.

                       

                      Once again, all the built-in tools fall just short of being useful, and it's back to add-ins...

                        • Re: Set one card variable based on another... ??
                          Kishore Garakipati

                          Here is the trick.

                           

                          For your dispatch action to work as per the mentioned requirement ( latest version must = latest released revision), you need set the revision counter at the workflow "transition" level instead in the workflow "state" level.

                           

                          I hope you know we can set revision counters in workflow "transition" and as well in workflow "state".If you are setting the revision counter in workflow "transition", it is logically meant to assign the "Revision" before the transition (similar to Pre-Event hook in API).

                           

                          Make sure the revision counter value in worflow state should not contain any value in the increment column. Not even "0".

                           

                          Once you could tweak the above revision counter setting by moving it from state to transition, you need to set the required dispatch events similar to what you mentioned in your earlier post.

                           

                          Make sure, while using revision counter at "transition" level the increment value should be set to "0" .

                           

                          Also you should include the transition action "Inc. Revision" and "Set Variable" transition action mapped with "Revision" Variable and "%nextrevision%" value.

                           

                          I can send you the picture showing the steps if required. Please let me know. It worked for me and so should be in yours..!!! :-)

                            • Re: Set one card variable based on another... ??
                              Brian Dalton

                              Thanks for the suggestion, Kishore.  I may not be understanding you correctly, but what you suggest doesn't seem to work for me.

                               

                              I have already been setting the revision at the transition level instead of the state level, so the only change I needed to make was to set the increment to '0' in the transition 'Change revision counters' dialog.  When I do that, the Dispatch action still creates a new version (because it writes to a variable and therefore must check the file out and back in) after the revision is 'stamped', but now it fails to show the next revision at all, because it has increment set to '0'.

                               

                              I'll try to attach an image of my setup...

                               

                              Nope.. attaching images is still broken...

                                • Re: Set one card variable based on another... ??
                                  Brian Dalton

                                  Here is a temporary web page with the images of my setup and the result...

                                   

                                  http://www.tantalusonline.com/epdm_temp/temppix.html

                                   

                                  The first picture shows the setup before I made any changes (major rev increments, minor rev resets).  The change I made per Kishore's suggestion was to change the increment for major rev to 0.

                                   

                                  The second picture show the result.  The first time was before the change:  The revision changed to A.01, which is correct, but the Dispatch action which copies the value of the Revision variable to the MajorRev variable created a new, unwanted verion after the revision had been 'stamped'.

                                   

                                  The second time was after I had made the change of the major revision increment to 0.  The change was stamped with the previous value (A.01) when I wanted it to be changed to B.01, but the Dispatch action still created an unwanted version after the revision increment.