Skip to main content

Hi,

We have a requirement to enable cancel workflow for the originator through the smart forms so that the originator can cancel the workflow at any point of time. Based on our analysis, we were trying to use the GoToActivity() method as follows :

 

private void goToActivity(int procinstid, string ActivityName)
{
         System.Diagnostics.EventLog EventLog = new System.Diagnostics.EventLog();

         ((ISupportInitialize)EventLog).BeginInit();
         if (!EventLog.SourceExists("K2 Custom Goto"))
         {
             EventLog.CreateEventSource("K2 Custom Goto", "Application");
         }
         ((ISupportInitialize)EventLog).EndInit();
         EventLog.Source = "K2 Custom Goto";
         EventLog.Log = "Application";

         

         if(this.Service.ServiceConfiguration.ServiceAuthentication.AuthenticationMode == AuthenticationMode.ServiceAccount)
              System.Threading.Thread.CurrentPrincipal = null;
         string ConnectionString = this.Service.ServiceConfigurationÂ"ConnectionString"].ToString();
         WorkflowManagementServer wms = new WorkflowManagementServer();
         wms.CreateConnection();
         wms.Connection.Open(ConnectionString);
         EventLog.WriteEntry("Before calling goto in proc id:"+procinstid, EventLogEntryType.Information);
        
         wms.GotoActivity(Convert.ToInt32(procinstid),"Finish Workflow");

         EventLog.WriteEntry("After calling goto in procid:" + procinstid, EventLogEntryType.Information);
         wms.Connection.Close();
    }

 

However, the workflow keeps hanging ( running) at wms.GotoActivity(Convert.ToInt32(procinstid),"Finish Workflow"); . Finish workflow is our end step in the workflow and I have used procinstid directly as well without any use.

 

We would like to know what we are doing wrong. Any help would be extremely useful as its stopping our production roll out

 

Regards,

Deb

Do you have any other instances running? If yes, you might need to terminate them as well.

 

Maybe you can take a look at http://community.k2.com/t5/K2-blackpearl/Code-to-stop-Process/td-p/27597


I find this appaling.

 

What if K2 is deployed corporate wide with high intensity workflows that in some point there is some running with lengthy server events.

 

It seems, to do this transaction such as goto activity it requires mutual exclusion that all are not in running state.

 

And worse, while it is trying to acquire this mutex, other functionality such as client API grinds to a halt for related users.

 

 

 

 

This is hardly enterprise behaviour at all.

 

 

I have started an earlier thread when I stumbled on this post.

 

http://community.k2.com/t5/K2-blackpearl/K2-Client-API-Performance-Issue/td-p/86177


I have a video simulating this issue.

 

 

https://docs.google.com/uc?id=0BxJ0ELWcUhuaNHhjXzQyQUIwVTQ


Based on our further testing and troubleshooting this is what we found out.

 

 

1. When a server event is let's say running for 1 min. It takes 1 min to execute its unit of work.

 

2. During this window a (e.g. t20 ) User A connects to the API and does a GOTO activity.

 

3. It will wait till the server event completes (t60) and then execute the GOTO.

 

4. During this time (t20 - t60), this user A will not be able to perform any kind of other client API like pending tasks etc.

All other execute action and worklist item api will just be put on a wait/block.


Are you perhaps using a developer license also, that is currently running in console mode?


 


Perhaps it is due to the limitation below:


 


Console Mode has the following limitations and performance implications for all Development Servers:



  • Requires Local Login
  • Single-threaded Execution only
  • Single CPU only (multiple processor use is disabled)

http://help.k2.com/onlinehelp/k2blackpearl/userguide/current/webframe.html#k2_license_types.html


 

@tin wrote:

Are you perhaps using a developer license also, that is currently running in console mode?

 

Perhaps it is due to the limitation below:

 

Console Mode has the following limitations and performance implications for all Development Servers:

  • Requires Local Login
  • Single-threaded Execution only
  • Single CPU only (multiple processor use is disabled)

http://help.k2.com/onlinehelp/k2blackpearl/userguide/current/webframe.html#k2_license_types.html


 

 

It is definitely not the licensing....


Reply