Skip to Content
author's profile photo
Former Member

How to delete duplicate work items in workflow

Hi All,

I have developed a workflow for reservation. It has 4 approvers. The workflow is working OK,only one issue arises.I created an event that triggers when reservation is created.If lets say Approver1 approves the work item it goes to Approver 2. and then to Approver 3 ..till the last Approver.

In case any user wants to edit the reservation lets say by increasing quantity or adding new item ,the workflow re-triggers again and the approval process starts afresh from the beginning with Approver 1.

I am now having duplicate work items,from the previous and the new workflow.Is there a way to delete/block the previous item when the workflow re-triggers so that I can have only the new work item?

Regards

Jack

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    Mar 25, 2013 at 02:49 PM

    Hey Jack,

    you can use the event, that triggers the (new) workflow to cancel the old workflow.

    In the Workflow Builder Select "Goto->Basic Data". Then choose Tab "Version-Dependent" and "Events".

    Here you can enter the Event just like you used it to start your workflow. Choose Receiver Type "Cancel Workflow". When the event is risen, the currently running WF and all subsequent Workitems are cancelled.

    Regards

    Joe

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 25, 2013 at 02:32 PM

    Hi,

    You can try to use the function module "SWW_WI_DELETE" to delete the workitem but then it would be lost. You can also cancel it via "SWW_WI_ADMIN_CANCEL".

    This should be done from the call to your new workflow/workitem.

    For this you'll need to find back the workitem ID of the open workflow...

    Best regards,

    Jonathan

    Add comment
    10|10000 characters needed characters exceeded