I'm kind of new to the Activiti 6 app tool, please help.
I created a process model just fine, i was able to deploy it and test at my database with the framework.
But i noticied that the export process model, won't export the forms i selected at "Reference form" and/or "form key" attribute.
I'm only did through Apps function, which won't be of much use.
I'll be using external rendering, so how can i export forms as well ?
Can I do it by code ?
Thanks
Solved! Go to Solution.
Ok, I found out what I needed and gonna post it here for future reference.
To recover from database the reusable forms you need to use FormEngineConfiguration and create the FormEngine.
First add activiti-form-engine classes:
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-form-engine</artifactId>
<version>6.0.0</version>
</dependency>
You have to setup "formEngineConfiguration" at cfg.xml file like this:
<bean id="formEngineConfiguration" class="org.activiti.form.engine.impl.cfg.StandaloneFormEngineConfiguration">
<property name="jdbcUrl" value="@jdbc.url@" />
<property name="jdbcDriver" value="@jdbc.driver@" />
<property name="jdbcUsername" value="@jdbc.username@" />
<property name="jdbcPassword" value="@jdbc.password@" />
<property name="databaseSchema" value="@jdbc.schema@" />
</bean>
And use it like this:
FormEngine formEngine = FormEngineConfiguration.createFormEngineConfigurationFromResource("activiti.cfg.xml").buildFormEngine();
formEngine.getFormRepositoryService().getFormDefinitionByKey("formKey");
With formEngine you can get FormDefinition and his FormFields and Outcomes.
Thanks Joseph for your help !!
The forms are useful only if you are using the Apps layer in Activiti 6. If you are doing external rendering, why do you need to export the forms unless you trying to implement the form rendering logic in your application based on your form model in Activiti 6?
If you need to export the json form model, create an app and export the app. The app.zip will have the form models as well.
The problem is everyone loved the form editor, so if we could use it, them get the list of fields like TaskFormData and dynamically generate it inside our existing system.
Is there anyway to use the Form Editor like that ?
ok, I thought you were looking to use an external form in your application. If you are looking to render the form that you model in Activiti 6 in your application, you will have to implement that logic in your application.
I think that all the UI logic behind the runtime form rendering is present in Activiti/modules/activiti-ui/activiti-app/src/main/webapp/workflow at activiti-6.0.0 · Activiti/Acti.... You can either copy this directory into your application and make it work if you are using AngularJS for your application or implement similar logic by yourselves using the form & task APIs.
Btw, if you are using or planning to use the enterprise version of Activiti (Alfresco Process Services), you get more advanced form building features and also a framework called Application Development Framework (based on Angular 5 now) for rapidly developing custom UI applications.
Hope this helps
Cheers,
Ciju
Ok, I found out what I needed and gonna post it here for future reference.
To recover from database the reusable forms you need to use FormEngineConfiguration and create the FormEngine.
First add activiti-form-engine classes:
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-form-engine</artifactId>
<version>6.0.0</version>
</dependency>
You have to setup "formEngineConfiguration" at cfg.xml file like this:
<bean id="formEngineConfiguration" class="org.activiti.form.engine.impl.cfg.StandaloneFormEngineConfiguration">
<property name="jdbcUrl" value="@jdbc.url@" />
<property name="jdbcDriver" value="@jdbc.driver@" />
<property name="jdbcUsername" value="@jdbc.username@" />
<property name="jdbcPassword" value="@jdbc.password@" />
<property name="databaseSchema" value="@jdbc.schema@" />
</bean>
And use it like this:
FormEngine formEngine = FormEngineConfiguration.createFormEngineConfigurationFromResource("activiti.cfg.xml").buildFormEngine();
formEngine.getFormRepositoryService().getFormDefinitionByKey("formKey");
With formEngine you can get FormDefinition and his FormFields and Outcomes.
Thanks Joseph for your help !!
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.