Data field value

  • 20 March 2006
  • 3 replies
  • 1 view

Badge +7
Hi all,

is it somehow possible to exchange data field values between 2 process without using an IPC event. I guess I'll net the ProcessInstance ID of the runinning process to which i want to pass the values.
Can someone help ?

Thx

3 replies

Badge +6
You are correct - You can use the OpenProcessInstance passing the Process ID to open a specific process instance. This would then allow you to modify data fields.

Example
[Visual Basic]

Private Sub OpenProcInst(ProcInstID as Integer)
Dim oK2Connection As New SourceCode.K2ROM.Connection
Dim oProcInst As SourceCode.K2ROM.ProcessInstance

oK2Connection.Open("K2Server")

oProcInst = oK2Connection.OpenProcessInstance(ProcInstID)

oProcInst.DataFields.Item("Some DataField").Value = "My New Value"
oProcInst.Update()

oK2Connection.Close()
End Sub

Watch out for using K2ROM code directly from the K2.net Server - Rather wrap the functionality into an assembly and call this assembly from your code...
Badge +7
Hi Conrad,

first thx for your reply.
What I am trying to do is to call all that from a buttion event within my InfoPath form. Isn't that possible ? I use the following code:
.Value = "test date";

myK2Conn.Close();


The OpenWorklistItem Method I only use to change the status of the worklistitem. Actually after the button is pressed the datafield "Resin Test Response Date" of the other process should be "test date" shouldn't it.
Do you have an idea why it doesn't work ? Do I make any crucial mistake ?
Badge +7
Ok,

got it working now, and the solution you mentioned is far better.

But to all who wanna do the same once.

DO NOT FORGET TO USE THE .UPDATE() Method if you want to save you some time. :evil:

Reply