]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-6937-A: Getting Organization service to work with synchronization.
authorRichard Millet <remillet@yahoo.com>
Wed, 27 Apr 2016 06:08:51 +0000 (23:08 -0700)
committerRichard Millet <remillet@yahoo.com>
Wed, 27 Apr 2016 06:08:51 +0000 (23:08 -0700)
services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityResource.java
services/common/src/main/java/org/collectionspace/services/common/AbstractMultiPartCollectionSpaceResourceImpl.java

index 4ba1a8707a641086670da959d3ce5399c7f1075b..258db30dcb87a5e26c302ff0502ea1e5a01d5005 100644 (file)
@@ -763,6 +763,10 @@ public abstract class AuthorityResource<AuthCommon, AuthItemHandler>
             
                // Get the type of transition we're being asked to make and store it as a context parameter -used by the workflow document handler
             TransitionDef transitionDef = getTransitionDef(targetCtx, transition);
+            if (transitionDef == null) {
+               throw new DocumentException(String.format("The document with ID='%s' does not support the workflow transition '%s'.",
+                               itemIdentifier, transition));
+            }
             ctx.setProperty(WorkflowClient.TRANSITION_ID, transitionDef);
             
             WorkflowDocumentModelHandler handler = createWorkflowDocumentHandler(ctx);
index ade28820ca01d5f34b32204205d1db416a4f1002..19b2513f994256a41f4e031e9027c291cafde036 100644 (file)
@@ -265,6 +265,10 @@ public abstract class AbstractMultiPartCollectionSpaceResourceImpl extends Abstr
             
                // Get the type of transition we're being asked to make and store it as a context parameter -used by the workflow document handler
             TransitionDef transitionDef = getTransitionDef(parentCtx, transition);
+            if (transitionDef == null) {
+               throw new DocumentException(String.format("The document with ID='%s' does not support the workflow transition '%s'.",
+                               csid, transition));
+            }
             ctx.setProperty(WorkflowClient.TRANSITION_ID, transitionDef);
 
             WorkflowDocumentModelHandler handler = createWorkflowDocumentHandler(ctx);