Friday, February 19, 2010

Nintex SharePointTaskId, InfoPath, and conditional formatting

I was recently working on an InfoPath form that was used to drive a Nintex workflow. I had gotten to the point where I needed to make sure not just any ole user could respond to a task as terrible things happened (the rules in the InfoPath form were applied, but the workflow would not move forward and chaos ensued).

My search began with the SharePointTaskId property in the GetRunningWorkflowTasksForCurrentUser web service method that Nintex provides. I noticed some oddities in the process:

1) in code, the value was always empty. just to make sure I wasn't hallucinating I copied the outerxml of my xpath query. every node in the subtree had an empty value. YET, if I applied conditional formatting by saying "is not blank", it worked.

2) if I tried to perform conditional formatting by saying where SharePointTaskId is blank, it did not work. This had me scratching my head since the "is not blank" worked perfectly.

My solution for the second issue was to compare the WorkflowName property against a pattern (e.g. WorkflowName does not match pattern \p{L}+ -- in other words, WorkflowName has to have at least 1 letter)