<%@ page import="com.progress.lang.Character" %> <%@ page import="com.progress.lang.LongChar" %> <%@ page import="java.math.BigDecimal" %> <%@ page import="com.savvion.common.appinfo.*" %> <%@ page import="com.savvion.sbm.bizmanage.api.*" %> <%@ page import="com.savvion.sbm.bizmanage.aim.AimUtil"%> <%@ page import="com.savvion.sbm.bizmanage.util.*" %> <%@ page import="com.savvion.sbm.bpmportal.util.*"%> <%@ page import="java.util.*" %> <%@ page import="java.text.*"%> <%@ page import="com.savvion.sbm.bizlogic.server.svo.*" %> <%@ page import="com.savvion.sbm.bizlogic.client.queryservice.bizstore.svo.BSWorkItemData"%> <%@ page import="com.savvion.sbm.bpmportal.bizsite.util.*"%> <%@ page import="com.savvion.sbm.bpmportal.util.PortalUtil"%> <%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" %> <%@ page errorPage="/bpmportal/myhome/psv_error.jsp" %> <%@ include file="../common/include_tag.jspf" %> <%@ taglib uri="/bpmportal/tld/bpmportal.tld" prefix="sbm" %> <% bizManage.setRequest(request); bizManage.setResponse(response); if(ServletUtil.hasSpecialCharsInRequest(request)) throw new Exception("Request contains special characters"); String ptid = request.getParameter("PTID"); String piid = request.getParameter("PIID"); String piIdEncoded = bizManage.hexEncode(request.getParameter("PIID")); String piname = bizManage.getProcessInstanceName(piid); String wsname = bizManage.hexDecode(request.getParameter("name"),PortalConstants.UTF8); String isAsc = request.getParameter("isAsc"); if (isAsc == null) isAsc = "true"; String showAuditTab = request.getParameter("showAuditTab"); if (showAuditTab == null) showAuditTab = "false"; // Truncating loop counter from wsname, if exists int index = wsname.indexOf('('); if (index != -1){ wsname = wsname.substring(0, index); } String ptname = bizManage.getPTNameFromPTID(ptid); String linkfrom = request.getParameter("link"); if(linkfrom == null){ linkfrom = "report"; } boolean valuesUpdate = false; Map dataslots = new HashMap(); if (request.getParameter("wsaction") != null) { valuesUpdate = true; String wsaction = request.getParameter("wsaction"); //can be BizManageBean.WS_ROLLBACK, resume, suspend, save,complete if (BizManageBean.WS_UPDATE.equals(wsaction)) //save button was clicked. { String priority = bizManage.getUTFString("priority"); bizManage.setWorkstepInformation(piid,wsname,"",priority); //Update the dataslot information Enumeration names = request.getParameterNames(); if(session.getAttribute("WsEditMap") != null) { Map edtMap = (Map)session.getAttribute("WsEditMap"); while(names.hasMoreElements()) { String name = (String) names.nextElement(); Map mapValue = (Map)session.getAttribute(name); if(mapValue == null) { String value = bizManage.getUTFString(name); if( name != null && name.trim().length() > 0 && value != null && edtMap.get(name) != null && ((Boolean)edtMap.get(name)).booleanValue()) { AppInfo appInfo = AppInfoKeeper.getAppInfo(ptname); String dataslotType = appInfo.getDataslotType(name); if(Dataslot.LONG.equals(dataslotType) || Dataslot.ABL_INT64.equals(dataslotType)) { try{ dataslots.put(name, String.valueOf(PortalNumberFormatUtil.parseLocalizedLong(value, bizManage.getLocale()))); } catch (Exception ex){dataslots.put(name, null);} } else if(Dataslot.ABL_INTEGER.equals(dataslotType)) { try{ dataslots.put(name, String.valueOf(Integer.parseInt(value))); } catch (Exception ex){dataslots.put(name, null);} } else if(Dataslot.DOUBLE.equals(dataslotType)) { dataslots.put(name, String.valueOf(PortalNumberFormatUtil.parseLocalizedDouble(value, bizManage.getLocale()))); } else if(Dataslot.DECIMAL.equals(dataslotType) || Dataslot.ABL_DECIMAL.equals(dataslotType)) { try{ dataslots.put(name, PortalNumberFormatUtil.parseLocalizedBigDecimal(value, bizManage.getLocale()).toPlainString()); } catch (Exception ex){dataslots.put(name, null);} } else { dataslots.put(name, value); } } } else { String[] values = bizManage.getUTFValues(name); Map newValues = new HashMap(); Iterator iter = mapValue.keySet().iterator(); while(iter != null && iter.hasNext()) { String key = (String)iter.next(); newValues.put(key,null); } //Remove the ds data from session session.removeAttribute(name); if(values != null && values.length > 0) { for(int i=0;i < values.length;i++) { String value = values[i]; if(value != null && !"update".equals(value)) newValues.put(value, Boolean.TRUE.toString()); } } if( name != null && name.trim().length() > 0 && newValues != null && edtMap.get(name) != null && ((Boolean)edtMap.get(name)).booleanValue()) { dataslots.put(name, newValues); } } } bizManage.setInstanceDataslotValue(piid,dataslots); session.removeAttribute("WsEditMap"); } else { bizManage.log("NULL Object found in session for 'WsEditMap' key"); } } else { if(BizManageBean.WS_COMPLETE.equals(wsaction)) { //Update the dataslot information Enumeration names = request.getParameterNames(); if(session.getAttribute("WsEditMap") != null) { Map edtMap = (Map)session.getAttribute("WsEditMap"); while(names.hasMoreElements()) { String name = (String) names.nextElement(); Map mapValue = (Map)session.getAttribute(name); if(mapValue == null) { String value = bizManage.getUTFString(name); if( name != null && name.trim().length() > 0 && value != null && edtMap.get(name) != null && ((Boolean)edtMap.get(name)).booleanValue()) { AppInfo appInfo = AppInfoKeeper.getAppInfo(ptname); String dataslotType = appInfo.getDataslotType(name); if(Dataslot.LONG.equals(dataslotType) || Dataslot.ABL_INT64.equals(dataslotType)) { try{ dataslots.put(name, String.valueOf(PortalNumberFormatUtil.parseLocalizedLong(value, bizManage.getLocale()))); } catch (Exception ex){dataslots.put(name, null);} } else if(Dataslot.ABL_INTEGER.equals(dataslotType)) { try{ dataslots.put(name, String.valueOf(Integer.parseInt(value))); } catch (Exception ex){dataslots.put(name, null);} } else if(Dataslot.DOUBLE.equals(dataslotType)) { dataslots.put(name, String.valueOf(PortalNumberFormatUtil.parseLocalizedDouble(value, bizManage.getLocale()))); } else if(Dataslot.DECIMAL.equals(dataslotType) || Dataslot.ABL_DECIMAL.equals(dataslotType)) { try{ dataslots.put(name, PortalNumberFormatUtil.parseLocalizedBigDecimal(value, bizManage.getLocale()).toPlainString()); } catch (Exception ex){dataslots.put(name, null);} } else { dataslots.put(name, value); } } } else { String[] values = bizManage.getUTFValues(name); Map newValues = new HashMap(); Iterator iter = mapValue.keySet().iterator(); while(iter != null && iter.hasNext()) { String key = (String)iter.next(); newValues.put(key,null); } //Remove the ds data from session session.removeAttribute(name); if(values != null && values.length > 0) { for(int i=0;i < values.length;i++) { String value = values[i]; if(value != null && !"update".equals(value)) newValues.put(value, Boolean.TRUE.toString()); } } if( name != null && name.trim().length() > 0 && newValues != null && edtMap.get(name) != null && ((Boolean)edtMap.get(name)).booleanValue()) dataslots.put(name, newValues); } } bizManage.setInstanceDataslotValue(piid,dataslots); session.removeAttribute("WsEditMap"); } else { bizManage.log("NULL Object found in session for 'WsEditMap' key"); } } bizManage.performWorkstepAction(piid,wsname,wsaction); } //handle workitems int numOfWorkitems = bizManage.getIntegerFromString(request.getParameter("numberofwi"),0); Workstep workstep = bizManage.getWorkstepInfo(ptid,piname,piid,wsname); if(workstep != null && workstep != BizManageBean.emptyWorkstep && workstep.isActivated()) { for (int i=0;i <%} else { Workstep workstep = bizManage.getWorkstepInfo(ptid,piname,piid,wsname); if (workstep == null || workstep == BizManageBean.emptyWorkstep) { %> <% return; } String performer = workstep.getPerformer(); //get workitems here. ArrayList workitems = bizManage.getWorkitemInfo(ptid,piname,piid,wsname); ArrayList dsInfoList = bizManage.getWorkstepDataslots(ptid,piname,piid,wsname); HashMap editMap = null; List dsList = null; if (!dsInfoList.isEmpty()) { editMap = (HashMap)dsInfoList.get(0); dsList = (List)dsInfoList.get(1); } else { editMap = new HashMap(); dsList = new ArrayList(); } session.setAttribute("WsEditMap",editMap); ArrayList votingInfo = bizManage.getWorkstepVotingInfo(ptid,piname,piid,wsname); %> <sbm:message key="Workstep" /> <sbm:message key="Details" /> - <sbm:message key="SBM" /> <%@ include file="../common/include_css_static.jsp" %> <%@ include file="../common/include_top.jsp" %>
<%@ include file="../common/include_body.jsp" %> <%@ include file="../common/include_form_body.jsp" %> " /> " /> " /> " /> " />
<% if (workstep.isRollbackAllowed() && workstep.hasActions() && (workstep.getActions().contains(BizManageBean.WS_ROLLBACK))) { %> <% } if (workstep.isSuspended() && workstep.hasActions() && (workstep.getActions().contains(BizManageBean.WS_RESUME))) { %> <% } if (workstep.isActivated() && workstep.hasActions() && (workstep.getActions().contains(BizManageBean.WS_SUSPEND))) { %> <% } %> <% if (!workstep.isCompleted() && !workstep.isSuspended() && workstep.hasActions()) { %> <% } %> <% if (workstep.isActivated() && workstep.hasActions() && (workstep.getActions().contains(BizManageBean.WS_UPDATE))) { %> <% } %> <% if (!workstep.isCompleted() && !workstep.isSuspended() && workstep.hasActions() ) { %> <% } %>
" class="PopButton" onmouseover="this.className='PopButtonHover';" onmouseout="this.className='PopButton';" onclick="document.workstep.wsaction.value='<%= BizManageBean.WS_ROLLBACK %>';" /> " class="ScrnButton" onmouseover="this.className='ScrnButtonHover';" onmouseout="this.className='ScrnButton';" onclick="document.workstep.wsaction.value='<%= BizManageBean.WS_RESUME %>';" /> " class="ScrnButton" onmouseover="this.className='ScrnButtonHover';" onmouseout="this.className='ScrnButton';" onclick="document.workstep.wsaction.value='<%= BizManageBean.WS_SUSPEND %>';" /> " class="ScrnButton" onMouseOver="this.className='ScrnButtonHover';" onMouseOut="this.className='ScrnButton';" onclick="document.workstep.wsaction.value='<%= BizManageBean.WS_COMPLETE %>';" > " class="PopButton" onmouseover="this.className='PopButtonHover';" onmouseout="this.className='PopButton';" onclick="document.workstep.wsaction.value='<%= BizManageBean.WS_UPDATE %>';" /> " class="PopButton" onmouseover="this.className='PopButtonHover';" onmouseout="this.className='PopButton';" /> " class="PopButton" onmouseover="this.className='PopButtonHover';" onmouseout="this.className='PopButton';" onclick="window.close();" />
<% if (!"".equals(workstep.getEndTime())) { %> <% } %> <% if("".equals(workstep.getEstimatedDurationValue())) { %> <% } else { %> <% } %> <%if("".equals(performer) || "null".equals(performer) || performer == null) {%> <%} else {%> <%}%> <% if (!workstep.hasPriorityOptions()) { if("".equals(workstep.getPriority())) { %> <% } else { %> <% } } else { %> <% } %>
: <%= bizManage.getWorkstepLabel(ptname,workstep.getName()) %>
<%= bizManage.getResourceString(bizManage.WS_START_TIME) %>: <%= workstep.getStartTime() %>
<%= bizManage.getResourceString(bizManage.WS_END_TIME) %>: <%= workstep.getEndTime() %>
<%= bizManage.getResourceString(bizManage.WS_DURATION) %>: <%= workstep.getEstimatedDuration() %>
<%= bizManage.getResourceString(bizManage.WS_PERFORMER) %>: - <%=performer%>
<%= bizManage.getResourceString(bizManage.WS_PRIORITY) %>: <%= bizManage.getResourceString(workstep.getPriority().toUpperCase()) %>
<%= bizManage.getResourceString(bizManage.WS_STATUS) %>: <%= workstep.getStatus() %>
<% if (workstep.isCompleted()) { List completedWIList = bizManage.getCompletedWorkItemInfo(wsname, ptid,piname,piid); %> <% if (completedWIList.size()> 0) { for (int i=0;i <% } } else { %> <% } } %> <% if (!workstep.isCompleted()) { %> <% if (workstep.isActivated()) { %> <% } %> <% if (workitems.size()== 0) { %> <% } for (int i=0;i <% Date dueDate = workitem.getDueDate(); boolean isOverDue = false; String displayDueDate = "-"; if (dueDate != null) { long dueDateTime = dueDate.getTime(); displayDueDate = com.savvion.sbm.bpmportal.util.DateTimeUtils.formatDate( bizManage.getDateFormatter(), workitem.getDueDate().getTime()); if (!"Completed".equalsIgnoreCase(workitem.getStatus())) { long now = java.util.Calendar.getInstance().getTime().getTime(); isOverDue = (now > dueDateTime); } } %> <% if (workitem.allowUpdate()) { %> <% } else { %> <% } %> <% } %> <% } %>
.
"><%=i+1%> "><%=workitem.getDisplayName()%> "><%=workitem.getLoopCounter()%> "><%=workitem.getPerformer()%> "><%=workitem.getStatus()%>
.
<%= String.valueOf(i+1) %> <%= workitem.getDisplayName() %> <% if (workstep.isSuspended() || !workstep.isUpdateAllowed()) { %> <%= workitem.getPerformer() %> <% } else if ("Completed".equalsIgnoreCase(workitem.getStatus())) { %> <%= workitem.getPerformer() %> <% } else { %>
  
<% } %>
<% if (isOverDue) { %> <% } %> "><%= displayDueDate %> <%= workitem.getStatus() %>  
<% if(votingInfo != null && votingInfo.size() > 0) { VotingInfo voteInfo = (VotingInfo)votingInfo.get(0); %> <% } %>
<% if(voteInfo.isBLRunning()) { %> <%} else {%> <%} %> <% if(voteInfo.isBLRunning()) { %> <%}%> <% if(voteInfo.hasVotingDataslot()) { %> <% } %> <% if(voteInfo.hasChoices()) { Map map = voteInfo.getStatusMap(); Set keySet = map.keySet(); Iterator iter = keySet.iterator(); %> <%}%>
:<%=voteInfo.getThresholdValue()%><%=(voteInfo.isPercentage()) ? "(%)" : ""%>
: <%=voteInfo.getCurrentValue()%> 
 
