summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2012-05-17 07:49:49 (EDT)
committer Manik Kishore2012-06-19 07:30:01 (EDT)
commit42746ff1cb4aeafe7f2ea086e459faaed9d07783 (patch)
treeef046e84965c203f3e89068375b2b8a5a3a128ab
parent2898be69fa6e9a091fc2030fa3027140cbad2e45 (diff)
downloadorg.eclipse.stardust.ui.web-42746ff1cb4aeafe7f2ea086e459faaed9d07783.zip
org.eclipse.stardust.ui.web-42746ff1cb4aeafe7f2ea086e459faaed9d07783.tar.gz
org.eclipse.stardust.ui.web-42746ff1cb4aeafe7f2ea086e459faaed9d07783.tar.bz2
Jira-ID: CRNT-23507
1)Added code to retrieve the Department Info of Participant using ModelParticipantInfo 2)Created a method getDepartmentLabel(DepartmentInfo) to parse the department Name. git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@56414 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/process/history/EventHistoryItem.java43
1 files changed, 42 insertions, 1 deletions
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/process/history/EventHistoryItem.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/process/history/EventHistoryItem.java
index 72fbb4a..07da805 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/process/history/EventHistoryItem.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/process/history/EventHistoryItem.java
@@ -13,8 +13,11 @@ package org.eclipse.stardust.ui.web.viewscommon.process.history;
import java.util.Date;
import org.eclipse.stardust.common.StringUtils;
+import org.eclipse.stardust.engine.api.dto.DepartmentDetails;
+import org.eclipse.stardust.engine.api.model.ModelParticipantInfo;
import org.eclipse.stardust.engine.api.model.Participant;
import org.eclipse.stardust.engine.api.runtime.ActivityInstanceState;
+import org.eclipse.stardust.engine.api.runtime.DepartmentInfo;
import org.eclipse.stardust.engine.api.runtime.HistoricalEvent;
import org.eclipse.stardust.engine.api.runtime.HistoricalEventDescriptionDelegation;
import org.eclipse.stardust.engine.api.runtime.HistoricalEventDescriptionStateChange;
@@ -68,15 +71,30 @@ public class EventHistoryItem extends AbstractProcessHistoryTableEntry
Participant from = delDescr.getFromPerformer();
Participant to = delDescr.getToPerformer();
StringBuffer buffer = new StringBuffer();
+ ModelParticipantInfo modelParticipant;
+ String deptName = null;
String tmpDetail = I18nUtils.getParticipantName(from);
if (from != null && !StringUtils.isEmpty(tmpDetail))
{
- buffer.append(tmpDetail).append(" ");
+ buffer.append(tmpDetail);
+ if (from instanceof ModelParticipantInfo)
+ {
+ modelParticipant = (ModelParticipantInfo) from;
+ deptName = getDepartmentLabel(modelParticipant.getDepartment());
+ }
+ buffer.append(StringUtils.isNotEmpty(deptName) ? deptName : " ");
}
tmpDetail = I18nUtils.getParticipantName(to);
+ deptName = null;
if (to != null && !StringUtils.isEmpty(tmpDetail))
{
buffer.append("-> ").append(tmpDetail);
+ if (to instanceof ModelParticipantInfo)
+ {
+ modelParticipant = (ModelParticipantInfo) to;
+ deptName = getDepartmentLabel(modelParticipant.getDepartment());
+ }
+ buffer.append(StringUtils.isNotEmpty(deptName) ? deptName : "");
}
fullDetail = buffer.toString();
break;
@@ -154,6 +172,29 @@ public class EventHistoryItem extends AbstractProcessHistoryTableEntry
performer = user != null ? I18nUtils.getUserLabel(user) : null;
}
+ /**
+ *
+ * @param department
+ * @return
+ */
+ private String getDepartmentLabel(DepartmentInfo department)
+ {
+ StringBuffer deptString = new StringBuffer();
+ if (null != department)
+ {
+ DepartmentDetails deptDetail = (DepartmentDetails) department;
+ if (deptDetail.getOrganization().isDepartmentScoped())
+ {
+ deptString.append(" - ").append(department.getName()).toString();
+ }
+ }
+ else
+ {
+ return null;
+ }
+ return deptString.toString();
+ }
+
public String getName()
{
return name;