hook doesn't work

81 views
Skip to first unread message

Juriy Ivanov

unread,
Feb 17, 2015, 6:00:43 AM2/17/15
to
Hi, I didn't execute a hook

example

CREATE CLASS Invoice EXTENDS OTriggered

ALTER CLASS Invoice CUSTOM onAfterCreate=invoiceCreated

CREATE CLASS test EXTENDS V

CREATE FUNCTION invoiceCreated "INSERT INTO test SET name='working'" LANGUAGE SQL

INSERT INTO Invoice CONTENT { number: 100, notes: 'This is a test' }


hook doesn't work

What is wrong?


when I run this example http://www.orientechnologies.com/docs/last/orientdb.wiki/Dynamic-Hooks.html

I receive an error

com.orientechnologies.orient.core.command.script.OCommandScriptException: Error on parsing script at position #0: Error on execution of the script Script: invoiceCreated ------^ --> javax.script.ScriptException: ReferenceError: "doc" is not defined in <eval> at line number 2 --> <eval>:2 ReferenceError: "doc" is not defined


Chandima Jayawickrema

unread,
Aug 27, 2015, 8:38:22 AM8/27/15
to OrientDB
I am having the same issue. Function is getting invoked, but "doc" is not provided in it seems. Please help..

user.w...@gmail.com

unread,
Aug 27, 2015, 11:27:00 AM8/27/15
to orient-...@googlegroups.com
Hi Juriy,Chandima,

Which version are you using?
Because I run this example http://www.orientechnologies.com/docs/last/orientdb.wiki/Dynamic-Hooks.html (V. 2.1) and it works.

Regards,
Michela

Chandima Jayawickrema

unread,
Aug 28, 2015, 12:37:32 AM8/28/15
to OrientDB
Hi Michela,

Thanks for the response.

I am using orientdb-community-2.0.3. Is there any workaround or patch for this version?

Chandima Jayawickrema

unread,
Aug 28, 2015, 12:46:43 AM8/28/15
to OrientDB
Just tried this out in 2.1 and it worked. Looks like it's a bug in the previous version of orientdb.
Reply all
Reply to author
Forward
0 new messages