Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic Hook docs missing critical information #167

Open
odbuser2 opened this issue Jun 13, 2016 · 1 comment
Open

Dynamic Hook docs missing critical information #167

odbuser2 opened this issue Jun 13, 2016 · 1 comment
Assignees

Comments

@odbuser2
Copy link

odbuser2 commented Jun 13, 2016

The following page is missing critical information:
http://orientdb.com/docs/last/Dynamic-Hooks.html

Java static methods

Dynamic Hooks can call:

  • Functions, written in SQL, Javascript or any language supported by OrientDB and JVM
  • Java static methods
    There isn't any mention of how a dynamic hook can call a java static method.

Delete hook

A section should be added describing how to delete a hook. For example:

To delete a hook, set the event value to null
e.g. ALTER CLASS Invoice CUSTOM onAfterCreate=null

Variables available inside the hook

Add a description for all of the variables that are provided inside of a hook.
For example:

In a javascript hook, a var called "doc" is provided that represents the current document.

Describing a few common use cases would be helpful such

  1. Retrieving old vs new values of a doc
  2. Getting the correct OrientBaseGraph from the document

For example

var db = doc.getDatabase();
var orientBaseGraph =(db.getTransaction().isActive())
    ?new com.tinkerpop.blueprints.impls.orient.OrientGraph(db)
    :new com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx(db);
@odbuser2 odbuser2 changed the title Dynamic Hook calling java static methods Dynamic Hook docs missing critical information Jun 13, 2016
@santo-it santo-it self-assigned this Nov 25, 2016
@santo-it santo-it added this to the 2.2.x (next hotfix) milestone Dec 24, 2016
@fgnm
Copy link

fgnm commented Mar 23, 2020

Can these info be found somewhere? Are very critical.. I'm stuck just because lack of this documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants