/**
 * Copyright 1996-2014 FoxBPM ORG.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 
 * @author ych
 */
package org.foxbpm.rest.service.api.task;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.foxbpm.engine.ProcessEngine;
import org.foxbpm.engine.TaskService;
import org.foxbpm.engine.exception.FoxBPMIllegalArgumentException;
import org.foxbpm.engine.impl.entity.ProcessOperatingEntity;
import org.foxbpm.engine.impl.util.StringUtil;
import org.foxbpm.rest.common.api.AbstractRestResource;
import org.foxbpm.rest.common.api.DataResult;
import org.foxbpm.rest.common.api.FoxBpmUtil;
import org.restlet.resource.Get;

/**
 * 获取所有对任务的操作
 * @author ych
 *
 */
public class TaskOperationCollectionResource extends AbstractRestResource {

	@Get
	public DataResult getOperation(){
		
		String taskId = getAttribute("taskId");
		if(StringUtil.isEmpty(taskId)){
			throw new FoxBPMIllegalArgumentException("taskId 为空！");
		}
		ProcessEngine processEngine = FoxBpmUtil.getProcessEngine();
		TaskService taskService = processEngine.getTaskService();
		List<ProcessOperatingEntity> operations = taskService.getTaskOperations(taskId);
		List<Map<String,Object>> resultMap = new ArrayList<Map<String,Object>>();
		if(operations != null && operations.size() >0){
			for(ProcessOperatingEntity tmp : operations){
				resultMap.add(tmp.getPersistentState());
			}
		}
		DataResult dataResult = new DataResult();
		dataResult.setData(resultMap);
		dataResult.setTotal(resultMap.size());
		return dataResult;
	}
}

@@ -966,16 +966,122 @@
 ntity;%0D%0A
+import org.foxbpm.engine.impl.entity.UserEntity;%0D%0Aimport org.foxbpm.engine.impl.identity.Authentication;%0D%0A
 import o
@@ -2016,46 +2016,430 @@
 %09%09%09%09
-resultMap.add
+Map%3CString,Object%3E tmpMap = tmp.getPersistentState();%0D%0A%09%09%09%09String operator = StringUtil.getString
 (tmp
+Map
 .get
-PersistentState()
+(%22operator%22));%0D%0A%09%09%09%09String operatorName = %22%E7%A9%BA%E7%94%A8%E6%88%B7%E5%90%8D%22;%0D%0A%09%09%09%09if(StringUtil.isNotEmpty(operator))%7B%0D%0A%09%09%09%09%09UserEntity user = Authentication.selectUserByUserId(operator);%0D%0A%09%09%09%09%09if(user != null)%7B%0D%0A%09%09%09%09%09%09operatorName = user.getUserName();%0D%0A%09%09%09%09%09%7D%0D%0A%09%09%09%09%7D%0D%0A%09%09%09%09tmpMap.put(%22operatorName%22, operatorName);%0D%0A%09%09%09%09resultMap.add(tmpMap
 );%0D%0A

修改operation rest返回数据