Page 1 of 1

Document move automation

PostPosted:Mon May 23, 2016 10:26 am
by openkm_user
Hi,

I have created an Automation rule on Document creation, like with validation NameContains -> String:_default and action AddKeyword -> Keyword:default which works fine. But when I do the same on Document move, it doesn't work.

Only change is in the event (Document creation to Document move), what is wrong with this, please advice.

Thanks in advance!

Re: Document move automation

PostPosted:Sat May 28, 2016 8:38 am
by jllort
On each event are saved some data to be analyzed by validations ( data is not always the same, for example on move, a relevant data is where the document will be moved ).

If you take a look at dbDocumentModule.java are saved these data into the environment:
Code: Select all
Map<String, Object> env = new HashMap<String, Object>();
env.put(AutomationUtils.DOCUMENT_UUID, docUuid); // document uuid
env.put(AutomationUtils.FOLDER_UUID, dstUuid); // folder destination uuid
if you take a look at NameContains.java implementation it evaluates the node:
Code: Select all
Object node = AutomationUtils.getNode(env);
If you look into getNode(env) implementation you'll see you are evaluating the document name, not the folder name.

I suggest configure the OpenKM portable to follow the code https://sourceforge.net/projects/openkmportabledev/

On latest version we are having a table what indicates for each event which values are saved into the map, what makes more easy understanding what's happening on validation and action. Unfortunately this table is not present in version 6.3