<%@ page import="org.wso2.carbon.utils.ServerConstants" %> <%@ page import="org.wso2.carbon.CarbonConstants" %> <%@ page import="org.apache.axis2.context.ConfigurationContext" %> <%@ page import="org.wso2.carbon.ui.CarbonUIUtil" %> <%@ page import="javax.xml.namespace.QName" %> <%@ page import="org.wso2.carbon.humantask.stub.mgt.types.TaskInfoType" %> <%@ page import="org.wso2.carbon.humantask.ui.clients.HumanTaskPackageManagementServiceClient" %> <%@ page import="org.apache.http.HttpStatus" %> <%@ page import="org.wso2.carbon.ui.CarbonUIMessage" %> <%@ page import="org.wso2.carbon.humantask.ui.util.HumanTaskUIUtil" %> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> <%@ taglib uri="http://wso2.org/projects/carbon/taglibs/carbontags.jar" prefix="carbon" %> <% response.setHeader("Cache-Control", "no-store, max-age=0, no-cache, must-revalidate"); // Set IE extended HTTP/1.1 no-cache headers. response.addHeader("Cache-Control", "post-check=0, pre-check=0"); // Set standard HTTP/1.0 no-cache header. response.setHeader("Pragma", "no-cache"); boolean isAuthorizedToMonitor = true; // TODO - set permissions boolean isAuthorizedToManageProcesses = true; // TODO - set permissions HumanTaskPackageManagementServiceClient serviceClient; String backendServerURL = CarbonUIUtil.getServerURL(config.getServletContext(), session); ConfigurationContext configContext = (ConfigurationContext) config.getServletContext().getAttribute(CarbonConstants.CONFIGURATION_CONTEXT); String cookie = (String) session.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE); String taskDefId = request.getParameter("taskDefId"); QName taskId = QName.valueOf(taskDefId); TaskInfoType taskInfoType = null; String taskDefPrettyPrinted = null; try { serviceClient = new HumanTaskPackageManagementServiceClient(cookie, backendServerURL, configContext); } catch (Exception e) { response.setStatus(HttpStatus.SC_INTERNAL_SERVER_ERROR); CarbonUIMessage uiMsg = new CarbonUIMessage(CarbonUIMessage.ERROR, e.getMessage(), e); session.setAttribute(CarbonUIMessage.ID, uiMsg); %> <% return; } %>

 (<%=taskDefId%>)

<% if (isAuthorizedToMonitor || isAuthorizedToManageProcesses) { %>
<% taskInfoType = serviceClient.getTaskInfo(taskId); taskDefPrettyPrinted = HumanTaskUIUtil.prettyPrint(HumanTaskUIUtil.getTaskDefinition(taskInfoType)); %>
 
Task Definition:
 
<% } else { %>

<% } %>