Use Dispatch to manage on-the-fly workflows

Last week Lou Gallo and I recorded a pod cast discussing SOLIDWORKS Enterprise PDM’s dispatch “script” language. I can’t add much more to the “cool-ness” of dispatch than Lou and I mentioned in the pod cast, but since the recording I have thought of another nice dispatch application I have seen…

SOLIDWORKS has a nice knowledge base article (S-014655) on how you can use a parallel workflow in instances where you need more than one person [group] to be able to approve a document at once.

parallel

This image is a simple example as discussed in S-014655, the concept is -as users push the document through their “voting” transitions, their vote is recorded on the data card. Then via conditions of the transitions, the file either stays and waits for others to vote, or once the file gets all the votes it needs, it then can continue through the life cycle.

The limitation of this example is that all files in this workflow must be approved by all three voters. What if you want the ability to allow your users to determine who needs to vote?

Assuming you have something similar to SolidWorks’ example above, you have some controls that are used to track how the voting is going. Likely you have these “voting” controls read only to keep people from voting for others.

votes

To make this work, you need to add additional controls to give your users the ability to determine who needs to vote. Something like this:

requiredvotes

Here, our user has determined that only “B” and “C” need to vote for this file, so I can ask dispatch to vote for “A” by proxy. (If we don’t get a vote for “A” somehow, the file will not be able to pass through the workflow as designed.)

Next, install dispatch and create a new script.

The concept of the script is pretty close to Lou’s EPDM Dispatch Jumpin’ blog entry. Get the data card variable values and assign them to variable names inside of your dispatch routine.
SetVars

Set the dispatch to run as the file goes through a chosen transistion:

activation

The dispatch script would look like this: (Don’t worry about some of the weird syntax in the “Content” column, the dispatch wizard will build this for you.)

Dispatch

First line tells dispatch to check out the file. (Even the mighty dispatch cannot modify a card without it being checked out.)

The second line says that if person “A” needs to vote (the variable “varAVote” would equal 1 because a checked checkbox is equal to one) jump to the fourth line because I don’t want my dispatch routine to proxy for “A”. However if “A” does not need to vote, the value of varAVote would equal 0 and thus dispatch will simply continue to the third line of the macro.

The third line sets the datacard variable “Vote from A” to 1 – essentially checking the vote check box.

setvarincard

This works even if the control [checkbox] is read-only!

This logic continues for every person that needs to vote, then when we get to the end the file gets checked back in. Don’t worry if everyone is voting and dispatch didn’t change anything. If nothing was changed, the file is “undo check out”ed.

Thus my new file looks like this afterwards:

afterdispatch

I hope I didn’t scare you off, it really is quite easy. As I mentioned, you can think of the dispatch editor as a big wizard, it leads you through the process, it is easier than I made it look.

  • Share this
Find Your Design Solution in the CATI Store.
Browse Products