I have a scenario where I need to cancel an outstanding workflow flexitask. Since it doesn't have an action ID, I can't use the Complete Workflow Task action. From some things I read on the old site, it looked like I needed to use the ProcessFlexiTaskResponse web service. So I have a workflow that get's the ID for the task I need to cancel, then calls the ProcessFlexiTaskResponse web service. Everything complete successfully, however the task is not updated or changed in anyway. I'm assuming the web service will complete the task using the criteria I've input, but maybe that's not what it does. Anyone have any experience using this web service?
Solved! Go to Solution.
It looks like you are using SP 2010. I found in the Nintex Workflow 2010 SDK that ProcessFlexiTaskResponse was: OBSOLETE. Use ProcessFlexiTaskResponse2 instead. And that the ProcessFlexiTaskResponse2 method is to: Registers a response to a workflow Flexi task.
So I would just switch to using the ProcessFlexiTaskResponse2 and see what that does.
More from the SDK:
Success: The response was submitted correctly. CannotObtainLock: The task is locked by another operation so the response could not be submitted. For this result, it is good to inform the user to retry in a moment. InvalidUser: The user responding to the task is invalid.
Also found a link to a blog on an example use case of ProcessFlexiTaskResponse2 Clubbing InfoPath Form & Nintex Approval Form | My Learnings
I have created one form almost like Clubbing InfoPath Form & Nintex Approval Form | My Learnings . But unfortunately its returning "Invalid User". Do you have any solution for this. My code is given below. Infopath webform,
code written in submit button.
Dim root As XPathNavigator = MainDataSource.CreateNavigator()
Dim CurrentTaskID As String = root.SelectSingleNode("/my:myFields/my:Current_Task_ID", NamespaceManager).Value
Dim TaskListGUID As String = root.SelectSingleNode("/my:myFields/my:TaskListGuid", NamespaceManager).Value
Dim wsc As WebServiceConnection = DirectCast(Me.DataConnections("ProcessFlexiTaskResponse2"), WebServiceConnection)
' Create XmlDocuments.
Dim inputDocument As XmlDocument = New XmlDocument()
Dim outputDocument As XmlDocument = New XmlDocument()
Dim errorsDocument As XmlDocument = New XmlDocument()
' Load input document.
inputDocument.LoadXml("<ProcessFlexiTaskResponse2 xmlns='http://nintex.com'><comments>Updated From Code Behind</comments><outcome>Approve</outcome><spTaskId>" & CurrentTaskID & "</spTaskId><taskListName>Tasks</taskListName></ProcessFlexiTaskResponse2>")
' Create XPathNavigator objects for documents.
Dim inputNav As XPathNavigator = inputDocument.CreateNavigator()
Dim outputNav As XPathNavigator = outputDocument.CreateNavigator()
Dim errorsNav As XPathNavigator = errorsDocument.CreateNavigator()
wsc.Execute(inputNav, outputNav, errorsNav)
strTemp = outputNav.ToString & "---:" & User.UserName
outputNav.ToString returns "Invalid User" . Please come up with a solution for thiese.
That's good to know. So I switched it to ProcessFlexiTaskResponse2 and ran it, but again nothing seems to happen. I have workflow A which has created a Flexi Task that is waiting for a response. I want to run workflow B that will cancel the outstanding Flexi Task. When I run workflow B, it completes successfully, but the outstanding task hasn't changed, and workflow A is still waiting for a response. Maybe I'm approaching this wrong.
I'd imagine that you would receive that response when the user making the call is not the user that is assigned to the task. Could this be true in either of your cases?
I changed the credentials in the web service call to use my own, and I got back a success message. So if that’s the case that complicates things as the tasks I’ll want to cancel will be assigned to all sort of people. So do I need to first reassign it to whatever ID is going to run the web service?