summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntje Fuhrmann2012-11-20 06:26:49 (EST)
committerSven Rottstock2012-11-20 06:26:49 (EST)
commitd9b34ffb99e3a0c21ec6923d212eda7b2766d9df (patch)
tree5bb265e16d67501ee99feacc09c70fbd6dbbe239
parente04d827403cefe1194b83023b76d7ed86dc0fb0f (diff)
downloadorg.eclipse.stardust.engine-d9b34ffb99e3a0c21ec6923d212eda7b2766d9df.zip
org.eclipse.stardust.engine-d9b34ffb99e3a0c21ec6923d212eda7b2766d9df.tar.gz
org.eclipse.stardust.engine-d9b34ffb99e3a0c21ec6923d212eda7b2766d9df.tar.bz2
Jira-ID: CRNT-27081
Pending activities in a user work list of a scoped role cannot be activated/suspended. git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/engine@60955 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/runtime/beans/ActivityInstanceBean.java9
-rw-r--r--stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/runtime/beans/WorkflowServiceImpl.java20
2 files changed, 25 insertions, 4 deletions
diff --git a/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/runtime/beans/ActivityInstanceBean.java b/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/runtime/beans/ActivityInstanceBean.java
index 6caaa2c..4e6c505 100644
--- a/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/runtime/beans/ActivityInstanceBean.java
+++ b/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/runtime/beans/ActivityInstanceBean.java
@@ -1880,6 +1880,11 @@ public class ActivityInstanceBean extends AttributedIdentifiablePersistentBean
public void delegateToUser(IUser user) throws AccessForbiddenException
{
+ internalDelegateToUser(user, true);
+ }
+
+ void internalDelegateToUser(IUser user, boolean checkPermissionToDelegate)
+ {
assertDelegationGranted();
IModelParticipant performer = getActivity().getPerformer();
@@ -1893,7 +1898,8 @@ public class ActivityInstanceBean extends AttributedIdentifiablePersistentBean
if (performer.isAuthorized(user))
{
- if (DepartmentUtils.getFirstScopedOrganization(performer) != null)
+ if (checkPermissionToDelegate
+ && DepartmentUtils.getFirstScopedOrganization(performer) != null)
{
AccessForbiddenException exception = null;
Iterator<UserParticipantLink> links = user.getAllParticipantLinks();
@@ -1931,7 +1937,6 @@ public class ActivityInstanceBean extends AttributedIdentifiablePersistentBean
BpmRuntimeError.BPMRT_USER_IS_NOT_AUTHORIZED_TO_PERFORM_AI.raise(
user.getOID(), getOID()));
}
-
}
public void delegateToUserGroup(IUserGroup userGroup) throws AccessForbiddenException
diff --git a/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/runtime/beans/WorkflowServiceImpl.java b/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/runtime/beans/WorkflowServiceImpl.java
index f7fc73b..63e6218 100644
--- a/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/runtime/beans/WorkflowServiceImpl.java
+++ b/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/runtime/beans/WorkflowServiceImpl.java
@@ -849,7 +849,15 @@ public class WorkflowServiceImpl implements Serializable, WorkflowService
if (activityInstance.getActivity().isInteractive() && null != currentUser
&& 0 != currentUser.getOID())
{
- activityInstance.delegateToUser(currentUser);
+ if (activityInstance instanceof ActivityInstanceBean)
+ {
+ ((ActivityInstanceBean) activityInstance).internalDelegateToUser(currentUser,
+ false);
+ }
+ else
+ {
+ activityInstance.delegateToUser(currentUser);
+ }
}
activityInstance.activate();
@@ -946,7 +954,15 @@ public class WorkflowServiceImpl implements Serializable, WorkflowService
}
else if (participant instanceof IUser)
{
- activityInstance.delegateToUser((IUser) participant);
+ if (activityInstance instanceof ActivityInstanceBean)
+ {
+ ((ActivityInstanceBean) activityInstance).internalDelegateToUser(
+ (IUser) participant, false);
+ }
+ else
+ {
+ activityInstance.delegateToUser((IUser) participant);
+ }
}
else if (participant instanceof IUserGroup)
{