String beanName = activityXml.getParticiLogic();
List<Participant> participants;
try {
//beanName 名称后面没有指定调用方法时。直接调用IToolAppAction.execute
int index = beanName.indexOf("#");
IParticipantService action = ApplicationContextHolder.getBean(beanName, IParticipantService.class);
if(index == -1) {
participants = action.createWorkItemParticipants(cloneProcessInstance);
} else {
//反射调用bean指定的方法。
String methodName = beanName.substring(index + 1);
if("".equals(beanName))
throw new ProcessEngineException("IParticipantService 实现类Bean:"+beanName+",没有指定方法名称");
beanName = beanName.substring(0, index);
try {
Method method = action.getClass().getMethod(methodName, long.class, long.class);
participants = (List<Participant>)method.invoke(action, cloneProcessInstance);
} catch (Exception e) {
throw new ProcessEngineException("IParticipantService 实现类Bean:"+beanName+",没有此方法", e);
}
}