summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVikas Mishra2012-03-15 05:46:34 (EDT)
committer Manik Kishore2012-06-19 07:21:23 (EDT)
commitf93c598126fb4052e10c5d31093503a809290c43 (patch)
treedc66d601d5e0056d3a86a65dfe8ef5ed22a8905b
parent37b03bb79e8302bb998d2c2e06781e8ffa4104f5 (diff)
downloadorg.eclipse.stardust.ui.web-f93c598126fb4052e10c5d31093503a809290c43.zip
org.eclipse.stardust.ui.web-f93c598126fb4052e10c5d31093503a809290c43.tar.gz
org.eclipse.stardust.ui.web-f93c598126fb4052e10c5d31093503a809290c43.tar.bz2
Jira-ID: CRNT-24072
created unique key for scope and non scoped role so that right role get picked to show table result. git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@54568 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/CostsBean.java16
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/ParticipantUtils.java31
2 files changed, 43 insertions, 4 deletions
diff --git a/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/CostsBean.java b/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/CostsBean.java
index 9970da5..5ea103e 100644
--- a/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/CostsBean.java
+++ b/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/CostsBean.java
@@ -53,6 +53,7 @@ import org.eclipse.stardust.ui.web.common.table.DataTable;
import org.eclipse.stardust.ui.web.common.table.SortableTable;
import org.eclipse.stardust.ui.web.common.table.SortableTableComparator;
import org.eclipse.stardust.ui.web.viewscommon.utils.I18nUtils;
+import org.eclipse.stardust.ui.web.viewscommon.utils.ParticipantUtils;
import org.eclipse.stardust.ui.web.viewscommon.utils.ProcessDefinitionUtils;
@@ -194,7 +195,7 @@ public class CostsBean extends UIComponentBean implements ResourcePaths,ViewEven
for (int j = 0; j < allRoles.size(); j++)
{
roleItem = (RoleItem) allRoles.get(j);
- roleSelectItem[j] = new SelectItem(roleItem.getRole().getQualifiedId(), roleItem.getRoleName());
+ roleSelectItem[j] = new SelectItem(ParticipantUtils.getParticipantUniqueKey(roleItem.getRole()), roleItem.getRoleName());
}
}
@@ -225,6 +226,12 @@ public class CostsBean extends UIComponentBean implements ResourcePaths,ViewEven
*/
public void roleChangeListener(ValueChangeEvent event)
{
+ if (!event.getPhaseId().equals(javax.faces.event.PhaseId.INVOKE_APPLICATION))
+ {
+ event.setPhaseId(javax.faces.event.PhaseId.INVOKE_APPLICATION);
+ event.queue();
+ return;
+ }
List<RoleItem> allRoles = WorkflowFacade.getWorkflowFacade().getAllRoles();
@@ -234,11 +241,12 @@ public class CostsBean extends UIComponentBean implements ResourcePaths,ViewEven
if (selectedItem != null && getRoleSelectItem()!=null)
{
for (RoleItem item : allRoles)
- {
- if ( item.getRole().getQualifiedId().equals(selectedItem))
+ {
+ String key = ParticipantUtils.getParticipantUniqueKey(item.getRole());
+ if (selectedItem.equals(key))
{
setSelectedModelParticipant(item.getRole());
- break;
+ break;
}
}
}
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/ParticipantUtils.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/ParticipantUtils.java
index f5a5f63..2889da0 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/ParticipantUtils.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/ParticipantUtils.java
@@ -571,4 +571,35 @@ public class ParticipantUtils
}
return null;
}
+
+ /**
+ * method return unique key for Participant
+ *
+ * @param role
+ * @return
+ */
+ public static String getParticipantUniqueKey(ParticipantInfo participantInfo)
+ {
+ if (participantInfo instanceof ModelParticipantInfo)
+ {
+ ModelParticipantInfo modelParticipantInfo = (ModelParticipantInfo) participantInfo;
+ if (modelParticipantInfo.isDepartmentScoped())
+ {
+ DepartmentInfo departmentInfo = modelParticipantInfo.getDepartment();
+ if (null != departmentInfo)
+ {
+ if (departmentInfo instanceof OrganizationInfo)
+ {
+ OrganizationInfo organizationInfo = (OrganizationInfo) departmentInfo;
+ return modelParticipantInfo.getQualifiedId() + " (" + organizationInfo.getId() + "-"
+ + departmentInfo.getId() + " )";
+ }
+
+ return modelParticipantInfo.getQualifiedId() + "-" + departmentInfo.getId();
+ }
+ }
+ }
+ return participantInfo.getQualifiedId();
+ }
+
}