To approve or reject a SharePoint Workflow from a Nintex Workflow is very easy. There is a web service exposed from SharePoint which is Workflow.asmx, you can access it at
http:// server /_vti_bin/workflow.asmx
Now the method that we will be using to action our SharePoint workflow is AlterToDo. This method takes the following arguments:
- Item (The URL location of an item on which a workflow is being run)
- todoId (Unique identifier of the assigned task)
- todoListId (Globally unique identifier (GUID) of the assigned task list containing the task)
- taskData (Task data for conversion into a hash table)
Okay so back to Nintex now.
Step 1: Add a call web service workflow action and configure it.
Step 3: Add URL of workflow.asmx web service in the URL field, specify username and password and click refresh to update list of available methods in the Web Service
Step 3: Select SOAP Editor in editor mode, this is necessary as you will be adding some xml in TaskData parameter and select SOAP builder mode seems to html encode < > signs which results in error
Step 4: Specify item, todoId, todoListId and paste the following xml in tag.
<my:myFields xmlns:my=”http://schemas.microsoft.com/office/infopath/2003/myXSD” >
<my:TaskStatus>Approved</my:TaskStatus>
<my:Status>Completed</my:Status>
<my:PercentComplete>1.00000000000000</my:PercentComplete>
<my:Completed>1</my:Completed>
</my:myFields>
Your configuration should look something like this

Try some fixed values first for testing purposes and click run and then replace them.
I hope you find this post useful. Thanks for reading.





August 15th, 2012 at 3:29 am
hiee Khurram,
I have an issue with Nintex, My workflows are hanging in the system. If the Workflow task is left for two days or more in Not Started state and then approved, it goes in “In Progress” for ever. Can you help me in this. What could be the reasons of this ?
August 15th, 2012 at 9:40 am
Hi Hammad,
Thank you for commenting on my blog, Sure, I’ll will try my best to help you out. I saw the beautiful exception message you’ve posted on Nintex Connect :p. The following excerpt from your exception message seems interesting
*Access Denied for /contoso/_layouts/IniWrkflIP.aspx?List={b713a4ad-747e-4980-ad1c-c420d3f588b7}&ID=1&TemplateID={3cf9d212-c83d-4486-9fce-ee8d00efacbc}&Source=blah
*Check out this blog, it seems this guy had the same issue. I hope this will help you out. Keep me posted.
October 26th, 2012 at 9:29 pm
Khurram,
Similar to the one above, can we reassign a task using web services?
October 29th, 2012 at 2:20 pm
Thanks for reading SV. If you have a task list associated with a workflow and want to update task associated with an instance then try this solution (http://go4answers.webhost4life.com/Example/reassgin-task-request-change-altertodo-48607.aspx), you will have to specify tag.
If have you don’t have any workflow associated with a task list then you can try list.asmx webservice to update list items, check this out for more details (http://msdn.microsoft.com/en-us/library/lists.lists.updatelistitems(v=office.12).aspx)
October 29th, 2012 at 8:30 pm
Thanks for the response Khurram.
I tried the solution you have described above, but it did not make any change. http://go4answers.webhost4life.com/Example/reassgin-task-request-change-altertodo-48607.aspx
There were no errors too.
Here is what I did.
String SiteUrl = SPContext.Current.Web.Url + “/”;
WorkflowService.Workflow ws = new WorkflowService.Workflow();
ws.Url = SiteUrl + “/_vti_bin/workflow.asmx”;
ws.Credentials = CredentialCache.DefaultCredentials;
StringBuilder xmlBuilder = new StringBuilder();
//xmlBuilder.Append(“”);
xmlBuilder.AppendFormat(“”, “http://schemas.microsoft.com/office/infopath/2003/myXSD”);
xmlBuilder.Append(“”);
xmlBuilder.Append(“”);
xmlBuilder.Append(“”);
xmlBuilder.Append(“”);
xmlBuilder.AppendFormat(“{0}”, user.Name);
xmlBuilder.AppendFormat(“{0}”, user.LoginName);
xmlBuilder.AppendFormat(“{0}”, “User”);
xmlBuilder.Append(“”);
xmlBuilder.Append(“”);
xmlBuilder.AppendFormat(“{0}”, Description);
xmlBuilder.AppendFormat(“2012-11-21 11:21:00″);
xmlBuilder.Append(“”);
xmlBuilder.Append(“”);
xmlBuilder.Append(“”);
xmlBuilder.AppendFormat(“{0}”, Status);
xmlBuilder.Append(“”);
//xmlBuilder.Append(“”);
XmlDocument doc = new XmlDocument();
doc.LoadXml(xmlBuilder.ToString());
//XmlNode todosForItem = ws.GetTemplatesForItem(itemUrl);
SPList tasksList = SPContext.Current.Web.Lists[GetConfigValueByKey("AccessITTasks")];
XmlNode node = ws.AlterToDo(SiteUrl + itemUrl, taskItem.ID, new Guid(tasksList.ID.ToString()), doc.DocumentElement);
October 31st, 2012 at 8:35 pm
SV, is your task list associated with any workflow? and are you planning to action this workflow via the web service or do you just have a task list and update the assigned to field via web service?
October 31st, 2012 at 8:41 pm
I have a task list associated with a workflow which is assocaited to a content type. Yes, I will to reassign a task using web service.
October 29th, 2012 at 8:51 pm
Also, in this case what is ?
October 29th, 2012 at 8:51 pm
wor:taskData