<%@page import="org.activiti.engine.repository.ProcessDefinition"%>
<%@page import="org.activiti.bpmn.model.*"%>
<%@page import="com.blueland.bpm.engine.config.model.*"%>
<%@page import="com.blueland.bpm.common.page.*"%>
<%@page import="com.blueland.bpm.common.util.*"%>
<%@page import="java.util.*"%>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib tagdir="/WEB-INF/tags/simpletable" prefix="simpletable"%>
<%@ include file="/commons/taglibs.jsp"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%@ include file="/commons/meta.jsp"%>
<base href="<%=basePath%>">
<title>待办列表</title>
	<link href="${ctx_js_plugins}/simpletable/simpletable.css" type="text/css" rel="stylesheet">
	<script type="text/javascript" src="${ctx_js_plugins}/simpletable/simpletable.js"></script>


<script type="text/javascript">
		$(document).ready(function() {
			
		});
		
		function createActivityUser(){
			var url="${ctx}/setActivityUser/create.do";
			showDiaLog(url,"新增环节人员",'800px','600px');
		}
		function editActivityUser(){
			var url="${ctx}/setActivityUser/edit.do";
			showDiaLog(url,"修改环节人员",'800px','600px');
		}
	
	</script>
</head>
<body>
	<%@ include file="/commons/messages.jsp"%>
	<form id="procDefForm" name="procDefForm"
		action="${ctx}/procDefMgr/list.do" method="post"
		style="display: inline;">
		<div class="position">
			<div class="center">
				<div class="left">
					<div class="right">
						<span>当前位置：流程管理 >> 表单设置</span>
					</div>
				</div>
			</div>
		</div>
		<div class="box2" style="line-height:70%" panelTitle="全局表单" roller="false">
				<table class="tableStyle" formMode="true" footer="normal">
					<tr>
						<td width="100px">表单URL：</td>
						<td colspan="7">
							<input style="width: 600px" name="processPageUrl" id="processPageUrl" value="" />
						</td>
					</tr>
				</table>
	   </div>

	<div class="box2" style="line-height:70%" panelTitle="环节表单" roller="false">
				
			<table class="tableStyle">
			
				<tr>
					<th width="60px">节点名称</th>
					<th>跳转类型</th>
					<th>环节表单</th>
				</tr>
	

		<%
			BpmnModel bpmnModel = (BpmnModel) request.getAttribute("bpmnModel");
			if (bpmnModel != null) {
				List<org.activiti.bpmn.model.Process> processes = bpmnModel
						.getProcesses();
				for (int i = 0; i < processes.size(); i++) {
					org.activiti.bpmn.model.Process process = (org.activiti.bpmn.model.Process) processes
							.get(i);
					Collection<FlowElement> flowElementList = process
							.getFlowElements();
					for (FlowElement flowElement : flowElementList) {
						if (!UserTask.class.isInstance(flowElement)) {
							continue;
						}
						UserTask userTask = (UserTask) flowElement;
		%>
		

				<tr class="<%=((i + 1) % 2 == 0 ? "odd" : "even")%>">

					<td><%=userTask.getName()+"("+userTask.getId()+")"%> &nbsp;</td>
					<td>
					<%
					if(userTask.getAssignee()!=null){
						userTask.getCandidateUsers().add(userTask.getAssignee());
					}
						%>
						
					<%if(userTask.getCandidateUsers()!=null&&!userTask.getCandidateUsers().isEmpty()){
						%>
						用户列表:<%=userTask.getCandidateUsers()%>&nbsp;&nbsp;
						<%
					}if(userTask.getCandidateOrgs()!=null&&!userTask.getCandidateOrgs().isEmpty()){
						%>
						组织:<%=userTask.getCandidateOrgs()%>&nbsp;&nbsp;
						<%
					}if(userTask.getCandidateGroups()!=null&&!userTask.getCandidateGroups().isEmpty()){
						%>
						角色:<%=userTask.getCandidateGroups()%>
						<%
					}
					%></td>
				</tr>

			
			
		<%
			}
				}
			}
		%>
		</table>
		</div>
			<br/>
			
		
	</form>
</body>
</html>

