AnsweredAssumed Answered

Incompatible type set on field declaration

Question asked by jmsoo on Mar 30, 2018

it use ExecutionListener

this is my bpmn  

<userTask id="userTask1522390356359" name="人工任务">
<extensionElements>
<activiti:executionListener event="start" class="jehc.zxmodules.service.impl.StartOrderSalesEvent">
<activiti:field name="language">
<activiti:string>aa</activiti:string>
</activiti:field>
</activiti:executionListener>
</extensionElements>
</userTask>

 

 

 

this is my java code

 

package jehc.zxmodules.service.impl;

import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.ExecutionListener;

public class StartOrderSalesEvent implements ExecutionListener{
private String language;
@Override
public void notify(DelegateExecution arg0) throws Exception {
// TODO Auto-generated method stub
System.out.println("1");

}

}

 

this is the wrong warning:

DEBUG org.springframework.web.servlet.DispatcherServlet [http-bio-80-exec-4]: [appid => -] ## 'Handler execution resulted in exception -
forwarding to resolved error view: ModelAndView: materialized View is [com.alibaba.fastjson.support.spring.FastJsonJsonView: unnamed];
model is null' 'jehc.xtmodules.xtcore.util.ExceptionUtil:
Incompatible type set on field declaration 'language' for class jehc.zxmodules.service.impl.StartOrderSalesEvent.
Declared value has type org.activiti.engine.impl.el.FixedValue, while expecting java.lang.String
at jehc.lcmodules.activitiutil.ActivitiUtil.completeTask(ActivitiUtil.java:377)
at jehc.zxmodules.web.ZttOrderController.approvalOrderApply(ZttOrderController.java:546)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:832)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:743)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)

Outcomes