CreateProcessInstance method in k2Rom does not return ID

  • 19 January 2006
  • 1 reply
  • 1 view

Badge +1
I may have misunderstood the behaviour of the method CreateProcessInstance.

When it is invoked,
-it does not appear to create a single running instance.
-A record is not created in the K2._ProcInst table
-An ID is not returned for the processInstance object.
-It does not appear in the k2.Net Service Manager

The above only seems to happen when you subsequently invoke

K2Rom.StartProcessInstance( ProcessInstance )

Does the CreateProcessInstance only create an in memory object that you can then utilise?

The following is the documentation it seems to imply that it should be creating a process instance that is not started.

"The CreateProcessInstance method is used to create a single running instance of a procedure based on a process definition designed in K2.net 2003 Studio. ProcName and Version are the only parameters required when using this method. If the version parameter is set to (0) K2.net 2003 Server will use the latest version available in the data store.

The kind of behaviour that I am looking for is

I want to create a process instance and have a unique reference to this so that I can track its progress. I would like the option of either starting the instance immediately or scheduling for some time in the future.

Any ideas welcome.

thanks

Gwyn

1 reply

Badge +11
Well, I don't know what else I can tell you about CreateProcessInstance and StartProcessInstance - looks like you understand the purpose of both. The two methods are basically mutually exclusive - the one can not do without the other. CreateProcessInstance will 'prep' K2.net Server for the new instance which will be started. It does not return a ProcInstID but rather a handle to a ProcessInstance object which can be manipulated.

Hope your guestion is answered in the other post:
http://forum.k2workflow.com/viewtopic.php?p=3368

Regards,
Ockert

Reply