Page 1 of 1

Automation

PostPosted:Wed Feb 12, 2014 12:32 pm
by hbuus
I'm trying to follow these instructions from the page below in order to enable automation in the latest Community-version of OpenKM:
http://wiki.openkm.com/index.php/Enable_automation

Here's what it says on the page above:

OpenKM community version

Available validations:
PathContains
Available actions:
ExecuteScripting
Enable automation validation
Go to Administration > Database query section and execute:
INSERT INTO OKM_AUTO_METADATA (AMD_AT, AMD_CLASS_NAME, AMD_NAME, AMD_GROUP, AMD_TYPE00, AMD_SRC00, AMD_DESC00, AMD_TYPE01, AMD_SRC01, AMD_DESC01 ) VALUES ('post','com.openkm.automation.validation.PathContains', 'PathContains', 'validation', 'text', 'okm:folder', 'String', '', '', '');
Enable automation actions
Go to Administration > Database query section and execute:
INSERT INTO OKM_AUTO_METADATA (AMD_AT, AMD_CLASS_NAME, AMD_NAME, AMD_GROUP, AMD_TYPE00, AMD_SRC00, AMD_DESC00, AMD_TYPE01, AMD_SRC01, AMD_DESC01 ) VALUES ('post','com.openkm.automation.action.ExecuteScripting', 'ExecuteScripting', 'action', 'textarea', '', 'Script', '', '', '');


However I get an error message when I go to the Database query section and try to execute the first of the two lines above.
Attached is a screenshot which shows the error message in red.

Can anyone see what I'm doing wrong?

I love OpenKM so far. What an advanced and smart program!! :)

Thanks!

Best,
Henrik

Re: Automation

PostPosted:Fri Feb 14, 2014 8:41 am
by jllort
Add columns AMD_ID, with value 1 etc... depending the database sql could have minimal changes.

Do table select OKM_AUTO_METADATA to see all table columns.

Re: Automation

PostPosted:Mon Feb 17, 2014 8:52 am
by hbuus
Thanks for looking at this - I must have made a mistake before, because now it works!

I do this:

1. Copy line 1, goto Administration->Database query, insert as text, do not press enter after text, choose Hibernate, click Execute SQL Script.
2. Copy line 2, and follow the steps in 1.

It works! Automation is now turned on :)

Re: Automation

PostPosted:Mon Feb 17, 2014 8:56 am
by hbuus
Ok, I was too quick to rejoice before - Automation is indeed turned on, but I can't define any rules.

If you look at the screenshot I've attached, there is nothing to choose from the two drop-down menus Add validation and Add action.

How can that be?

PS. I defined an automation rule and named it Add Property Group.
It is set as Active.
It is when I click on this automation rule's definition that the screenshot comes up and I can't select anything from the drop-down menu there.

Re: Automation

PostPosted:Mon Feb 17, 2014 9:03 am
by hbuus
Here's a screenshot from when I do a Do table select as you wrote I should do.

Re: Automation

PostPosted:Mon Feb 17, 2014 1:46 pm
by hbuus
I tried various things and found out I have to select "JDBC" from the drop-down menu Type, and then choose OKM_AUTO_METADATA from the drop-down menu Tables. Then replace the text that comes automatically with the INSERT lines from the documentation.

After doing that, I get the following (see screenshot).

But automation still doesn't work, i.e. when I click on Definition on the automation rule I've made, I can't select anything from the drop-down menus Add Validation and Add action.

Argh! :)

Re: Automation

PostPosted:Mon Feb 17, 2014 1:57 pm
by hbuus
I get this error when trying to send the INSERT-line as described in this screenshot (see attachment).

Thank you for looking at this, I appreciate the help!

Re: Automation

PostPosted:Wed Feb 19, 2014 11:56 am
by jllort
Be sure you're selecting in creation the option "post" not "pre" I think that could be the cause of the problem you got.

Re: Automation

PostPosted:Wed Feb 19, 2014 2:59 pm
by hbuus
I changed pre to post and then went into Administration->Automation, and clicked on Definition for my automation rule.
Yes, now two options emerge from the drop-down menus:
PathContains in the validation drop-down menu, and
ExecuteScripting in the action drop-down menu.

