Question

Non-Workflow Dependent Admin tasks

  • 24 January 2014
  • 3 replies
  • 17896 views

I have a custom MVC app that presents worklist to a user and allows the user to action their tasks.  The requirements I'm trying to fullfil is to provide the ability for (1) a flow originator to cancel a workflow and (2) an admin group to edit or cancel a request/flow.  I was thinking about creating an "Admin" task right off of START which would create the task for admin folks, and the MVC app could provide the admin functionality from there.  However, that task may never get completed because it may be uneccessary for that flow.  I have a similar situation where a group of people may be given a "survey" task where I don't really care if they action the task or not.  I do however want the flow to continue through another critical path - to completion.  Is there a way to create an activity/task that doesn't NEED to be completed for the flow to ever complete?  With me?


3 replies

Hi Jensor,


If I get you correctly, your problem is when the main flow is completed, the parallel tasks (sub-flows) are still available to the originator and admin group. 


To solve this,


1. create a place holder activity and name it "Completed". Do not join any lines to it yet.


2. create a dummy default client event and assign k2 service account to it (idea is to ensure nobody actually actions this). Add an escalation rule that executes after 1 second and run the "go to activity" template to the activity created in (1) above. Join the outcome line to (1).


3. For each of the last activity of each sub-flow (main, originator and admin group), draw a line to the activity in (2).


 


The above setup will ensure that when any of the sub-flow completed, it will execute a "go to activity" escalation, which will then expire all other activities. This ensures the process is completed with no other active activities.


 


Hope this helps.


JK


 

HI all,

 

On JK's point, I dont think its possible to have an activity that is not joined up. It will not build. You can just connect it and set the line rule to 1=2 which will never evaluate to true.

 

1. the flow originator to cancel a workflow. THis can be done quite easily throught he K2 API. Just have to pass the process instance id and then impersonate a admin account( or rather open the conenction as admin and impersonate the app identity user). Just as an additional security measuse you can get the process originator and then comapre the name to the app identity user just to make sure they are only cancelling process they have started.

 

2. the same applied to your second question, now you can check against a database for example where you can store the admin users before actually cancelling the process.

 

I think you can also use escalations. for example, if you have an activity that is assigned to 5 people. You dont care if it is actioned or not. Just wait a day, if no one has actioned then you can make use of the gotoactivity int he workflow to make it move to the next step.

 

Hope this helps.

 

You can accomplish all of this using the K2 API. As has been alluded to, solutions involving activities in the actual workflow will only result in much pain and gnashing of teeth. Also, you cannot terminate an existing workflow without admin rights in the process. Using the K2 API, you can accomplish everything you want.

However, you should consider the audit implications of what you are asking. If your task contains approvals and the data can be changed after an approval has taken place, the audit-ability of your process is pretty well shot. This may or may not be a concern for your process, but you should be aware of it.

Reply