Exception accesing worklistItem.ProcessInstance.Originator.Name

  • 23 February 2017
  • 1 reply
  • 6 views

Badge +4

Hi,

 

When I try to acces worklistItem.ProcessInstance.Originator.Name property I get following exception:

 

Send failed with error: An operation was attempted on something that is not a socket.

w SourceCode.Workflow.Client.SocketClient.Send(UInt32 sock, MessageType type, SByte* buf, Int32 len)   w SourceCode.Workflow.Client.SocketClient.Send(ClientMessage Msg, Int32 Start, Int32 Length)   w SourceCode.Workflow.Client.InternalConnection.Call(ArchiveX ar, MessageType msgtype)   w SourceCode.Workflow.Client.InternalConnection.CallFunction(ArchiveX ar)   w SourceCode.Workflow.Client.User.LoadProperties()   w SourceCode.Workflow.Client.User.get_Name()

 I've also noticed some strange entires in the Identity.Identity table:

 

ID FQN Name Label Type Enabled Properties ExpireOn ExpireInterval Resolved ContainersResolved ContainersExpireOn MembersResolved MembersExpireOn Dynamic ProviderData ServerID ContainerServerID MemberServerID DisplayName
82 K2:ADuserx ADuserx K2 1 1 <properties… 23.02.2017 16:23 28800 1 1 23.02.2017 16:23 0 23.02.2017 08:21 0 NULL 0 0 0 Test user
145 k2:aduserx aduserx k2 2 0   23.02.2017 08:21 28800 0 0 23.02.2017 08:21 0 23.02.2017 08:21 0 NULL 0 0 0 k2:aduserx
146 k2:aduserx aduserx k2 3 0 <properties… 23.02.2017 08:21 28800 0 0 23.02.2017 08:21 0 23.02.2017 08:21 0 NULL 0 0 0 k2:aduserx

 

Thanks in advance for help,

arnam


1 reply

Badge +9

Hi, 


 


This can be a result of the way the connection was being handled within the using statement of the code. When the statement tries to return details of an object which is no longer available when it’s outside of the using statement's context.
Some possible options:
1) Create a connection, which is open, and then close it (manually), before and after the method GetWorklist in the assembly where this method is referenced
OR
2) Put the K2connection in the using statement, instead of the OpenWorkflowConnection. Before exiting the using statement, the following should be executed:
-Create an instance of the worklist item
-Properties for the originator to access
-Processing it
-And then close the connection
 


Kallie

Reply