AnsweredAssumed Answered

Custom Form Type Error

Question asked by fabiangambetta on May 23, 2017
Latest reply on May 24, 2017 by gdharley

Hi every one, I have a problem with custom types. I did it

 

package test;
import org.activiti.engine.form.AbstractFormType;

public class TextAreaFormType extends AbstractFormType {
public static final String TYPE_NAME = "textarea";
public String getName() {
return TYPE_NAME;
}

@Override
public Object convertFormValueToModelValue(String propertyValue) {
return propertyValue;
}

@Override
public String convertModelValueToFormValue(Object modelValue) {
return (String) modelValue;
}
}

 

package test;

import org.activiti.engine.form.FormProperty;
import org.activiti.explorer.Messages;
import org.activiti.explorer.ui.form.AbstractFormPropertyRenderer;

import com.vaadin.ui.Field;
import com.vaadin.ui.TextArea;

public class TextAreaFormPropertyRenderer extends AbstractFormPropertyRenderer {

public TextAreaFormPropertyRenderer() {
super(TextAreaFormType.class);
}
@Override
public Field getPropertyField(FormProperty formProperty) {
TextArea textArea = new TextArea(getPropertyLabel(formProperty));
textArea.setRequired(formProperty.isRequired());
textArea.setEnabled(formProperty.isWritable());
textArea.setRows(10);
textArea.setColumns(50);
textArea.setRequiredError(getMessage(
Messages.FORM_FIELD_REQUIRED,
getPropertyLabel(formProperty)));
if (formProperty.getValue() != null) {
textArea.setValue(formProperty.getValue());
}
return textArea;
}
}

 

 

 

In activiti.cfg.xml

<bean id="processEngineConfiguration" class="org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration">
<property name="customFormTypes">
<list>
      <bean class="test.TextAreaFormType"/>
</list>
</property>
<property name="jdbcUrl" value="@jdbc.url@" />
<property name="jdbcDriver" value="@jdbc.driver@" />
<property name="jdbcUsername" value="@jdbc.username@" />
<property name="jdbcPassword" value="@jdbc.password@" />

 

activiti-ui-context.xml

 

<!-- Custom form property renderers can be plugged in here -->
<bean id="formPropertyRendererManager" class="org.activiti.explorer.ui.form.FormPropertyRendererManager" lazy-init="true">
<!-- Default renderer -->
<property name="noTypePropertyRenderer">
<bean class="org.activiti.explorer.ui.form.StringFormPropertyRenderer" />
</property>
<!-- Renderers by property type -->
<property name="propertyRenderers">
<list>
<bean class="org.activiti.explorer.ui.form.StringFormPropertyRenderer" />
<bean class="org.activiti.explorer.ui.form.EnumFormPropertyRenderer" />
<bean class="org.activiti.explorer.ui.form.LongFormPropertyRenderer" />
<bean class="org.activiti.explorer.ui.form.DoubleFormPropertyRenderer" />
<bean class="org.activiti.explorer.ui.form.DateFormPropertyRenderer" />
<bean class="org.activiti.explorer.ui.form.UserFormPropertyRenderer" />
<bean class="org.activiti.explorer.ui.form.BooleanFormPropertyRenderer" />
<bean class="org.activiti.explorer.ui.form.ProcessDefinitionFormPropertyRenderer" />
<bean class="org.activiti.explorer.ui.form.MonthFormPropertyRenderer" />
<bean class="test.TextAreaFormPropertyRenderer" />
</list>
</property>
</bean>

 

In .bpmn

 

 

 

So, when I try to deploy my .bar I get this error

Outcomes