Skip to main content

Hi,

 

Can anyone help?

 

I have a form which allows a USER (SENDER) to send a transfer request for an item from their ownership to someone else:

 

The person who will receive the item, has to authorise the request with Approved/Declined (offline approval via email)

If the Receiver Approves the request, the workflow continues and transfers the item over etc.

 

This works fine.

 

However, say for instance. the RECIVER is lazy/or leaves and never replies to the email/ or the SENDER changes his mind, i need a way to cancel the Transfer.

 

Can anyone suggest how I can implemenet a Cancel button on the list view so that the SENDER can CANCEL the Workspace item for that job and then send emails to the RECIEVER saying the transfer was cancelled by the Sender?

 

Thanks

Hi Sharpharp1

 

It sounds like what you want to do is allow a user to cancel a task (client workflow activity. The difficulty with doing this is that you need to instruct the workflow where to go next. You may want to cancel the entire workflow, or move to another activity. 

 

I think there are 2 ways you can approach this (easy and hard):


The easy and suggested way is to use activity escalations. On the activity set an escalation to occur after a set number of days (e.g. 2 days). Depending on your requirement you can then either expire the activity or use the GoTo activity to move to another activity. If you need to send an email at the same time you can configure another escalation to fire at the same time that sends an email. This approach does not cover your requirement to allow a user to cancel the request however.

 

The hard way is to programmatically interact with the workflow and send an instruction to cancel the workflow or GoTo another activity. This can be done by creating another workflow (in Visual Studio) that executes some code using the K2 API. You will need to capture the Process ID of the original workflow to do this (you can do this by adding a field to your SmartObject "Process ID" and setting this in your workflow with a smartobject event). You can then allow a user to start the cancel workflow from the form. If you need an example of some code that cancels a workflow let me know.


Reply