What is the ProcessFlexiTaskResponse web service suppossed to do?

  • 30 September 2014
  • 12 replies
  • 9 views

Userlevel 3
Badge +9

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? 

 

ProcessFlexiTaskResponse.png 


12 replies

Userlevel 7
Badge +17

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:

 

Parameters

comments Type: System..::..String
Any comments to record against the task response.outcome Type: System..::..String
The response for the task. Use GetOutcomesForFlexiTask to discover the allowed responses.spTaskId Type: System..::..Int32
The list item id of the task.taskListName Type: System..::..String
The name of the task list that contains the task.

 

Return Value

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.

Userlevel 7
Badge +17

Also found a link to a blog on an example use case of ProcessFlexiTaskResponse2  Clubbing InfoPath Form & Nintex Approval Form | My Learnings

Userlevel 3
Badge +9

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.

Userlevel 7
Badge +17

Do you store the Return Value of the call? What was the outcome?

Userlevel 3
Badge +9

I'm getting "Invalid User" for the results. Looks like same issue as Ziad Alhasawi‌. 

Userlevel 7
Badge +17

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?

Userlevel 3
Badge +9

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?

Userlevel 7
Badge +17

From what I gather, the function has a line of code that does this comparison before attempting to complete the task. It's a sound security measure, but with no way to override. One solution is to write your own function without that step, but that's probably way too far out there. I don't think you can impersonate that user without creating a constant of the user or knowing the password of the user. I also assume that running the web service as a site collection admin would not get around this condition. That may be the only other test you could run.

It would be interesting that there is a way to reassign the task, then complete it, and not have a way to directly complete it as an admin. Could be something to add to suggested changes. But then again, it seems more of an official way of completing an action by first reassigning the task. I think in the form, when you are an admin you have to click the link to take over the task before you can complete it. So it is more of a feature, and a good security measure.

Userlevel 7
Badge +17

Yes, see our responses above

Userlevel 7
Badge +17

You can provide history to know what the original assignee was.

You would have to write your own Custom Action to work around the current user check. There is example code and instructions using the SDK Nintex Workflow 2010 SDK . But that is a big step to provide a work around.

Userlevel 7
Badge +17

Wow! Did you create your own Custom Action?

Badge +1

I have same issue,the 'ProcessFlexiTaskResponse'/'ProcessFlexiTaskResponse2' doesn't process the task because the 'ProcessFlexiTaskResponse'/'ProcessFlexiTaskResponse2' only run as specified user instead of workflow current user.

but 'ProcessFlexiTaskResponse'/'ProcessFlexiTaskResponse2' require the person making the web service call to complete the task to be the same person as the task assignee,so the web service,can somone provide solution,thanks.

Reply