cancel
Showing results for 
Search instead for 
Did you mean: 

Does Cancelling the work item will delete the workitem from agent's inbox?

former_member194142
Participant
0 Kudos

Hello

We have a some vendor's add-on app, which trigger/uses the workflow framework for approvals, well.

When user_A hits the SAVE button on this app below backend activities will occur,

1) The workflow will start/trigger

2) Also, at the same moment (once WF triggered) system will send work items, say for example, 5 work items to user's workflow inboxes because I can see that in SWI1 tx as WORK ITEM SENT status

2.5) we have a BADI here

3) User_A will recieve a message as 'App is saved successfully and workflow started' as a popup

1st work item has 3 agents
2nd work item has 2 agents
3rd work item has 4 agents
4th work item has 1 agents
5th work item has 2 agents

But, for 2 special sales orgs, I need to filter the last 3 work items in this workflow trigger, I mean, for these 2 sales orgs, the last 3 work item's agents are not valid hence they suppose to do not receive any work items in their boxes for this WF hence what I did

Here at (2.5) BADI I identified the last bad 3 work items and am CANCELLing them by using FM of SWW_WI_ADMIN_CANCEL hence now am seeing these bad 3 work item's status as CANCELLED

Pl. let us know

1) is my approach is OK / Safe?

2) I'm guessing the last bad 3 work item's associated agents will not get any work items in their inboxes, right bcz status changes to CANCELLED?

Thank you

Accepted Solutions (1)

Accepted Solutions (1)

I042439
Employee
Employee
0 Kudos

Hi

It is hard to help when you have given very limited information on how the event is triggered (custom code, change docs, standard) , what is the main BO of the workflow, what is the process flow of the workflow....... however, I will still try to answer...

Is there ONE workflow behind all workitems...sending them in a loop? If yes, you can bypass sending the 4th and 5th item based on the sales orgs (provided you have it as a container value). In the loop you just need to check the sales org and the loop counter (a container variable which you will have to create and increment at each level) and then exclude sending the last two work items.

OR

Is it just ONE workflow with 5 individual instances (one workitem from one instance/level)? If yes, you can put a start condition to NOT trigger the workflow for the respective sales orgs.

It is always good to NOT generate a workitem which you will not need instead of generating it and then canceling it.

regards,

Modak

former_member194142
Participant
0 Kudos

Thank you. I agree with you that instead of cancelling the work items we should not generate them in 1st place itself. But, bcz of some reason, we are generating.

Yes, there is ONE workflow behind all work items

In short, pl. let us know -

If I cancel the work item by using the standard FM then whether the SAP will delete the work item from agent's / user's workflow inbox or not?         

Thank you

former_member185167
Active Contributor
0 Kudos

Hello,

Yes, it will disappear out of the user's inbox but what will happen in the workflow if no decision is made by the user?

regards

Rick

former_member194142
Participant
0 Kudos

Thank you.

Since am kind of new to WF, I said its ONE workflow, hence I thought its better to put screen shots here,

1) Before my BADI's code triggering below is status (READY), wherein WF initiated and work items are sent to agent's inboxes

2) Now my BADI's code will trigger and cancels the UNWANTED (here in this example 240656, 240658 and 240660, I can say these are bad work items and we don't want them / agent's actions) work items by using std. SAP FM so that work items will be removed from agent's inbox

After my BADI's code triggering below is status (CANCELLED)

I agree that instead of cancelling we must do not generate UNWANTED work items in 1st place, but bcz of some reason they are generating

Pl. let us know is it OK / safe or any danger?

Thank you

former_member194142
Participant
0 Kudos

Sorry, I said its as ONE workflow.

Now I have uploaded 2 screen shots of SWI1 tx, pl. check them and help us

Thank you

former_member185167
Active Contributor
0 Kudos

Hello,

It's impossible for us to say because we don't know what the design of your workflow is.

Look in SWDD and provide some screenshots. Indicate where these steps are.

"but bcz of some reason they are generating"

