cancel
Showing results for 
Search instead for 
Did you mean: 
andrewg
Nintex Newbie

Re: What is the ProcessFlexiTaskResponse web service suppossed to do?

Jump to solution

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.

0 Kudos
Reply
andrewg
Nintex Newbie

Re: What is the ProcessFlexiTaskResponse web service suppossed to do?

Jump to solution

Yes, see our responses above

0 Kudos
Reply
Not applicable

Re: What is the ProcessFlexiTaskResponse web service suppossed to do?

Jump to solution

Dear Andrew

  • Re assign the task and completing it, we will loose the task's actual assignee.
  • You have menssioned "One solution is to write your own function without that step". Can you get me a sample of this code.
0 Kudos
Reply
Not applicable

Re: What is the ProcessFlexiTaskResponse web service suppossed to do?

Jump to solution

Dear Andrew

  • Re assign the task and completing it, we will loose the task's actual assignee.
  • You have menssioned "One solution is to write your own function without that step". Can you get me a sample of this code.
0 Kudos
Reply
andrewg
Nintex Newbie

Re: What is the ProcessFlexiTaskResponse web service suppossed to do?

Jump to solution

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.

0 Kudos
Reply
Not applicable

Re: What is the ProcessFlexiTaskResponse web service suppossed to do?

Jump to solution

Thanks for your reply Andrew...

    We have achieved it by using nintex SDK.

0 Kudos
Reply
andrewg
Nintex Newbie

Re: What is the ProcessFlexiTaskResponse web service suppossed to do?

Jump to solution

Wow! Did you create your own Custom Action?

0 Kudos
Reply
Not applicable

Re: What is the ProcessFlexiTaskResponse web service suppossed to do?

Jump to solution

Please see the below function ... Hope many will find this as a most helpfull one....

(Sharepoint 2013 , Infopath 2013 , Nintex Workflow 2013)

Public Function ProcessTaskResponse2(comments As String, outcome As String, spTaskId As Integer, taskListName As String) As ProcessTaskResponseResult

            If spTaskId = 0 Then

                Throw New ArgumentException("spTaskId is 0.")

            End If

            Dim site As New SPSite(SPContext.Current.Web.Url)

            Using web As SPWeb = site.OpenWeb()

                web.AllowUnsafeUpdates = True

                Dim lists As SPListCollection = web.Lists()

                Dim sPList As SPList = Nothing

                Dim outcome_ID As Integer

                sPList = lists.Item(taskListName)

                outcome_ID = ConfiguredOutcome.GetOutcomeId(outcome, web)

                Dim sPListItem As SPListItem = NintexTask.RetrieveSPListItem(spTaskId, web, sPList)

                Dim nintexTask__1 As NintexTask = NintexTask.RetrieveTask(spTaskId, web, sPList)

                Dim bySPId As Approver = nintexTask__1.Approvers.GetBySPId(spTaskId)

                Try

                    Dim flag As Boolean = True

                    Try

                        Dim taskLocker As New TaskLocker(bySPId)

                        flag = taskLocker.ObtainLock()

                    Catch

                    End Try

                    If Not flag Then

                        Return ProcessTaskResponseResult.CannotObtainLock

                    End If

                    sPListItem.Item(NWSharePointObjects.FieldComments) = comments

                    sPListItem.Item(NWSharePointObjects.FieldDecision) = outcome_ID

                    sPListItem.Update()

                Catch generatedExceptionName As Exception

                    bySPId.UpdateTaskLocked(False)

                    Throw

                End Try

                Return ProcessTaskResponseResult.Success

            End Using

        End Function

If you are using infopath, Directly use it in the codebehind. If you want to use it in your workflow, create a new webservice with this code and call it....

0 Kudos
Reply
Highlighted
Not applicable

Re: What is the ProcessFlexiTaskResponse web service suppossed to do?

Jump to solution

Dear Ziad,

thanks for your post

i faced same issue, but i am trying to use same function but there is an error in it like

NintexTask

ConfiguredOutcome.GetOutcomeId

Approver

TaskLocker

NWSharePointObjects

please advice if you can help

Amjad

0 Kudos
Reply
Not applicable

Re: What is the ProcessFlexiTaskResponse web service suppossed to do?

Jump to solution

You have to add Nintex workflow DLLs as references to the project

1.Nintex.Workflow.DLL

     C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Nintex.Workflow\<version>\Nintex.Workflow.dll2.Nintex.Workflow.ServerControls.DLL

     C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Nintex.Workflow.ServerControls\<version>\Nintex.Workflow.ServerControls.dll

3.Microsoft.Sharepoint.DLL (Not sure required or not)

0 Kudos
Reply