<%@ page import="org.apache.axis2.context.ConfigurationContext" %> <%@ page import="org.apache.http.HttpStatus" %> <%@ page import="org.wso2.carbon.CarbonConstants" %> <%@ page import="org.wso2.carbon.bpel.stub.mgt.types.*" %> <%@ page import="org.wso2.carbon.bpel.ui.BpelUIUtil" %> <%@ page import="org.wso2.carbon.bpel.ui.clients.ProcessManagementServiceClient" %> <%@ page import="org.wso2.carbon.ui.CarbonUIMessage" %> <%@ page import="org.wso2.carbon.ui.CarbonUIUtil" %> <%@ page import="org.wso2.carbon.utils.ServerConstants" %> <%@ page import="javax.xml.namespace.QName" %> <%@ page import="java.util.ArrayList" %> <%@ page import="org.wso2.carbon.ui.util.CharacterEncoder" %> <%@ 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-cache"); // check whether has permission to edit, if not disable elements to modify boolean isAuthorizedToManageProcesses = CarbonUIUtil.isUserAuthorized(request, "/permission/admin/manage/bpel/processes"); boolean isAuthorizedToMonitor = CarbonUIUtil.isUserAuthorized(request, "/permission/admin/monitor/bpel"); String processID = CharacterEncoder.getSafeText(request.getParameter("Pid")); String operation = CharacterEncoder.getSafeText(request.getParameter("operation")); ProcessManagementServiceClient processMgtClient; ProcessDeployDetailsList_type0 processDeployDetailsListType; ArrayList scopeNames = new ArrayList(); if (processID != null && processID.trim().length() > 0 && (isAuthorizedToMonitor || isAuthorizedToManageProcesses)) { 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); QName pid = QName.valueOf(processID); try { processMgtClient = new ProcessManagementServiceClient(cookie, backendServerURL, configContext, request.getLocale()); } 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; } /* * Obtain deployment descriptor(deploy.xml) information to be displayed in editor */ try { processDeployDetailsListType = processMgtClient.getProcessDeploymentInfo(pid); if (processDeployDetailsListType != null && processDeployDetailsListType.getProcessEventsList() != null && processDeployDetailsListType.getProcessEventsList().getScopeEventsList() != null && processDeployDetailsListType.getProcessEventsList().getScopeEventsList().getScopeEvent() != null) { for (ScopeEventType scopeEventType : processDeployDetailsListType.getProcessEventsList().getScopeEventsList().getScopeEvent()) { scopeNames.add(scopeEventType.getScope()); //scope names in the scope level events is taken into // arrayllist to be used after it is updated } } } 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; } /* * sets backend data into deployDescriptorUpdater bean class object */ if (operation != null && operation.equals("deployinfo")) { // when the submit button of editor form is clicked, this will update backend try { String[] selecttype = request.getParameterValues("scopeevents"); BpelUIUtil.updateBackEnd(processMgtClient, processDeployDetailsListType, deployDescriptorUpdater, selecttype, scopeNames); } 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; } } else { try { if (processDeployDetailsListType != null) { //create a new bean instance with processDeployDetailsList_type0 data BpelUIUtil.configureDeploymentDescriptorUpdater(processDeployDetailsListType, deployDescriptorUpdater); } } 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; } } %> <% } %> <%----%>

