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

Do you want to create a native client or integrate with third party applications: webservices are the solution.
Forum rules
Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
Post Reply
vrecalde
Fresh Boarder
Fresh Boarder
Posts: 6
Joined: Thu Aug 16, 2018 8:22 pm

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

Post by vrecalde » Fri Sep 07, 2018 8:28 pm

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.

jllort
Moderator
Moderator
Posts: 10243
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

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

Post by jllort » Sat Sep 08, 2018 9:01 am

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

vrecalde
Fresh Boarder
Fresh Boarder
Posts: 6
Joined: Thu Aug 16, 2018 8:22 pm

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

Post by vrecalde » Mon Sep 10, 2018 1:23 pm

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.

jllort
Moderator
Moderator
Posts: 10243
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

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

Post by jllort » Thu Sep 13, 2018 6:40 am

- 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

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest