Web Services API: CompleteActivityInstance error : System.NullReferenceException: Object reference not set to an instance of an object


#1

When calling the complete activity instance web service I get the following error:

System.NullReferenceException: Object reference not set to an instance of an object.
at Advantys.My.Globalization.TimeZoneInformation.GetTimeZone(Int32 timezoneIdentifier)
at Advantys.Workflow.Web.Services.Processes.Runtime.RuntimeService.CompleteActivityInstance(Int32 processInstanceId, Int32 activityInstanceId, String workflowContext)

Configuration:

  • the wfgen_admin username is entered as “mydomain/wfgen_admin”

  • the “ApplicationSecurityRemoveDomainPrefix” web.config entry has been set to “_all”.

  • If we remove the web.config setting we will get a user is not a participant error when trying to call completeactivity

SOLUTION

The ‘_all’ value in the parameter “ApplicationSecurityRemoveDomainPrefix” does remove the domain name in the login name that is why you are getting the error message because the user is no longer found in the database after the domain name was removed from the login name.

Case :

  • The user’s usename is stored as ‘mydomain\wfgen_admin’ in the database

  • ApplicationSecurityRemoveDomainPrefix is set to ‘_all’ which removes the domain name from login name

  • When you login with ‘mydomain\wfgen_admin’, this will become ‘wfgen_admin’ after ApplicationSecurityRemoveDomainPrefix is applied.

  • Then WFG tries to find a user where username is equal to ‘wfgen_admin’ but couldn’t find it because the username is stored as ‘mydomain\wfgen_admin’.

The solution is to NOT skip the domain name for the users where its username is prefix by a domain name.