<% if (isAuthorizedToMonitor || isAuthorizedToManageProcesses) { %> <%-- filling the deploy info table in the editor with DeployDescriptorUpdater bean class --%> <% if (deployDescriptorUpdater != null) { %>
<%=processID%>
<%= BpelUIUtil.isElementDisabled(isAuthorizedToManageProcesses)%> <%= deployDescriptorUpdater.isActiveStateSelected()%>>Active
<%= BpelUIUtil.isElementDisabled(isAuthorizedToManageProcesses)%> <%= deployDescriptorUpdater.isRetiredStateSelected()%>>Retired
<%= BpelUIUtil.isElementDisabled(isAuthorizedToManageProcesses)%> <%= deployDescriptorUpdater.isDisabledStateSelected()%>>Disabled
<%= BpelUIUtil.isElementDisabled(isAuthorizedToManageProcesses)%> <%= deployDescriptorUpdater.isInMemoryTrueSelected()%>>True
<%= BpelUIUtil.isElementDisabled(isAuthorizedToManageProcesses)%> <%= deployDescriptorUpdater.isInMemoryFalseSelected()%>>False
<% if (deployDescriptorUpdater.getProvideServiceList() != null) { for (ProvidedServiceType provideServices : deployDescriptorUpdater.getProvideServiceList().getProvidedService()) { %> <% Service_type0 service = provideServices.getService(); %> <% } } %>
<%= provideServices.getPartnerLink()%> <%= service.getName()%> <%= service.getPort()%>
<% InvokeServiceListType invokeList = deployDescriptorUpdater.getInvokedServiceList(); if (invokeList != null) { for (InvokedServiceType invokedServices : invokeList.getInvokedService()) { %> <% Service_type1 service = invokedServices.getService(); %> <% }}else { %> <% } %>
<%= invokedServices.getPartnerLink()%> <%= service.getName()%> <%= service.getPort()%>
<% MexInterpreterListType mexList = deployDescriptorUpdater.getMexInterceptors(); if (mexList != null && mexList.getMexinterpreter() != null) { %> <% for (String mexIntName : mexList.getMexinterpreter()) { %> <% } %> <% } else { %> <% } %>
Name <%= mexIntName %>
<%= BpelUIUtil.isElementDisabled(isAuthorizedToManageProcesses)%> <%= deployDescriptorUpdater.isTypeNoneSelected()%>>
<%= BpelUIUtil.isElementDisabled(isAuthorizedToManageProcesses)%> <%= deployDescriptorUpdater.isTypeAllSelected()%>>
<%= BpelUIUtil.isElementDisabled(isAuthorizedToManageProcesses)%> <%= deployDescriptorUpdater.isTypeSelectedSelected()%>>
<% String[] eventsList = deployDescriptorUpdater.getEvents(); deployDescriptorUpdater.setEvents(new String[0]); %> <%= BpelUIUtil.isElementDisabled(isAuthorizedToManageProcesses)%> <%= deployDescriptorUpdater.isInsLifSelected()%>>Instance Life Cycle
<%= BpelUIUtil.isElementDisabled(isAuthorizedToManageProcesses)%> <%= deployDescriptorUpdater.isActLifSelected()%>>Activity Life Cycle
<%= BpelUIUtil.isElementDisabled(isAuthorizedToManageProcesses)%> <%= deployDescriptorUpdater.isDataHandSelected()%>>Data Handling
<%= BpelUIUtil.isElementDisabled(isAuthorizedToManageProcesses)%> <%= deployDescriptorUpdater.isScopeHandSelected()%>>Scope Handling
<%= BpelUIUtil.isElementDisabled(isAuthorizedToManageProcesses)%> <%= deployDescriptorUpdater.isCorrelatnSelected()%>>Correlation
<% ScopeEventType[] scopeEvents = deployDescriptorUpdater.getScopeEvents(); if (scopeEvents != null) { %> <% for (ScopeEventType scopeEvent : scopeEvents) { %> <% EnableEventListType scopeLevelenableEventList = scopeEvent.getEnabledEventList(); String[] scopeLevelEnabledEvents = scopeLevelenableEventList.getEnableEvent(); %> <% } %> <% } else { %> <% } %>
<%= scopeEvent.getScope()%> > > > > >
<% if (deployDescriptorUpdater.getPropertyList() != null && deployDescriptorUpdater.getPropertyList().getProcessProperty() != null) { %> <% for (ProcessProperty_type0 property : deployDescriptorUpdater.getPropertyList().getProcessProperty()) { %> <% } %> <% } else { %> <% } %>
Property Name Property Value
<%= property.getName()%> <%= property.getValue()%>
<% String[] successCategoryList = deployDescriptorUpdater.getSuccesstypecleanups(); deployDescriptorUpdater.setSuccesstypecleanups(new String[0]); %> <% String[] failureCategoryList = deployDescriptorUpdater.getFailuretypecleanups(); deployDescriptorUpdater.setFailuretypecleanups(new String[0]); %>
<%= BpelUIUtil.isElementDisabled(isAuthorizedToManageProcesses)%> <%= deployDescriptorUpdater.isSucInsCreated()%>> <%= BpelUIUtil.isElementDisabled(isAuthorizedToManageProcesses)%> <%= deployDescriptorUpdater.isSucVarCreated()%>> <%= BpelUIUtil.isElementDisabled(isAuthorizedToManageProcesses)%> <%= deployDescriptorUpdater.isSucMesCreated()%>> <%= BpelUIUtil.isElementDisabled(isAuthorizedToManageProcesses)%> <%= deployDescriptorUpdater.isSucCorCreated()%>> <%= BpelUIUtil.isElementDisabled(isAuthorizedToManageProcesses)%> <%= deployDescriptorUpdater.isSucEveCreated()%>>
<%= BpelUIUtil.isElementDisabled(isAuthorizedToManageProcesses)%> <%= deployDescriptorUpdater.isFailInsCreated()%>> <%= BpelUIUtil.isElementDisabled(isAuthorizedToManageProcesses)%> <%= deployDescriptorUpdater.isFailVarCreated()%>> <%= BpelUIUtil.isElementDisabled(isAuthorizedToManageProcesses)%> <%= deployDescriptorUpdater.isFailMesCreated()%>> <%= BpelUIUtil.isElementDisabled(isAuthorizedToManageProcesses)%> <%= deployDescriptorUpdater.isFailCorCreated()%>> <%= BpelUIUtil.isElementDisabled(isAuthorizedToManageProcesses)%> <%= deployDescriptorUpdater.isFailEveCreated()%>>
style="text-align:left; float:right; height: 25px; font-size: 12px;" onclick="checkForCleanupsCorrect()">
<% } %> <%-- End of the process deployment information table --%> <% } else { %>

<% } %>