Page 1 of 1

Can I run an automation from workflow's submit button?

PostPosted:Fri Sep 07, 2018 8:28 pm
by vrecalde
Hello to all. I've been searching for a solution in docs and forums but I didn't find it. I would like to run an automation (move a directory and its files) from a work-flow submit button. Do I have to make code for this? Is there a predefined script that helps me with it? It is very important because I have to approve some process making click in a submit button, the process is an automation that moves the directory under another Dir. Now this process is activating after insert meta-data in a directory, but, people here don't approved that, because they have to go to the workflow screen and they have to make click, again ,in a submit button, so workflow can go on. If I can run this proccess (move the directory to another dir) making click on workflow's button, this would be perfect. If someone knows something about it, I will appreciate it very much if share the knowledge. Thank you very much.

Re: Can I run an automation from workflow's submit button?

PostPosted:Sat Sep 08, 2018 9:01 am
by jllort
Automation works based in listening events. For doing it the easiest way for doing it is:
1- Add metadata ( property group ) with status field.

2- Create and automation listening set metadata ( set property group ) -> check if the node have the property group and in case you have it, evaluate the field
https://docs.openkm.com/kcenter/view/ok ... ition.html
https://docs.openkm.com/kcenter/view/ok ... tiesSimple
https://docs.openkm.com/kcenter/view/ok ... ation.html
https://docs.openkm.com/kcenter/view/ok ... ction.html
https://docs.openkm.com/kcenter/view/ok ... ingFolders

3- From the workflow into ActionHandler set the metadata what will fire the action

Re: Can I run an automation from workflow's submit button?

PostPosted:Mon Sep 10, 2018 1:23 pm
by vrecalde
Thanks for the answer. I tried to make a form to add metadata in forms.xml, but it doest not support the syntax, the following error is thrown:
ERROR com.openkm.util.FormUtils - Element type "property-group" must be declared.
Do I have to create traditional inputs and then catch them in the java class ActionHandler? If I do this way, how could I know what directory do I have to set metadata? Because that directory is a new one, I could not know the uuid of it.
The workflow is activated when I create a new directory under a specific directory name, and I have to set metadata to this new directory.

Re: Can I run an automation from workflow's submit button?

PostPosted:Thu Sep 13, 2018 6:40 am
by jllort
- Into each worlflow is stored the node UUID ( take a look into context variables )
- Here workflow elements https://docs.openkm.com/kcenter/view/ok ... ition.html