Servoy 6.1: How to move functions to entity scopes?

Hi all,

I have a project with about 100 tables, many of them have table events so the globals script is huge.
I’m trying to work out how to move these event handlers into the entity scopes of the tables…

Any ideas how to do this?

(If I pretend to create a method in the entity scope, so I can access it. Then copy and paste methods from the globals scope, Servoy freezes)…

Christian,

If you copy/past methods from 1 file into another you get loads of duplicate UUID problems.

Try cut from globals file, save global file (Servoy will remove the objects from memory) and then paste in table scope file.

Does Developer really freeze or is it just very busy with these duplicates?
Have a look at the thread dump from the admin page when Developer seems to hang.

Rob

Hi Rob,

I tend to copy one method at the time. It seems to crash, as it is completely dead afterwards.
My workaround is to copy from globals, paste into entity file, then remove the UUID, save. This generated a new UUID in the entity file. Then I cut the method from globals and save. Afterwards I have to relink the method. Very cumbersome.

It would make a lot of sense to have a ‘move’ method on the contextual menu when you view the list of methods inside a scope like globals.

Christian,

Does it really hang, or it it just very busy for some time?
I just tried it in a small workspace and that worked fine.
I copied 3 functions from globals.js and pasted them in mytab_entity,js; on save the duplicate UUIDs were overwritten by new ones immediately.

Can you try the same in a small workspace?

When you see the hanging, can you create a thread dump from the admin page? http://localhost:8080/servoy-admin/dumpstack

Btw, cut+save of functions in globals.js before saving in mytab_entity,js will keep the existing UUIDs which may help because event handlers are re-pointed to the new location automatically.

Rob