cancel
Showing results for 
Search instead for 
Did you mean: 

Triggerinng of WF using Class-Method delays for 12 hours

raviprakash
Advisor
Advisor
0 Kudos
197

Hi Everyone,

I am facing a strange issue. I am using a R/3 application where WF is triggered using the FM "SWE_EVENT_CREATE", the WF gets triggered instantly. Then I created a WD application and used the method CALL METHOD cl_swf_evt_event=>raise to raise an event to trigger WF.

Even now the WF gets triggered but the delay is highly unacceptable. It takes 8-12 hours to get the Wok Item into my inbox. I refreshed the buffer using transaction SWU_OBUF but still it didn't help.

When I test my WF template in SWDD, by manually triggering WF using F8 functionality, it works instantly. Also, once I confirm WF item from inbox, it takes a lot of time for my application to know that WF is completed.

Please help me to resolve these 2 issues.

Many Regards,

RAVI.

View Entire Topic
bpawanchand
Active Contributor
0 Kudos

CALL METHOD cl_swf_evt_event=>raise to raise

After raising the event have you written the statement COMMIT WORK. Please check and confirm

raviprakash
Advisor
Advisor
0 Kudos

Hi Pavan,

I have done a commit work after the statement as the Guide said its a pre requisite for triggering the WF using this method.

Regards,

Ravi.

bpawanchand
Active Contributor
0 Kudos

I think in the event linkage you might have enabled Enable Event Queue which is stated by SAP as below., PLease make sure that if this option is enabled then please uncheck it from the SWE2 txn

This indicator is only evaluated if the event queue is active. If the indicator is set, the event receiver
 is started via the event queue. If the indicator is not set or the event queue is not active,
 the receiver is started immediately.

raviprakash
Advisor
Advisor
0 Kudos

Hi Pavan,

When i removed the linkages flag the workflow is still not getting triggered as there is no receiver for it. I checked "Start Event" tab of my WF template and realized that now the "Triggering Event" got Deactivated. So whenever I uncheck the linkages flag using SWE2, my triggering event gets deactivated in WF defination template.

Many Thanks for the support,

Regards,

Ravi.

bpawanchand
Active Contributor
0 Kudos

Iam not asking you to uncheck the Event linkage , instead, ok let me give you an example,

Suppose

1. IN t he SWE2 txn you have a entry like

BOR OBject type ---> <BUSXXXX> -


><BUS-EVENTNAME> -


> WS9XXXXXXX ---> <Type linkage is Active> ---> <Enable EVENT QUEUE is active>

so what i want you to check is the last but one column should be deactivated if it is active , column name is Enable Event Queue

raviprakash
Advisor
Advisor
0 Kudos

Hi Pavan,

I checked the column and it is inactive (already unchecked state).

Regards,

Ravi.

martin_nooteboom
Active Contributor
0 Kudos

Did you start an event trace to see what happens with the event, and did you check the workflow log to see if there is anything strange there?

Regards,

Martin

narin_nandivada3
Active Contributor
0 Kudos

Hi Prakash,

Once debug the event triggering and check whats the output of return paramenters and by switching on the event trace parallely, with which we can know whether the event triggering taking time or workflow start.

Regards

Narin

raviprakash
Advisor
Advisor
0 Kudos

Hi Narin,

The event is triggered but the workflow starts very late. I checked the trace. In SWEL, I can see the event being raised the moment I trigger WF, but the WF is triggered very late. Also I ran the report RSWEQSRV, but still it doesnt help.

Regards,

Ravi.

narin_nandivada3
Active Contributor
0 Kudos

Hi Prakash,

Once check the entry in the table SWFDEVTYP where the field is QUEUE which is for event queue.

Confirm the value in it.

Regards

Narin

raviprakash
Advisor
Advisor
0 Kudos

Hi Narin,

The table shows entry for my Object:-

Category Object Type Event Receiver

CL /PLMB/CL_PROCESS_ROUTING_WF_BO START_WORKFLOW WS00100012

Receiver Function Module

SWW_WI_CREATE_VIA_EVENT_IBF

Many regards,

Ravi

narin_nandivada3
Active Contributor
0 Kudos

Hi

Check this table SWP_ADMIN (Presettings Workflow Runtime). If there is any instances lock then there is a wait time set in the field ENQCNT.

Or in SWDD tcode Environment -->Presettings Workflow Runtime.

Hope this helps.

Regards

Narin

raviprakash
Advisor
Advisor
0 Kudos

Hi Narin,

I think this might be an issue. I checked the table and I see a sigle entry with ENQCNT as 2. What does this mean?

Do i need to resent this? Also, how can I remove oinstance locks?

Regards,

Ravi.

raviprakash
Advisor
Advisor
0 Kudos

Hi Martin,

I checked these and everything looks fine to me.

Regards,

Ravi.

narin_nandivada3
Active Contributor
0 Kudos

If you want to delete the already processed or in ready state WF's or Workitem use SWWL.

Hope this helps

Former Member
0 Kudos

Hi Ravi,

when u check the event trace once again (receiver data). Is then an object key (workitem id) mentioned?

If yes check the WF with SWI1 and in which step the WF got stuck.

did u check also the requested start tab in our task?

Regards

Markus

raviprakash
Advisor
Advisor
0 Kudos

Hi Everyone,

I found the issue using the transaction SWI1. Here i saw the log of the stuck Work Item and found that at one step,

my object was checked for a lock. Since when i triggered my Workflow, the application was in Change Mode and

so, the Work Flow got stuck.

Later after 2 hours a background again RESUMES the workflow from where it was stuck and if no lock was there

it continues ahead.

Thanks a lot for all your support and guidance. Each one's input was valuable.

Regards,

Ravi.