5 Replies Latest reply on Jan 22, 2016 7:20 PM by Charley Saint

    Run two dispathes at once

    Elaine Nelson

      Hello,

       

      I am trying to run a dispatch that creates a file and writes some variables from that files card to registry keys. When the file is created and enters a workflow I need to run another dispatch on that file to read those keys. Since the second dispatch needs the variables from the first before it can run I tried putting in a wait action in the second dispatch to delay it long enough for the first to finish. The problem I am having is that the second dispatch never runs. I am thinking it is that two dispatches can not run at the same time. Does anyone have experience doing this? Is there a work around?

        • Re: Run two dispathes at once
          Charley Saint

          Don't think that's possible, any reason it's got to be 2 different scripts?

            • Re: Run two dispathes at once
              Elaine Nelson

              Thanks for the response.

              Well, as far as I know the only way to pull a variable value from a file card into a dispatch is using "Variable value from selected file(s) datacard". Since I have two files I need the get values from I need to scripts. Correct me if I am wrong.

                • Re: Run two dispathes at once
                  Charley Saint

                  Interesting, maybe I'm not quite understanding how it's setup. Is the first dispatch a menu action that either copies a file or generates a parameter file, and the second triggered on add or check in? What happens when you just copy and paste the file into the vault, does the second script run then?

                    • Re: Run two dispathes at once
                      Elaine Nelson

                      Guess I should have given more detail to begin with.

                       

                      Basically my end goal is to rename a file with a serial number generated part number after the file has already been created with a user generated part number.The user generated part number is used for proto-typing. If the part is going to go into production the part number is changed to the serial generated number.

                       

                      I am doing the change through two workflows and three dispatches. The first dispatch is run in my WIP workflow by a manual state change on the selected file. This script pulls variable values from the file's file card of the selected file and writes them to reg keys. Then it generates a parameter file (txt file) which pulls a serial number. The path for the txt file is created from the values pulls from the file card. When checked in by the dispatch the txt files enters it own work flow and sits in the initial state.

                       

                      The user then selects the txt file and does a manual state change on it which triggers the second dispatch. This dispatch takes the new serial number and writes it to a reg key.

                       

                      Now the user selects the original file again and does a manual state change on it. This triggers the third dispatch which reads the reg key and renames the original file.

                       

                      This all works fine as long the state changes are all manual. However, I would like the state change triggering the second dispatch happen automatically. That way the user would never have to see the txt file or have to do a state change on it. I tried doing this several ways such as an automatic transition and during add.

                       

                      Unfortunately, the second dispatch never runs. I believe this is because the first dispatch has not finish yet.

                       

                      Any ideas that might make this workable?