Skip to main content

Hello,


I have requirement that users want to know the flow is waiting in which activity and who is taking the responsibility for now


my application uses ASP.NET as front end so I write the code like this after Execution the Action


 


oWI.Actionssaction].Execute(); //oWI is WorklistItem


//connect workflowServer to workflow management server


workflowServer.GetWorklistItems("", workflowName, "", "", folio, "", "");


//where workflowServer is SourceCode.Workflow.Management.WorkflowManagementServer


 


then I get information what is current activity and current destination user from worklistitem information after Action has been done


 


It seems fine when I test but there is a problem when I deploy to QA server, The result does not come as expected, the sever cannot find the process (it returns 0 item) I want to get via GetWorklistItems and I just know later that it takes a long period to return items after i called it serveral times (I have to wait like a minute or 2) (but destination user see their task immediately after action is done)


 


So my question is, Is there any ways to get the information immediately? I write the code when submit button is clicked, so I cannot wait for 1 or 2 mins to submit form just for update workflow status


 


thanks for any suggestions and sorry for my bad language...

On the QA server, what account is the App pool running under?  If it is not an admin on K2, I don't think it will ever return anything from a management server query.  Let's start there and then move on to the performance issue


How many items are in the QA worklist vs your dev environment?


 


Thanks for replies :)


tbyrne: app pool account is K2 admin because I can get the item eventually but it takes long period sometimes.


Peter: around 240 items, I don't think it's too many of them...


 


 


Hi there,


It sounds like what you need to do is execute the action synchronously. To do this you can call the action like this:


oWI.Actions[action].Execute(true); 


What this will do is that the Execute function will execute synchronously with the process flow and only return (continue to run the next line of code) when the process reached the next client event. And that sounds like exactly what you want, because you don't want to call the other code to see at which activity the process is if it has not reached the next client event yet. 


With regards to the speed you are talking about - that is dependent on the amount of server processing that the process has to execute after the current activity until it reaches the next client event. If you have a slow server or many code to be executed then I can expect it to take a while. 


Hope that helps,


G


THANKS GLouw!! You saved my life :))


Now I modify the code to execute synchronously and it works like a charm :)


It's a bit slower than usual but that's "synchronous" right? :P


But can I ask you a bit further question, I don't understand when I execute asynchronously, some time I cannot query the work list item even the task is already assigned to destination user, I mean if users can see their own task, why query returns nothing... it does not make sense in my opinion...


Anyway, I will monitor performance issue for this one again when application is deployed on production server... if it is too slow, maybe I have to try another way


and thanks again!!!


Ya that is strange because if users can see the work list item on their worklist, you should be able to query it through the Mgmt API. But I have heard of these delays before, so I guess not impossible. 


Performance wise, there are many things you can do, and I would suggest you look at how many smart object calls your process makes or other code that it might run inbetween. You can also optomize your hardware or consider NLB to share some of the load between two servers if you have many users connecting to the system.


Hi,


In the workflow I try to call smart object as less as possible (but it still many of calls anyway...) and production servers implement NLB already. Have to wait and see the result when workflows are deployed.


thanks again for your help!! :)


Reply