on 05-27-2015 8:59 AM
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Any idea about this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.