cancel
Showing results for 
Search instead for 
Did you mean: 

OnDropFile Event Handler in ExcelImport

Former Member
0 Kudos

Hi All,

I just noticed "OnDropFile" Event Handler belongs to "BasePackage" metaclass in ExcelImport extension.

It has custom parameters instead of common "obj".

When I try to add this event handler in a new extension, it seems that there isn't such event handler.

Then how and when does it work? How can we create and use such event handlers?

Thanks & Regards

Mehmet

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

1) This is a bug. Open ticket at SAP.

2) Workaround

  a) In ExcelImport.xem You can see SAP has defined Event Handler - OnDropFile. BUT this Category is not available. You can't create OnDropFile handler.

b) Workaround create a new extension, example : named EXTENDEDDEFINITION_1, and click on upper right on the button Import Items

  

c) Select ExcelImport.xem

d) Select BasePackage item to merge into your new extension

e) The result. You obtain the same thing vs ExcelImport into your Extension.

Note : Your evaluation of my answer would be appreciated - Examples choices are Correct, Helpful answer.



Also : From MetaModel Objets Help


Under BaseObject=>IdentifiedObject=>ExtensibleObject=>NamedObject=>BaseFolder

The BaseFolder class is the common class for all container objects. A folder contains other objects and diagrams. This class is specialized into Model, Package and composite objects that behave like a specialized package when they are decomposed. Examples of composite objects are process, activity, class...

OnDropFile is a Method

Under PdCommon . BaseFolder Packages you will find

OnDropFile(ByVal Filename As String) As BaseObject

  Executes the same action as if a file was dropped from the file system into this folder. By default it creates a file object under the folder.

For your information : PdCommon - contains all objects shared between two or more models, and the abstract classes of the model. For example, business rules, which are available in all models, and the BaseObject class, from which all model objects are derived, are defined in this package. Other model packages are linked to PdCommon by generalization links indicating that each model inherits common objects from the PdCommon package.


Former Member
0 Kudos

Hi Benoit,

Thank you for your detailed answer. I believe this is a bug, otherwise we would have ability to create our own custom event handlers.

For a moment I thought we're really able to do it Having a "Before & After Check-in", "Before & After Check-out" would be good.

Best regards,

Answers (1)

Answers (1)

Former Member
0 Kudos

Any idea about this?

former_member200945
Contributor
0 Kudos

A good place to find how event handler works is in DBMS file.

For example, in SQL Server 2014 DBMS, some event handler uses obj, other  does not.

Expand Profile->Model->Event Handlers, you can see all items do not use obj

Expand Profile->Key->Event Handlers, this one uses obj.

Run some experiment, you can get idea when obj should be used.

Former Member
0 Kudos

Hi Phillip,

thank you for your reply.

My question is more about how to create "OnDropFile" event handler. It's not listed when adding a new event handler in "BasePackage" metaclass.

In the ExcelImport extension "OnDropFile" event handler is used, but I'm not able to add this into my own extension.