Hi All,
Could anybody show me how to get the process instance ID from the smartform, or somehow get the reference to the ProcessInstance class.
Regards
Viet
+2
Hi Viet
You can use the K2ROM to get the processinstance ID from an existing process instance. You'll notice that the K2 serial number is passed as a parameter when opening an ASPX form.
The code to get the ProcessInstance ID would look something like this (pseudo-ish code):
Sub Page Load Event
If not IsPostBack
dim myK2Conn as new SourceCode.K2ROM.Connection
dim myWorkListItem as SourceCode.K2ROM.WorkListItem
dim SerialNumber as string = request("sn")
myconn.open(K2ServerName)
myWorkListItem = myK2Connection.OpenWorklistItem(SerialNumber, "ASP")
dim myProcessInstance as SourceCode.K2ROM.ProcessInstance = myWorkListItem.ProcessInstance
dim ProcessInstanceID as string = myProcessInstance.ID
end if
end sub
Unfortunately there is, to my knowledge, no way to get a ProcessInstanceID from a PlanPage, but I'm open to being corrected on this. You would thus only be able to use the above code on an existing process instance.
Good Luck
Dirk
You can use the K2ROM to get the processinstance ID from an existing process instance. You'll notice that the K2 serial number is passed as a parameter when opening an ASPX form.
The code to get the ProcessInstance ID would look something like this (pseudo-ish code):
Sub Page Load Event
If not IsPostBack
dim myK2Conn as new SourceCode.K2ROM.Connection
dim myWorkListItem as SourceCode.K2ROM.WorkListItem
dim SerialNumber as string = request("sn")
myconn.open(K2ServerName)
myWorkListItem = myK2Connection.OpenWorklistItem(SerialNumber, "ASP")
dim myProcessInstance as SourceCode.K2ROM.ProcessInstance = myWorkListItem.ProcessInstance
dim ProcessInstanceID as string = myProcessInstance.ID
end if
end sub
Unfortunately there is, to my knowledge, no way to get a ProcessInstanceID from a PlanPage, but I'm open to being corrected on this. You would thus only be able to use the above code on an existing process instance.
Good Luck
Dirk
Reply
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.