summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2012-03-23 07:36:54 (EDT)
committer Manik Kishore2012-06-19 07:23:23 (EDT)
commitd2b3e2fa718c31ffe60381f34a4fd35d87dceaa5 (patch)
tree664f5718ccafea81f83a36bfc23fc606466bd1af
parentc38cc42e8bfdf4bfc39e43032ef20be89c93fd2d (diff)
downloadorg.eclipse.stardust.ui.web-d2b3e2fa718c31ffe60381f34a4fd35d87dceaa5.zip
org.eclipse.stardust.ui.web-d2b3e2fa718c31ffe60381f34a4fd35d87dceaa5.tar.gz
org.eclipse.stardust.ui.web-d2b3e2fa718c31ffe60381f34a4fd35d87dceaa5.tar.bz2
Jira-ID: CRNT-24047
1)Added code to show different notification message when a) only 1 process in Available for Detach Case b)One Active process and other non-active processes. 2)Changed views-common-messages.properties message for views.detachCase.notification.msg git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@54849 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/views/casemanagement/CaseDetailsBean.java58
-rw-r--r--views-common/src/main/resources/META-INF/xhtml/views/case/detachCaseNotification.xhtml3
-rw-r--r--views-common/src/main/resources/views-common-messages.properties2
-rw-r--r--views-common/src/main/resources/views-common-messages_de.properties2
-rw-r--r--views-common/src/main/resources/views-common-messages_ja.properties2
-rw-r--r--views-common/src/main/resources/views-common-messages_zh_CN.properties2
6 files changed, 52 insertions, 17 deletions
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/views/casemanagement/CaseDetailsBean.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/views/casemanagement/CaseDetailsBean.java
index b8a61d8..1d2a2d3 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/views/casemanagement/CaseDetailsBean.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/views/casemanagement/CaseDetailsBean.java
@@ -96,6 +96,8 @@ public class CaseDetailsBean extends PopupUIComponentBean
private static final String STATE_PREFIX = "views.processTable.statusFilter.";
private static final String VIEW_ID = "caseDetailsView";
+ private static final String ABORT_STATE_MSG = "abort";
+ private static final String COMPLETE_STATE_MSG = "complete";
private ProcessInstance processInstance;
private Long processInstanceOID;
private boolean hideCompletedActivities;
@@ -126,6 +128,7 @@ public class CaseDetailsBean extends PopupUIComponentBean
private boolean editProcessName = false;
private String processName;
private String caseOwnerLabel;
+ private String detachNotificationMessage;
private ProcessInstance detachProcessInstance;
private ConfirmationDialog detachCaseConfirmationDialog;
private String description;
@@ -136,6 +139,8 @@ public class CaseDetailsBean extends PopupUIComponentBean
private boolean hasSpawnProcessPermission;
private boolean hasSwitchProcessPermission;
private boolean hasJoinProcessPermission;
+
+ private int activeChildProcessCount;
public CaseDetailsBean()
{
@@ -286,7 +291,7 @@ public class CaseDetailsBean extends PopupUIComponentBean
*
*/
public void handleEvent(ViewEvent event)
- {
+ {
if (ViewEventType.CREATED == event.getType())
{
View focusView = event.getView();
@@ -344,18 +349,32 @@ public class CaseDetailsBean extends PopupUIComponentBean
}
detachProcessInstance = pi;
- ProcessInstance rootProcessInstance = ProcessInstanceUtils.getRootProcessInstance(pi, false);
- Set<Long> childPIs = countImmediateChilds(rootProcessInstance);
-
- if (childPIs.contains(pi.getOID()) && childPIs.size() == 1)
+ if (ProcessInstanceUtils.isActiveProcessInstance(pi))
{
- openConfirmationDialog();
- return;
+ ProcessInstance rootProcessInstance = ProcessInstanceUtils.getRootProcessInstance(pi, false);
+ Set<Long> childPIs = countImmediateChilds(rootProcessInstance);
+
+ if (childPIs.contains(pi.getOID()) && activeChildProcessCount == 1)
+ {
+ if (childPIs.size() == activeChildProcessCount)
+ {
+ detachNotificationMessage = COMMON_MESSAGE_BEAN.getParamString("views.detachCase.notification.msg",
+ ABORT_STATE_MSG);
+ }
+ else
+ detachNotificationMessage = COMMON_MESSAGE_BEAN.getParamString("views.detachCase.notification.msg",
+ COMPLETE_STATE_MSG);
+ openConfirmationDialog();
+ return;
+ }
+ else
+ {
+ detachProcess();
+ }
+
}
else
- {
detachProcess();
- }
}
catch (Exception e)
{
@@ -393,19 +412,31 @@ public class CaseDetailsBean extends PopupUIComponentBean
return true;
}
+ /**
+ * Retrieve the immediate Child count and also active child count for Case PI
+ *
+ * @param rootProcessInstance
+ * @return
+ */
private Set<Long> countImmediateChilds(ProcessInstance rootProcessInstance)
{
List<ProcessInstanceHistoryItem> childPIs = ProcessHistoryTable.getCurrent().getProcessTreeTable()
.getProcessHistoryTableRoot().getChildren();
+ activeChildProcessCount = 0;
Set<Long> processOIDs = CollectionUtils.newHashSet();
for (ProcessInstanceHistoryItem pi : childPIs)
{
+ // Store the Active Child count ,required as confirm Detach dialog should be
+ // shown when there is only 1 active Child
+ if (pi.getState().equals(ProcessInstanceState.Active.getName()))
+ {
+ activeChildProcessCount = activeChildProcessCount + 1;
+ }
processOIDs.add(pi.getOID());
}
return processOIDs;
}
-
-
+
public void detachProcess()
{
long[] pis = {detachProcessInstance.getOID()};
@@ -1016,6 +1047,11 @@ public class CaseDetailsBean extends PopupUIComponentBean
this.description = description;
}
}
+
+ public String getDetachNotificationMessage()
+ {
+ return detachNotificationMessage;
+ }
/**
*
diff --git a/views-common/src/main/resources/META-INF/xhtml/views/case/detachCaseNotification.xhtml b/views-common/src/main/resources/META-INF/xhtml/views/case/detachCaseNotification.xhtml
index 5d3c929..59fdcdf 100644
--- a/views-common/src/main/resources/META-INF/xhtml/views/case/detachCaseNotification.xhtml
+++ b/views-common/src/main/resources/META-INF/xhtml/views/case/detachCaseNotification.xhtml
@@ -7,8 +7,7 @@
<ui:component>
<ice:panelGrid>
- <ice:outputText
- value="#{views_common_msgPropsBean['views.detachCase.notification.msg']}" />
+ <ice:outputText value="#{caseDetailsBean.detachNotificationMessage}" />
<ice:panelGroup styleClass="clearing" />
<ice:outputText
diff --git a/views-common/src/main/resources/views-common-messages.properties b/views-common/src/main/resources/views-common-messages.properties
index 5834044..087afcf 100644
--- a/views-common/src/main/resources/views-common-messages.properties
+++ b/views-common/src/main/resources/views-common-messages.properties
@@ -1468,7 +1468,7 @@ views.attachToCase.processRequired.message=Process OID is Required.
views.attachToCase.inputIsProcess.message=Case OID is invalid.
views.attachToCase.inputIsCase.message=Process OID is invalid.
views.attachToCase.caseDetach.rootError=Cannot detach root process from Case.
-views.detachCase.notification.msg=Detaching the Process will complete the Case.
+views.detachCase.notification.msg=Detaching the Process will {0} the Case.
views.detachCase.notification.confirm=Do you want to continue?
views.attachToCase.caseAttach.notAuthorizedToManageCase = You are not authorized to manage this Case.
views.attachToCase.caseProcess.notSelectMultipleCases = Please select only one Case to Attach To Case.
diff --git a/views-common/src/main/resources/views-common-messages_de.properties b/views-common/src/main/resources/views-common-messages_de.properties
index 8fbe2a5..7278fb5 100644
--- a/views-common/src/main/resources/views-common-messages_de.properties
+++ b/views-common/src/main/resources/views-common-messages_de.properties
@@ -1465,7 +1465,7 @@ views.attachToCase.processRequired.message=+Process OID is Required.
views.attachToCase.inputIsProcess.message=+Case OID is invalid.
views.attachToCase.inputIsCase.message=Process OID is invalid.
views.attachToCase.caseDetach.rootError=+Cannot detach root process from Case.
-views.detachCase.notification.msg=+Detaching the Process will complete the Case.
+views.detachCase.notification.msg=+Detaching the Process will {0} the Case.
views.detachCase.notification.confirm=+Do you want to continue?
views.attachToCase.caseAttach.notAuthorizedToManageCase =+You are not authorized to manage this Case.
views.attachToCase.caseProcess.notSelectMultipleCases = +Please select only one Case to Attach To Case.
diff --git a/views-common/src/main/resources/views-common-messages_ja.properties b/views-common/src/main/resources/views-common-messages_ja.properties
index ea6e6f2..299e8a2 100644
--- a/views-common/src/main/resources/views-common-messages_ja.properties
+++ b/views-common/src/main/resources/views-common-messages_ja.properties
@@ -1465,7 +1465,7 @@ views.attachToCase.processRequired.message = +Process OID is Required.
views.attachToCase.inputIsProcess.message = +Case OID is invalid.
views.attachToCase.inputIsCase.message = Process OID is invalid.
views.attachToCase.caseDetach.rootError = +Cannot detach root process from Case.
-views.detachCase.notification.msg = +Detaching the Process will complete the Case.
+views.detachCase.notification.msg=+Detaching the Process will {0} the Case.
views.detachCase.notification.confirm = +Do you want to continue?
views.attachToCase.caseAttach.notAuthorizedToManageCase = +You are not authorized to manage this Case.
views.attachToCase.caseProcess.notSelectMultipleCases = +Please select only one Case to Attach To Case.
diff --git a/views-common/src/main/resources/views-common-messages_zh_CN.properties b/views-common/src/main/resources/views-common-messages_zh_CN.properties
index 0166e49..8ca27b8 100644
--- a/views-common/src/main/resources/views-common-messages_zh_CN.properties
+++ b/views-common/src/main/resources/views-common-messages_zh_CN.properties
@@ -1466,7 +1466,7 @@ views.attachToCase.processRequired.message = \u8FDB\u7A0BOID\u662F\u5FC5\u9700\u
views.attachToCase.inputIsProcess.message = \u6848\u4F8BOID\u65E0\u6548\u3002
views.attachToCase.inputIsCase.message = \u8FDB\u7A0BOID\u65E0\u6548\u3002
views.attachToCase.caseDetach.rootError = \u4E0D\u80FD\u4ECE\u6848\u4F8B\u8131\u79BB\u6839\u8FDB\u7A0B\u3002
-views.detachCase.notification.msg = \u62C6\u5378\u8FDB\u7A0B\u5C06\u5B8C\u6210\u6848\u4F8B\u3002
+views.detachCase.notification.msg=+Detaching the Process will {0} the Case.
views.detachCase.notification.confirm = \u662F\u5426\u7EE7\u7EED\uFF1F
views.attachToCase.caseAttach.notAuthorizedToManageCase = \u60A8\u6CA1\u6709\u88AB\u6388\u6743\u7BA1\u7406\u8FD9\u4E2A\u6848\u4F8B\u3002
views.attachToCase.caseProcess.notSelectMultipleCases = \u8BF7\u9009\u62E9\u4E00\u4E2A\u6848\u4F8B\u9644\u52A0\u5230\u6B64\u6848\u4EF6\u3002