: <%=voteInfo.getVotingDataslotName()%> 
: <%=voteInfo.getVotingDataslotType()%> 
:
<% int counter = 0; while(iter != null && iter.hasNext()) { String key = iter.next().toString(); String value = map.get(key).toString(); %> <% counter++; } %>
"> <%=key%>  "> <%=value%> 
<% boolean dontUpdate = true; boolean enableButtons = true; StringBuffer textAreaCheck = new StringBuffer(""); if((dsList.size()==0) &&(!workstep.isCompleted())) enableButtons = true; if (dsList.size()== 0) { %> <% } for (int i=0;i <% } %> <% if (dataslot.hasChoices()) { ArrayList allchoices = dataslot.getChoices(); HashMap choiceLabels = dataslot.getChoiceLabels(); %> <% } //end dataslot.hasChoices(); else if (dataslot.isDocument() || dataslot.isObject() || dataslot.isSet() || dataslot.isList()) { %> <%= ((dataslot.isDocument())?"":"") %> <% } //end dataslot.isDocument() || dataslot.isObject() || dataslot.isSet() || dataslot.isList() else if (dataslot.isABLLongChar()) { String dsValue = ""; LongChar charValue = null; if (dataslot.getValue() instanceof LongChar) { charValue = (LongChar) dataslot.getValue(); dsValue = charValue.getValue(); } else dsValue = (null == dataslot.getValue()) ? "" : dataslot.getValue().toString(); if (dsValue != null) { final String tempVal = dsValue; dsValue = PortalUtil.getShortString(tempVal); } else dsValue = ""; %> <% } //end dataslot.isABLLongChar() else if (dataslot.isMultiLine()) { %> <% textAreaCheck.append("var textarea").append(i).append(" = document.getElementById('ta").append(i).append("');\n"); textAreaCheck.append("if (textarea").append(i).append(".value.length > ").append(dataslot.getSize()).append(")\n"); textAreaCheck.append("{\n"); textAreaCheck.append("\talert('").append(bizManage.getResourceString("textAreaAlert1")).append(" ").append(dataslot.getLabel()); textAreaCheck.append(" ").append(bizManage.getResourceString("textAreaAlert2")).append(" ").append(dataslot.getSize()); textAreaCheck.append(" ").append(bizManage.getResourceString("textAreaAlert3")).append("');\n"); textAreaCheck.append("\treturn false;\n"); textAreaCheck.append("}\n"); } //end dataslot.isMultiLine() else if (dataslot.isBoolean() || dataslot.isABLLogical()) { %> <% } //end datslot.isBoolean() else if (dataslot.isString() || dataslot.isURL() || dataslot.isABLCharacter() || dataslot.getName().equals(PortalConstants.STARTTIME)) { String dsValue = ""; if (dataslot.isABLCharacter()) { Character charValue = (Character) dataslot.getValue(); dsValue = charValue.getValue(); dsValue = (dsValue == null) ? "" : AimUtil.getHtmlSafeString(dsValue); } else dsValue = AimUtil.getHtmlSafeString(dataslot.getValue().toString()); %> <% }// end dataslot.isString() || dataslot.isURL else if (dataslot.isLong() || dataslot.isDouble() || dataslot.isABLInteger() || dataslot.isABLInt64()) { String type = "text"; String finalValue = ""; Number nValue = null; try{ if(dataslot.isLong()) nValue = Long.parseLong(dataslot.getValue().toString()); else if(dataslot.isDouble()) nValue = Double.parseDouble(dataslot.getValue().toString()); else if(dataslot.isABLInteger()){ com.progress.lang.Integer intt = (com.progress.lang.Integer)dataslot.getValue(); if(intt.getValue() != null){ nValue = Integer.parseInt(dataslot.getValue().toString()); } } else if(dataslot.isABLInt64()){ com.progress.lang.Int64 int64 = (com.progress.lang.Int64)dataslot.getValue(); if(int64.getValue() != null){ nValue = Long.parseLong(dataslot.getValue().toString()); } } }catch(Exception ex){} if( ! ( nValue == null && (dataslot.isABLInteger() || dataslot.isABLInt64())) ) finalValue = PortalNumberFormatUtil.prepareLocalizedNumber(nValue, bizManage.getLocale()); %> <% }// end dataslot.isLong() || dataslot.isDouble() else if (dataslot.isDecimal()) { Decimal decimal = (Decimal) dataslot.getValue(); int precision = decimal.getPrecision(); int scale = decimal.getScale(); String dsValue = PortalNumberFormatUtil.prepareLocalizedNumber(decimal.getValue(), bizManage.getLocale()); %> <% }// end dataslot.isDecimal() else if (dataslot.isABLDecimal()) { String dsValue; java.math.BigDecimal bigdecimal = (java.math.BigDecimal) (((com.progress.lang.Decimal)(dataslot.getValue())).getValue()); if(bigdecimal != null) dsValue = PortalNumberFormatUtil.prepareLocalizedNumber(bigdecimal, bizManage.getLocale()); else dsValue = ""; %> <% }// end dataslot.isABLDecimal() else if (dataslot.isDateTime() || dataslot.isABLDateTime()) { String strDateTime = ""; if(dataslot.isABLDateTime()){ if(dataslot.getValue() != null && dataslot.getValue().toString() != ""){ com.progress.lang.DateTimeTZ ablDate = (com.progress.lang.DateTimeTZ) dataslot.getValue(); if (ablDate.getValue() != null) strDateTime = bizManage.getDate(ablDate.getValue().getTime().getTime(),ptname,dataslot.getName()); } }else { String dsValue=dataslot.getValue().toString(); if (!PortalUtil.isEmpty(dsValue)) { DateTime datetime = (DateTime) dataslot.getValue(); if (datetime != null) { strDateTime = bizManage.getDate(datetime.getValue().getTime(),ptname,dataslot.getName()); } } } %> <% }// end dataslot.isDateTime() else if (dataslot.isXML()) { %> <% }// end dataslot.isXML() else if (dataslot.isMap()) { %> <% }// end dataslot.isMap() %> <% } %> <%-- This is the end of the dataslot table. --%>
" width="20%">: <%=((dataslot.isRequired())?" *":"") %> " width="80%"> " width="80%"><%= dataslot.getValue().toString() %>" width="80%">
<%= dsValue%>
" width="80%"> " width="80%">
<%= ((dataslot.getValue().toString().equalsIgnoreCase("true"))?" checked=\"checked\"":"") %> name="<%= dataslot.getName() %>" value="true" />        <%= ((dataslot.getValue().toString().equalsIgnoreCase("false"))?" checked=\"checked\"":"") %> name="<%= dataslot.getName() %>" value="false" />
" width="80%"> class="InptTxt" name="<%= dataslot.getName() %>" value="<%= dsValue %>" <%= ((dataslot.isString())?"maxlength=\""+dataslot.getSize()+"\"":"") %> <%= (dataslot.getValidationType() != null) ? ("alt=\""+dataslot.getValidationType()+"\""):"" %> size="<%= ((dontUpdate && dsValue.length() > 40) ? String.valueOf(dsValue.length() + 3) : "40")%>"/> " width="50%"> class="InptTxt" name="<%= dataslot.getName() %>" value="<%= finalValue %>" <%= (dataslot.getValidationType() != null) ? ("alt=\""+dataslot.getValidationType()+"\""):"" %> size="<%= ((dontUpdate && AimUtil.getHtmlSafeString(dataslot.getValue().toString()).length() > 40) ? String.valueOf(AimUtil.getHtmlSafeString(dataslot.getValue().toString()).length()+3) : "40")%>" /> " width="80%">
<%= DataUtil.self().getDecimalPresentation(ptname,dataslot,bizManage) %>
" width="50%">
id="<%= dataslot.getName() %>" name="<%= dataslot.getName() %>" value="<%= dsValue %>" <%= (dataslot.getValidationType() != null) ? ("alt=\""+dataslot.getValidationType()+"\""):"" %> />
" width="80%">
class="InptTxt" id = "<%= dataslot.getName() %>" name="<%= dataslot.getName() %>" value="<%= strDateTime %>" <%= (dataslot.getValidationType() != null) ? ("alt=\""+dataslot.getValidationType()+"\""):"" %>/> <% if (dontUpdate) { %> " class="BmIconCalendar"> <% } else { %> title="" class="BmIconCalendar"> <% } %>
" width="80%"><%= dataslot.getValue().toString() %> " width="80%"> <% Map mapValue = (Map)dataslot.getValue(); if(mapValue != null && mapValue.size() > 0 ) { Set keys = mapValue.keySet(); Iterator iter = keys.iterator(); while (iter != null && iter.hasNext()) { String key = (String)iter.next(); Object oval = mapValue.get(key); String val = "FALSE"; if (oval != null) val = oval.toString(); %> <% } } session.setAttribute(dataslot.getName(),mapValue); %>
<%= ((dontUpdate)?" disabled=\"disabled\"":"") %> ><%=key%>
<%@ include file="../common/include_bottom.jsp" %>
<%@ include file="../common/include_form_body.jsp" %> "> "> "> " >
<% } %>