[Custom field type] Cannot add field to the form
brunoais Mar 14, 2014 7:33 AMNote: this is a followup to: Creating a custom Field: org.jbpm.formModeler Cannot be resolved to a type
After having the Holder class I worked on adding it to jBPM.
After searching and trying for hours I found out that there's no such thing a classpath in jBPM. Instead it uses a modules system. Anyway, I placed the required files in the correct places and I made the .index and the module.xml by using the h2 module and the getopt-1.0.13 as models to copy from.
After doing that, the form modeler wasn't recognizing the fields that I was making of the type of the class that I was making.
Only 3 methods have shown to possibly work:
- Compile the .java and place it into a .jar by using the method described below (with the respective .index and module.xml)
- Add the .java to the project in the correct place according to its full name.
- Both of above.
For 1st, I made a .jar and placed in pt.example.service_test.Holder ([...]jboss-as-7.1.1.Final/modules/pt/example/service_test/Holder.jar) with the respective .index and module.xml
.index:
pt.example.service_test.Holder
META-INF/manifest.mf
module.xml
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="Holder">
<resources>
<resource-root path="Holder.jar"/>
</resources>
<dependencies>
</dependencies>
</module>
Also, there are no references to it in the logs.
For the 2nd, I just pulled, added the files that I placed in:
src/main/java/pt/example/service_test/Holder.java
(you already know the 3rd).
Results:
The 1st gave no visible changes.
For the 2nd and 3rd, the only visible change was that in the form modeler in the section of the form to add a new form origin. After selecting "From Data Model", below "Info:", the full class name was appearing in the selectbox.
Either way. I was always able to use the "From Java Class" and fill in the full class name manually (pt.example.service_test.Holder).
Main problem:
When I change the tab to "Add fields by origin" the fields that I created in the form origin are not appearing in the list created here. Same happens if I try to use the WYSIWYG editor (CKE). The selectboxes below it appear without that element (the java basic types still appear, though). What am I doing wrong?