• Automation not work - need help

  • OpenKM has many interesting features, but requires some configuration process to show its full potential.
OpenKM has many interesting features, but requires some configuration process to show its full potential.
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.
 #40027  by skorpion78
 
hello,
I wanted to create a task which, after a document is created in the directory will automatically assign property groups. Unfortunately, I failed.
I made the following steps:
1.) I made this tutorial http://wiki.openkm.com/index.php/Enable_automation

2.) I added task automation addProperityGroup
pic. 1.png and 2.png
not working :(

3.) I made this tutorial:

http://wiki.openkm.com/index.php/Increm ... utonumeric
continue after the creation of the document does not produce jobs.


thank you in advance for your answer

greetings
Sebastian
Attachments
1.PNG
1.PNG (15.71 KiB) Viewed 2587 times
2.PNG
2.PNG (3.78 KiB) Viewed 2587 times
 #40028  by skorpion78
 
hello again ,

I do not know what I did but had started to work.

Unfortunately, I do not know how to add a group with specific properties. I am using a script :
Code: Select all
import com.openkm.bean.Document;
import com.openkm.module.db.stuff.DbSessionManager;
import com.openkm.api.OKMDocument;
import com.openkm.api.OKMRepository;
import com.openkm.omr.OMRHelper;
 
long omId= 4;
String systemToken = DbSessionManager.getInstance().getSystemToken();
String docPath = OKMRepository.getInstance().getNodePath(systemToken, uuid);
Document doc = OKMDocument.getInstance().getProperties(systemToken, docPath);
 
if (OMRHelper.isValid(doc)) {
    OMRHelper.processAndStoreMetadata(omId, uuid);	
}
Does anyone can help me how to assign the appropriate values ​​form groups .

properties of the group :
Code: Select all
<property-group label="Technology" name="okg:technology">
    <select label="Type" name="okp:technology.type" type="multiple">
      <option label="Alfa" value="t1"/>
      <option label="Beta" value="t2" />
      <option label="Omega" value="t3" />
    </select>
    <select label="Language" name="okp:technology.language" type="simple">
      <option label="Java" value="java"/>
      <option label="Python" value="python"/>
      <option label="PHP" value="php" />
    </select>
    <input label="Comment" name="okp:technology.comment"/>
    <textarea label="Description" name="okp:technology.description"/>
    <input label="Link" type="link" name="okp:technology.link"/>
  </property-group>
 #40037  by jllort
 
After you create a class that implements Automation ( http://wiki.openkm.com/index.php/Extend_automation_6.0 ), you should register this class in database. Unfortunatelly only on professional version we've yet implemented the automation based on plugins ( jars ), in version 6.3 and older the classes must be registered in database.

Take a look for example this insert query:
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.AddCategoryToWizard', 'AddCategoryToWizard', 'action', '', '', '', '', '', '');
post indicate the action can only be executed after the event.
com.openkm.automation.action.AddCategoryToWizard the class name
AddCategoryToWizard the name shown in automation list
action indicate is an action
The other fields are used to indicate will be required parameters from Automation view ( in your case I think will be blank like this ones ).

Take a look at this two classes:
https://sourceforge.net/p/openkm/code/H ... izard.java
https://sourceforge.net/p/openkm/code/H ... egory.java

Also could be interesting take a look at this class https://sourceforge.net/p/openkm/code/H ... Utils.java

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.