From: Richard Millet Date: Wed, 27 Apr 2016 06:08:51 +0000 (-0700) Subject: CSPACE-6937-A: Getting Organization service to work with synchronization. X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=155e1c0c9c1ba4b65f18b98385ca17cf756ebf38;p=tmp%2Fjakarta-migration.git CSPACE-6937-A: Getting Organization service to work with synchronization. --- diff --git a/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityResource.java b/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityResource.java index 4ba1a8707..258db30dc 100644 --- a/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityResource.java +++ b/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityResource.java @@ -763,6 +763,10 @@ public abstract class AuthorityResource // 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); diff --git a/services/common/src/main/java/org/collectionspace/services/common/AbstractMultiPartCollectionSpaceResourceImpl.java b/services/common/src/main/java/org/collectionspace/services/common/AbstractMultiPartCollectionSpaceResourceImpl.java index ade28820c..19b2513f9 100644 --- a/services/common/src/main/java/org/collectionspace/services/common/AbstractMultiPartCollectionSpaceResourceImpl.java +++ b/services/common/src/main/java/org/collectionspace/services/common/AbstractMultiPartCollectionSpaceResourceImpl.java @@ -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);