The reason can be found in the workflow, it's not a mystery.


regards

Rick

former_member194142
Participant
0 Kudos

Thank you.

Pl. see my reply to Modak

Answers (1)

Answers (1)

I042439
Employee
Employee
0 Kudos

Dear SAP (to the power of 3)

Please understand that this is not a robust design..... specially when you are SAP to power 3!!

If you cancel the last three work items - what will happen to the background step which gets executed after the approval (we can see a "Process" step in the log given by you) ? Answer: It will not execute. What happens to the remaining steps - they will also not execute - the workflow will hang there till all eternity till the devil comes knocking the workflow admin's door with a gun that "WHY MY WF IS NOT COMPLETE YET"!!

Some reason can not be any reason for a bad design . This will always have issues in future. If you have got a chance to correct something - please do it now.

Regards,

Modak


former_member194142
Participant
0 Kudos

Thank you, I liked your answer (devil questioning the WF admin )

Actually, this WF is 3rd party add-on owned / shipped object and its damn complex hence as a newbie I don't want to touch/change it w/ a access key

So, am trying to achieve my requirement from feeder classes / BADI. In my OP I said sales orgs, but they are not static they are dynamic, it depends on the user picked sales orgs on the UI, in this example, say the user selected 1 & 2 sales orgs hence I am filtering the 3,4, & 5th sales entries / WIs from the WF

As Rick suggested I tried to get graphical pic of whole WF but system is asking 'Do you want to have High level or Current one' and seems we can't get all the WF/WIs in one screen shot, hence am here putting one complete WF SWI1 log as below, I guess now you guys will some idea about my WF (since from the beginning am referring only 1 to 5 hence here in this pic I marked just up to 5, just as an example purpose)

As a newbie my answers for your questions: Here 1,2,3,4 & 5 are independent / stand alone, neither they are dependent on each other nor on the WS00289900, WS00289901, WS00289902s (Red arrow marks), hence if I cancel 3,4,5 there will not be any impact with this cancellation either on WIs 1,2 or on WS* or the whole as a WF object, hence its OK to cancel them, only concern is unnecessary logs for 3,4,5 in the system as a junk data! this is just my rough guess ((yes, I agree that the 3,4 & 5 are generated from WS*))

Thank you

I042439
Employee
Employee
0 Kudos

Hi

Which system is it? I have an ECC system and I could not locate these in my system.

They seems to be standard workflow tasks - delivered by standard. There should be a relevant documentation for it.

However, I am a bit confused because I could not find anything on TS00289902 or WS00289902 on SAP Help either.

Normally, custom workflow templates start with WS9xxxxxxx and tasks start with TS9xxxxxx.

Still, the above SWI1 screenshot is really not clear because it only shows the dialog and activity steps, however, there are many other steps in the workflow which can impact a lot....loops, conditions, container operation, etc. The above will really not help us to get a clear picture of what the workflow is doing.

I would suggest that you go to PFTC, display the workflow and go through the flow. How it determines the approvers, the levels , check the technical WF log and the step containers to understand the flow. Maybe, there is a way to control the levels.

Regards,

Modak

former_member194142
Participant
0 Kudos

Thank you.

As I said this object (workflow, feeder classes, BOR) are delivered from SAP partner/3rd party vendor, hence you didn't find it in your system. It has sub-workflows inside the main workflow. Basically CL_SRM_WF_PATH is triggering

Today my functional consultants tested my changes (cancelling the unwanted WIs by using FM) and said the workflow is not completing, so I started checking that where/how can I control to do not get generated unwanted WIs in first place itself, but no luck. I tried to debug the workflow / background job by putting a DO - ENDDO and checking the class attributes (internal table contents, variables) values but am getting error message as 'Select a valid variable', probably they are PRIVATE attributes.

So, now am thinking instead of cancelling I want to try COMPLETE the unwanted WIs by using FM 'SAP_WAPI_WORKITEM_COMPLETE', keeps posted my test results

Regards