usertask设置如上图。重点参数 Multi-instance type/Cardinality/completion condition这里是重点
代码如下。
@RequestMapping (value = {"saStartMI"})
@ResponseBody
public Map<String, Object> SpringMultiInstance (){
Map<String, Object> retval = new HashMap<String, Object>();
Map<String, Object> parm = new HashMap<String, Object>();
List<String> assigneeList=new ArrayList<String>(); //分配任务的人员
assigneeList.add("sunhw");
assigneeList.add("bikean");
assigneeList.add("admin");
parm.put("userList", assigneeList);
ProcessInstance processInstance = rs.startProcessInstanceByKey("cccccc", parm);
System.out.println("id:"+processInstance.getId()+",activitiId:"+processInstance.getActivityId());
return retval;
}
帮助文档下载地址。http://download.csdn.net/download/aa80303857/10229523
乱码问题:
tomcat找到catalina.bat增加set JAVA_OPTS=-Dsun.jnu.encoding=UTF-8 -Dfile.encoding=UTF-8
下面是设置字体,图片乱码问题
<property name="activityFontName" value="宋体"/>
<property name="labelFontName" value="宋体"/>
<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration"> <!-- 数据源 --> <property name="dataSource" ref="dataSource" /> <!-- 配置事务管理器,统一事务 --> <property name="transactionManager" ref="transactionManager" /> <!-- 设置建表策略 --> <property name="databaseSchemaUpdate" value="false" /> <property name="mailServerUseSSL" value="false" /> <property name="activityFontName" value="宋体"/> <property name="labelFontName" value="宋体"/> </bean> <bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean"> <property name="processEngineConfiguration" ref="processEngineConfiguration" /> </bean> <bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" /> <bean id="runtimeService" factory-bean="processEngine" factory-method="getRuntimeService" /> <bean id="taskService" factory-bean="processEngine" factory-method="getTaskService" /> <bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService" /> <bean id="formService" factory-bean="processEngine" factory-method="getFormService" />