3 Replies Latest reply on Jul 7, 2011 7:34 AM by Andries Koorzen

    Tasks canceling a workflow transition

    Jeff Sweeney

      Anyone know if/how/can a task could cancel a workflow transition?

       

      I can think of at least two times that would be handy:

      1. The design checker finds a problem, forbid the file from being approved
      2. The print/convert task fails, forbid the file from being approved

       

      Pretty sure this cannot be done with the out of the box tasks, (???) so I am investigating writing my own, but not even sure if a custom task could stop a transition even if it wanted to...and in my case it does!

       

      Does a task have any hooks to a transition if it called by it?

        • Re: Tasks canceling a workflow transition
          Greg Rupp

          Does it have to be a task? I know you can with a dispatch script. you could simply create a script that says:

           

          if VAR = TRUE

          CANCEL SOLDIWORKS ENTERPRISE PDM COMMAND

           

          then in you task, set that variable when you need to cancel out.

          • Re: Tasks canceling a workflow transition
            Wayne Matus

            I am pretty sure you will have to create your own task addin. I think your task could set a flag variable to true if the task completed successfully. Then your workflow could have a holding state and an automatic transition to approved state iwith condition of the flag being true.

            • Re: Tasks canceling a workflow transition
              Andries Koorzen

              Hi Jeff

               

              I second Greg : Does it have to be a task? Or at least... do a task AND an addin

               

              With addins I know for a fact that you have absolute control over files being added / workflow transitions etc and therefore you have access to the post_add, pre_add etc flags

               

              So

               

              File moves from State A -> B through transition 1

               

              File is now in "pre-transition" state, addin fires to check for certain things...cancells transition

               

              Alternatively... just add another state (waiting for approval ). If the design checker fails, task moves the files to approved state, else to WIP state