Remembering that I executed the following two lines in the Database query section:
Code: Select all
INSERT INTO OKM_AUTO_METADATA (AMD_AT, AMD_CLASS_NAME, AMD_NAME, AMD_GROUP, AMD_TYPE00, AMD_SRC00, AMD_DESC00, AMD_TYPE01, AMD_SRC01, AMD_DESC01 ) VALUES ('post','com.openkm.automation.validation.PathContains', 'PathContains', 'validation', 'text', 'okm:folder', 'String', '', '', '');

INSERT INTO OKM_AUTO_METADATA (AMD_AT, AMD_CLASS_NAME, AMD_NAME, AMD_GROUP, AMD_TYPE00, AMD_SRC00, AMD_DESC00, AMD_TYPE01, AMD_SRC01, AMD_DESC01 ) VALUES ('post','com.openkm.automation.action.ExecuteScripting', 'ExecuteScripting', 'action', 'textarea', '', 'Script', '', '', '');
- I thought to myself: What if I actually have to execute all these lines, as described in the Wiki:
Code: Select all
INSERT INTO OKM_AUTO_METADATA (AMD_AT, AMD_CLASS_NAME, AMD_NAME, AMD_GROUP, AMD_TYPE00, AMD_SRC00, AMD_DESC00, AMD_TYPE01, AMD_SRC01, AMD_DESC01) VALUES ('post', 'com.openkm.automation.action.AddKeyword', 'AddKeyword', 'action', 'text', '', 'Keyword', '', '', '');
INSERT INTO OKM_AUTO_METADATA (AMD_AT, AMD_CLASS_NAME, AMD_NAME, AMD_GROUP, AMD_TYPE00, AMD_SRC00, AMD_DESC00, AMD_TYPE01, AMD_SRC01, AMD_DESC01) VALUES ('post', 'com.openkm.automation.action.AddCategory', 'AddCategory', 'action', 'text', 'okm:folder', 'Category', '', '', '');
INSERT INTO OKM_AUTO_METADATA (AMD_AT, AMD_CLASS_NAME, AMD_NAME, AMD_GROUP, AMD_TYPE00, AMD_SRC00, AMD_DESC00, AMD_TYPE01, AMD_SRC01, AMD_DESC01) VALUES ('pre', 'com.openkm.automation.action.AddCategoryToWizard', 'AddCategoryToWizard', 'action', '', '', '', '', '', '');
INSERT INTO OKM_AUTO_METADATA (AMD_AT, AMD_CLASS_NAME, AMD_NAME, AMD_GROUP, AMD_TYPE00, AMD_SRC00, AMD_DESC00, AMD_TYPE01, AMD_SRC01, AMD_DESC01) VALUES ('post', 'com.openkm.automation.action.AddCategoryToWizard', 'AddCategoryToWizard', 'action', '', '', '', '', '', '');
INSERT INTO OKM_AUTO_METADATA (AMD_AT, AMD_CLASS_NAME, AMD_NAME, AMD_GROUP, AMD_TYPE00, AMD_SRC00, AMD_DESC00, AMD_TYPE01, AMD_SRC01, AMD_DESC01) VALUES ('pre', 'com.openkm.automation.action.AddKeywordToWizard', 'AddKeywordToWizard', 'action', '', '', '', '', '', '');
INSERT INTO OKM_AUTO_METADATA (AMD_AT, AMD_CLASS_NAME, AMD_NAME, AMD_GROUP, AMD_TYPE00, AMD_SRC00, AMD_DESC00, AMD_TYPE01, AMD_SRC01, AMD_DESC01) VALUES ('post', 'com.openkm.automation.action.AddKeywordToWizard', 'AddKeywordToWizard', 'action', '', '', '', '', '', '');
INSERT INTO OKM_AUTO_METADATA (AMD_AT, AMD_CLASS_NAME, AMD_NAME, AMD_GROUP, AMD_TYPE00, AMD_SRC00, AMD_DESC00, AMD_TYPE01, AMD_SRC01, AMD_DESC01) VALUES ('post', 'com.openkm.automation.action.AddPropertyGroupToWizard', 'AddPropertyGroupToWizard', 'action', 'text', '', 'Property group', '', '', '');
INSERT INTO OKM_AUTO_METADATA (AMD_AT, AMD_CLASS_NAME, AMD_NAME, AMD_GROUP, AMD_TYPE00, AMD_SRC00, AMD_DESC00, AMD_TYPE01, AMD_SRC01, AMD_DESC01) VALUES ('post', 'com.openkm.automation.action.GrantRole', 'GrantRole', 'action', 'text', '', 'Role name', 'integer', '', 'Privileges');
INSERT INTO OKM_AUTO_METADATA (AMD_AT, AMD_CLASS_NAME, AMD_NAME, AMD_GROUP, AMD_TYPE00, AMD_SRC00, AMD_DESC00, AMD_TYPE01, AMD_SRC01, AMD_DESC01) VALUES ('post', 'com.openkm.automation.action.GrantUser', 'GrantUser', 'action', 'text', '', 'User name', 'integer', '', 'Privileges');
INSERT INTO OKM_AUTO_METADATA (AMD_AT, AMD_CLASS_NAME, AMD_NAME, AMD_GROUP, AMD_TYPE00, AMD_SRC00, AMD_DESC00, AMD_TYPE01, AMD_SRC01, AMD_DESC01) VALUES ('post', 'com.openkm.automation.action.RevokeRole', 'RevokeRole', 'action', 'text', '', 'Role name', 'integer', '', 'Privileges');
INSERT INTO OKM_AUTO_METADATA (AMD_AT, AMD_CLASS_NAME, AMD_NAME, AMD_GROUP, AMD_TYPE00, AMD_SRC00, AMD_DESC00, AMD_TYPE01, AMD_SRC01, AMD_DESC01) VALUES ('post', 'com.openkm.automation.action.RevokeUser', 'RevokeUser', 'action', 'text', '', 'User name', 'integer', '', 'Privileges');
INSERT INTO OKM_AUTO_METADATA (AMD_AT, AMD_CLASS_NAME, AMD_NAME, AMD_GROUP, AMD_TYPE00, AMD_SRC00, AMD_DESC00, AMD_TYPE01, AMD_SRC01, AMD_DESC01) VALUES ('post', 'com.openkm.automation.action.RevokeKeyword', 'RevokeKeyword', 'action', 'text', '', 'Keyword', '', '', '');
INSERT INTO OKM_AUTO_METADATA (AMD_AT, AMD_CLASS_NAME, AMD_NAME, AMD_GROUP, AMD_TYPE00, AMD_SRC00, AMD_DESC00, AMD_TYPE01, AMD_SRC01, AMD_DESC01) VALUES ('post', 'com.openkm.automation.action.RevokeCategory', 'RevokeCategory', 'action', 'text', 'okm:folder', 'Category', '', '', '');
INSERT INTO OKM_AUTO_METADATA (AMD_AT, AMD_CLASS_NAME, AMD_NAME, AMD_GROUP, AMD_TYPE00, AMD_SRC00, AMD_DESC00, AMD_TYPE01, AMD_SRC01, AMD_DESC01) VALUES ('post', 'com.openkm.automation.action.AddWorkflowToWizard', 'AddWorkflowToWizard', 'action', 'text', '', 'Workflow', '', '', '');
INSERT INTO OKM_AUTO_METADATA (AMD_AT, AMD_CLASS_NAME, AMD_NAME, AMD_GROUP, AMD_TYPE00, AMD_SRC00, AMD_DESC00, AMD_TYPE01, AMD_SRC01, AMD_DESC01) VALUES ('post', 'com.openkm.automation.action.AddDigitalSignatureToWizard', 'AddDigitalSignatureToWizard', 'action', '', '', '', '', '', '');
INSERT INTO OKM_AUTO_METADATA (AMD_AT, AMD_CLASS_NAME, AMD_NAME, AMD_GROUP, AMD_TYPE00, AMD_SRC00, AMD_DESC00, AMD_TYPE01, AMD_SRC01, AMD_DESC01) VALUES ('post', 'com.openkm.automation.action.SetTextExtracted', 'SetTextExtracted', 'action', 'text', '', 'Text', '', '', '');
INSERT INTO OKM_AUTO_METADATA (AMD_AT, AMD_CLASS_NAME, AMD_NAME, AMD_GROUP, AMD_TYPE00, AMD_SRC00, AMD_DESC00, AMD_TYPE01, AMD_SRC01, AMD_DESC01) VALUES ('post', 'com.openkm.automation.action.RevokeAllRoles', 'RevokeAllRoles', 'action', 'boolean', '', 'Recursive', '', '', '');
INSERT INTO OKM_AUTO_METADATA (AMD_AT, AMD_CLASS_NAME, AMD_NAME, AMD_GROUP, AMD_TYPE00, AMD_SRC00, AMD_DESC00, AMD_TYPE01, AMD_SRC01, AMD_DESC01) VALUES ('post', 'com.openkm.automation.action.RevokeAllUsers', 'RevokeAllUsers', 'action', 'boolean', '', 'Recursive', 'boolean', '', 'Preserve creator');
INSERT INTO OKM_AUTO_METADATA (AMD_AT, AMD_CLASS_NAME, AMD_NAME, AMD_GROUP, AMD_TYPE00, AMD_SRC00, AMD_DESC00, AMD_TYPE01, AMD_SRC01, AMD_DESC01) VALUES ('pre', 'com.openkm.automation.action.ExecuteScripting', 'ExecuteScripting', 'action', 'code', '', 'Script', '', '', '');
INSERT INTO OKM_AUTO_METADATA (AMD_AT, AMD_CLASS_NAME, AMD_NAME, AMD_GROUP, AMD_TYPE00, AMD_SRC00, AMD_DESC00, AMD_TYPE01, AMD_SRC01, AMD_DESC01) VALUES ('post', 'com.openkm.automation.action.ExecuteScripting', 'ExecuteScripting', 'action', 'code', '', 'Script', '', '', '');
INSERT INTO OKM_AUTO_METADATA (AMD_AT, AMD_CLASS_NAME, AMD_NAME, AMD_GROUP, AMD_TYPE00, AMD_SRC00, AMD_DESC00, AMD_TYPE01, AMD_SRC01, AMD_DESC01, AMD_TYPE02, AMD_SRC02, AMD_DESC02) VALUES ('post', 'com.openkm.automation.action.SendMail', 'SendMail', 'action', 'textarea', '', 'Message', 'user', '', 'Users', 'role', '', 'Roles');
I tried executing those lines in the Database query-section and got an error message for each line.
When do a Select from AUTO_META_DATA, I get this screen:
OpenKM Select from OKM_AUTO_METADATA.jpg
OpenKM Select from OKM_AUTO_METADATA.jpg (364.47 KiB) Viewed 5170 times
Sure enough, when I go to Administration->Automation and click on Definition for my automation rule, now all options in the Action drop-down menu are available to me.

I pick AddPropertyGroupToWizard and enter the name of my property group, which is Info.
Then I go out into Desktop and add a document.
However instead of getting the Add Property Group Wizard, I get this error message:
OpenKM Error add property group.jpg
OpenKM Error add property group.jpg (210.81 KiB) Viewed 5170 times
Can you see what I'm doing wrong?

I hope my explanation is understandable, otherwise please just ask, I will try to explain it better.
I really hope you can help!

Thanks.

Re: Automation

PostPosted:Thu Feb 20, 2014 3:35 pm
by jllort
Almost inserts you've executed are for professional version if you read here for community version are only two insersts:
http://wiki.openkm.com/index.php/Enable ... ty_version

Anyway you can extend it easily http://wiki.openkm.com/index.php/Extend_automation

Re: Automation

PostPosted:Fri Feb 21, 2014 8:57 am
by hbuus
Ok! Thanks for all the help :)