How to update Task Status


Badge +4

Hi,


I have a requirement which i have explained below:


we are developing a Taskboard using asp.net form instead of using K2 workspace. Taskboard displays worklist itmes(Tasks). There is a coulmn called "Satus" in taskboard similar to "Status" column in k2 workspace with additional entries. "Status" column of the K2 workspace has 3 or 4 entries(OPEN, AVAILABLE,COMPLETED, etc) but the "status"  Coulmn in Taskboard needs to have entries like NEW, WIP, ASSIGNED, APPROVED,REJECTED, etc.. Can somebody suggest best way to implement this scenario? Is it possible to update the K2 database with this additional status entries(NEW, WIP, ASSIGNED, APPROVED,REJECTED)? if so how to update?


Note: am using k2blackpearl, ASP.NET


 


 


4 replies

Badge +8

The status column in the workspace refers to the built-in status of a K2 worklist item, the status is maintained by the system for example, it will be Available, but as soon as a user clicks on a worklist item its status will automatically change to Open etc. This Status cannot be changed since it is fundamental to the way K2 operates.


If you need to keep additional statuses, one suggestion would be to store that in a Process Datafield and then set the Datafield to a new value as your Process Instance moves from Activity to Activity.


In a Server Event (Code) you can do something like: K2.ProcessInstance.DataFields["myStatus"].Value = “Assigned”;


Having said that, in Workflow it is rarely necessary to keep such Status fields since the Current Activity should tell you the status, e.g. instead of modifying a Process Datafield to “Approved”, the Process Instance will move to an Activity called “Approved” once the designated user has Approved it etc.


 

Badge +4

Hi Smiddie,


Thanks for the reply.


Yet I am looking for something which should be done at Activity Level i.e., The status update should happen for each activity and not for a single process.


If I use Process datafield as suggested, then it will be only Process level status update.  In this case I will have no record of previous activity status.


ex: Activity A1  -> Activity A2 -> Activity A3


User moves a process instance P1 from A1 to A2. Let's say we update the process datafield "Status" from value "Requested" to "Wait on Aproval". Later user moves from A2 to A3 and the status field is updated from "Wait on Approval" to "Approved".


In this case at any point of time, the status datafield shows only the current Activity status. We have no record of the previous activity status.


What we require is to maintain history of the status for EACH ACTIVITY. That means we should have something at Activity level to store the status.


As said, the Available and Open options can' t be modifed, agreed. So what could be the other option for maintaining history of status for EACH Activity?

Badge +8

You could enable auditing on the Process Data Field or you can use Activity Data Fields,


 

Badge +3

Hi Nithya


Could I suggest usage an activity datafield on each activity containing an integer datatype which you set at each step of the workflow to determine your custom status? I do not recommend editing the status of the process, primarily because you can't as it is a read-only field which is only set set by the K2 server during runtime.


 Regards


Pieter


 -----------------------------------------------------------------------------------------------------------------


The information contained herin does not reflect the view of K2, this is my own opinion


 

Reply