cancel
Showing results for 
Search instead for 
Did you mean: 

use abap class event as terminating event

ross_goodman
Participant
0 Kudos

Hi,

The class is say ZCL_WF_CLASS and the event END_WF.

What needs to be done to have this event used correctly as a terminating event of a workflow? Does this event require a parameter to hold the workitem id (or workflow id), as currently this event has no parameters?

Previous developer has developed the class and event and installed as a terminating event but the workflow is going into error not terminating correctly. I believe the incorrect development of the event and/or its use in the workflow is the issue. Note that nowhere is this event currently raised in any code of the workflow.

Cheers,

Ross

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member185167
Active Contributor
0 Kudos

Hello,

Unless I'm mistaken, a terminating event for a workflow is just like any wait-for event in a workflow.

It can be based on any object or class and it can be used in various ways - to terminate a branch or terminate the workflow, for example.

The workflow listens out for the event and checks if there is a matching key. You could base it on the key of a workflow object but it makes more sense to base it on an object or class that's used in the workflow - e.g. the POSTED event of an object would be used to terminate a workflow seeking approval for the posting of an object.

It definitely won't work if the event has no parameters. I guess if you do base it on the workflow object then you would use the top-level workitem id. Try it with a test workflow and SWUE to generate the event.

regards

Rick Bakker

hanabi technology

ross_goodman
Participant
0 Kudos

Hi Rick,

I just got to this blog by Jocelyn Dart that is excellent. It states that the terminating workflow doesn't need any parameters as this is supplied automatically in the raising detail of the event! Will give it a try and see how I go.

/people/jocelyn.dart/blog/2006/07/27/raising-abap-oo-events-for-workflow

Ross

former_member185167
Active Contributor
0 Kudos

Hi Ross,

"It states that the terminating workflow doesn't need any parameters as this is supplied automatically in the raising detail of the event!"

Could you quote that part, I didn't see it. I also don't see how that could work!

regards

Rick Bakker

hanabi technology

pokrakam
Active Contributor
0 Kudos

> "It states that the terminating workflow doesn't need any parameters as this is supplied automatically in the raising detail of the event!"

>

> Could you quote that part, I didn't see it. I also don't see how that could work!

Hi Rick,

I'm sure you know this already, but sometimes we miss the obvious: If the event is an instance event it will include the object key, which is all that's needed for an instance linkage. No parameters are needed, event parameters are purely for additional information.

Regards,

Mike

former_member185167
Active Contributor
0 Kudos

Thanks Mike, I'll double-check the terminology. What I consider "parameters" may be different from SAP's usage.

It makes sense, the key would always be passed.