This project has moved and is read-only. For the latest updates, please go here.


Jan 4, 2010 at 5:43 PM

This relates to the CheckOutFile operation question that I posted earlier. I am needing to run a workflow when a document is checked out, but can't because WSS doesn't allow the workflow to run while a document is checked out, so I am using the StartWorkflow operation to run the workflow before the document is checked out.

Can you shed some light on how to use this operation? I am trying to run GetTemplatesForItem to get a GUID then run StartWorkflow but I am not getting anywhere.

Do you have any examples on how to use these operations?


Jan 4, 2010 at 7:09 PM

Assuming that you know the template GUID, you don't need to call GetTemplatesForItem.  I don't have any examples, but if you want to post what you have so far, we can try to work it through together.


Jan 4, 2010 at 7:59 PM

Here is what I have so far. The templateID contains null when I display it. If I knew where to get the GUID I would be fine with skipping the call to GetTemplatesForItem.

function CheckOutBook(bookURL)
	var tempID = "";	

	tempID = $().SPServices({		
		operation: "GetTemplatesForItem",
		item: bookURL


                    operation: "StartWorkflow",
                    item: bookURL,
                    templateId: tempID

		operation: "CheckOutFile",
		pageUrl: bookURL,
		checkoutToLocal: "false"

Jan 5, 2010 at 2:49 PM

Sorry, but I haven't had time to crack open a VM to take a look at this yet.  You should be able to get the Workflow TemplateId by going into the settings for the workflow in the UI and looking on the URL.


Jan 5, 2010 at 6:37 PM

I haven't looked at it again, yet, either. I was able to get the templateID. I will work on it some more this afternoon and let you know if I come up with anything.

Jan 5, 2010 at 8:56 PM

Here's what I have found so far. This code:

var tempID = "{84fa0f84-1f80-49e9-9117-7fab3e7cb35a}";
       operation: "StartWorkflow",
       item: bookURL,
       templateId: tempID,
       workflowParameters: ""

Generates this SOAPEnvelope:

<soap:Envelope xmlns:soap=''>
         <StartWorkflow xmlns='' >
               <item>http://muskit9238/Training Book Library/The Power of Innovation Thinking.jpg</item>
But I am getting an Error in response to this.
  ErrorText    The file '/_vti_bin/Workflow.asmx' does not exist.
Jan 5, 2010 at 8:59 PM
Edited Jan 5, 2010 at 9:07 PM

In that last post the ErrorText is supposed to read: ErrorText The file '/_vti_bin/Workflow.asmx' does not exist.  

Jan 5, 2010 at 9:04 PM

Aha.  I just looked back at your initial post and saw that you said "WSS".  The Workflow Web Services isn't available in WSS, only in MOSS.  If you look at this chart in the docs, I've tried to show which Web Services are available between the two.  Sorry that I didn't catch that right off.


Jan 5, 2010 at 9:11 PM

Oh no, I see that now that you pointed it out. Well, I guess it's back to the drawing board on this one. Thanks.

Jan 5, 2010 at 9:13 PM

Sorry about that, but not my doing!  If you want to outline the business requirements, maybe I'll have some ideas for you.