diff --git a/src/main/java/io/iworkflow/core/Client.java b/src/main/java/io/iworkflow/core/Client.java index 25f5a1e5..d6b73927 100644 --- a/src/main/java/io/iworkflow/core/Client.java +++ b/src/main/java/io/iworkflow/core/Client.java @@ -1,5 +1,9 @@ package io.iworkflow.core; +import io.iworkflow.core.exceptions.LongPollTimeoutException; +import io.iworkflow.core.exceptions.NoRunningWorkflowException; +import io.iworkflow.core.exceptions.WorkflowAlreadyStartedException; +import io.iworkflow.core.exceptions.WorkflowNotExistsException; import io.iworkflow.core.mapper.StateMovementMapper; import io.iworkflow.core.persistence.PersistenceOptions; import io.iworkflow.gen.models.ErrorSubStatus; @@ -65,6 +69,7 @@ public UnregisteredClient getUnregisteredClient() { * @param workflowId is required * @param workflowTimeoutSeconds is required * @return runId + * @throws WorkflowAlreadyStartedException if the workflow is already started */ public String startWorkflow( final Class workflowClass, @@ -81,6 +86,7 @@ public String startWorkflow( * @param workflowTimeoutSeconds is required * @param input is optional, can be null * @return runId + * @throws WorkflowAlreadyStartedException if the workflow is already started */ public String startWorkflow( final Class workflowClass, @@ -99,6 +105,10 @@ public String startWorkflow( * @param input is optional, can be null * @param option is optional, can be null * @return runId + * @throws WorkflowAlreadyStartedException if the workflow is already started. + * If using WorkflowAlreadyStartedOptions in WorkflowOptions, the error will be ignored if ignoreAlreadyStartedError is true. + * If ignoreAlreadyStartedError is true and also requestId is set, the requestId will be used to identify the request. The error + * will only be thrown if the requestId is different from the requestId of the existing workflow. */ public String startWorkflow( final Class workflowClass, @@ -119,6 +129,10 @@ public String startWorkflow( * @param input is optional, can be null * @param options is optional, can be null * @return runId + * @throws WorkflowAlreadyStartedException if the workflow is already started. + * If using WorkflowAlreadyStartedOptions in WorkflowOptions, the error will be ignored if ignoreAlreadyStartedError is true. + * If ignoreAlreadyStartedError is true and also requestId is set, the requestId will be used to identify the request. The error + * will only be thrown if the requestId is different from the requestId of the existing workflow. */ public String startWorkflow( final String wfType, @@ -257,9 +271,11 @@ private List convertToSearchAttributeList(final Map type of the output * @return the output result + * @throws WorkflowUncompletedException if the workflow is not COMPLETED + * @throws WorkflowNotExistsException if the workflow is not existing + * @throws LongPollTimeoutException if the long poll timeout */ public T waitForWorkflowCompletion( final Class valueClass, @@ -287,6 +306,14 @@ public T waitForWorkflowCompletion( /** * Use {@link #waitForWorkflowCompletion(Class, String)} instead * It's just a renaming. + * @param type of the output + * @param valueClass required, the type class of the output + * @param workflowId required, the workflowId + * @param workflowRunId optional, can be empty + * @return the output result + * @throws WorkflowUncompletedException if the workflow is not COMPLETED + * @throws WorkflowNotExistsException if the workflow is not existing + * @throws LongPollTimeoutException if the long poll timeout */ @Deprecated public T getSimpleWorkflowResultWithWait( @@ -299,6 +326,13 @@ public T getSimpleWorkflowResultWithWait( /** * Use {@link #waitForWorkflowCompletion(Class, String)} instead * It's just a renaming. + * @param type of the output + * @param valueClass required, the type class of the output + * @param workflowId required, the workflowId + * @return the output result + * @throws WorkflowUncompletedException if the workflow is not COMPLETED + * @throws WorkflowNotExistsException if the workflow is not existing + * @throws LongPollTimeoutException if the long poll timeout */ @Deprecated public T getSimpleWorkflowResultWithWait( @@ -310,14 +344,14 @@ public T getSimpleWorkflowResultWithWait( /** * For most cases, a workflow only has one result(one completion state). * Use this API to retrieve the output of the state without waiting for the workflow to complete. - * If the workflow is not COMPLETED, throw the {@link WorkflowUncompletedException}. - * Else, return the same result as {@link #getSimpleWorkflowResultWithWait(Class, String, String)}. * * @param valueClass required, the type class of the output * @param workflowId required, the workflowId * @param workflowRunId optional, can be empty * @param type of the output * @return the output result + * @throws WorkflowUncompletedException if the workflow is not COMPLETED + * @throws WorkflowNotExistsException if the workflow is not existing */ public T tryGettingSimpleWorkflowResult( final Class valueClass, @@ -329,13 +363,13 @@ public T tryGettingSimpleWorkflowResult( /** * For most cases, a workflow only has one result(one completion state). * Use this API to retrieve the output of the state without waiting for the workflow to complete. - * If the workflow is not COMPLETED, throw the {@link WorkflowUncompletedException}. - * Else, return the same result as {@link #getSimpleWorkflowResultWithWait(Class, String)}. * * @param valueClass required, the type class of the output * @param workflowId required, the workflowId * @param type of the output * @return the output result + * @throws WorkflowUncompletedException if the workflow is not COMPLETED + * @throws WorkflowNotExistsException if the workflow is not existing */ public T tryGettingSimpleWorkflowResult( final Class valueClass, @@ -346,11 +380,13 @@ public T tryGettingSimpleWorkflowResult( /** * In some cases, a workflow may have more than one completion states. * Use this API to retrieve the output of the states with waiting for the workflow to complete. - * If the workflow is not COMPLETED, throw the {@link feign.FeignException.FeignClientException}. * * @param workflowId required, the workflowId * @param workflowRunId optional, can be empty * @return a list of the state output for completion states. User code will figure how to use ObjectEncoder to decode the output + * @throws WorkflowUncompletedException if the workflow is not COMPLETED + * @throws WorkflowNotExistsException if the workflow is not existing + * @throws LongPollTimeoutException if the long poll timeout */ public List getComplexWorkflowResultWithWait( final String workflowId, final String workflowRunId) { @@ -360,10 +396,12 @@ public List getComplexWorkflowResultWithWait( /** * In some cases, a workflow may have more than one completion states. * Use this API to retrieve the output of the states with waiting for the workflow to complete. - * If the workflow is not COMPLETED, throw the {@link feign.FeignException.FeignClientException}. * * @param workflowId required, the workflowId * @return a list of the state output for completion states. User code will figure how to use ObjectEncoder to decode the output + * @throws WorkflowUncompletedException if the workflow is not COMPLETED + * @throws WorkflowNotExistsException if the workflow is not existing + * @throws LongPollTimeoutException if the long poll timeout */ public List getComplexWorkflowResultWithWait(final String workflowId) { return getComplexWorkflowResultWithWait(workflowId, ""); @@ -372,12 +410,12 @@ public List getComplexWorkflowResultWithWait(final String /** * In some cases, a workflow may have more than one completion states. * Use this API to retrieve the output of the states without waiting for the workflow to complete. - * If the workflow is not COMPLETED, throw the {@link WorkflowUncompletedException}. - * Else, return the same result as {@link #getComplexWorkflowResultWithWait(String, String)}. * * @param workflowId required, the workflowId * @param workflowRunId optional, can be empty * @return a list of the state output for completion states. User code will figure how to use ObjectEncoder to decode the output + * @throws WorkflowUncompletedException if the workflow is not COMPLETED + * @throws WorkflowNotExistsException if the workflow is not existing */ public List tryGettingComplexWorkflowResult( final String workflowId, final String workflowRunId) { @@ -387,11 +425,11 @@ public List tryGettingComplexWorkflowResult( /** * In some cases, a workflow may have more than one completion states. * Use this API to retrieve the output of the states without waiting for the workflow to complete. - * If the workflow is not COMPLETED, throw the {@link WorkflowUncompletedException}. - * Else, return the same result as {@link #getComplexWorkflowResultWithWait(String)}. * * @param workflowId required, the workflowId * @return a list of the state output for completion states. User code will figure how to use ObjectEncoder to decode the output + * @throws WorkflowUncompletedException if the workflow is not COMPLETED + * @throws WorkflowNotExistsException if the workflow is not existing */ public List tryGettingComplexWorkflowResult(final String workflowId) { return tryGettingComplexWorkflowResult(workflowId, ""); @@ -405,6 +443,7 @@ public List tryGettingComplexWorkflowResult(final String * @param workflowRunId optional, can be empty * @param signalChannelName required * @param signalValue optional, can be null + * @throws NoRunningWorkflowException if the workflow is not existing or not running */ public void signalWorkflow( final Class workflowClass, @@ -432,6 +471,7 @@ public void signalWorkflow( * @param workflowId required * @param signalChannelName required * @param signalValue optional, can be null + * @throws NoRunningWorkflowException if the workflow is not existing or not running */ public void signalWorkflow( final Class workflowClass, @@ -446,6 +486,7 @@ public void signalWorkflow( * @param workflowRunId optional, can be empty * @param resetWorkflowTypeAndOptions required, the combination parameter for reset * @return the new runId after reset + * @throws WorkflowNotExistsException if the workflow is not existing */ public String resetWorkflow( final String workflowId, @@ -459,6 +500,7 @@ public String resetWorkflow( * @param workflowId required * @param resetWorkflowTypeAndOptions required, the combination parameter for reset * @return the new runId after reset + * @throws WorkflowNotExistsException if the workflow is not existing */ public String resetWorkflow( final String workflowId, @@ -473,6 +515,7 @@ public String resetWorkflow( * @param workflowId required * @param workflowRunId optional, can be empty * @param options optional, can be null. If not set, the workflow status will be CANCELED + * @throws NoRunningWorkflowException if the workflow is not existing or not running */ public void stopWorkflow( final String workflowId, @@ -486,6 +529,7 @@ public void stopWorkflow( * * @param workflowId required * @param options optional, can be null. If not set, the workflow status will be CANCELED + * @throws NoRunningWorkflowException if the workflow is not existing or not running */ public void stopWorkflow( final String workflowId, @@ -498,6 +542,7 @@ public void stopWorkflow( * The workflow status will be CANCELED * * @param workflowId required + * @throws NoRunningWorkflowException if the workflow is not existing or not running */ public void stopWorkflow(final String workflowId) { stopWorkflow(workflowId, "", null); @@ -511,6 +556,7 @@ public void stopWorkflow(final String workflowId) { * @param workflowRunId optional, can be empty * @param keys required, cannot be empty or null * @return the data attributes + * @throws WorkflowNotExistsException if the workflow is not existing */ public Map getWorkflowDataAttributes( final Class workflowClass, @@ -531,6 +577,7 @@ public Map getWorkflowDataAttributes( * @param workflowId required * @param keys required, cannot be empty or null * @return the data attributes + * @throws WorkflowNotExistsException if the workflow is not existing */ public Map getWorkflowDataAttributes( final Class workflowClass, @@ -546,6 +593,7 @@ public Map getWorkflowDataAttributes( * @param workflowId required * @param workflowRunId optional, can be empty * @return the data attributes + * @throws WorkflowNotExistsException if the workflow is not existing */ public Map getAllDataAttributes( final Class workflowClass, @@ -560,6 +608,7 @@ public Map getAllDataAttributes( * @param workflowClass required * @param workflowId required * @return the data attributes + * @throws WorkflowNotExistsException if the workflow is not existing */ public Map getAllDataAttributes( final Class workflowClass, @@ -622,6 +671,7 @@ private Map doGetWorkflowDataAttributes( * @param workflowId required * @param workflowRunId optional, can be empty * @param dataAttributes required + * @throws NoRunningWorkflowException if the workflow is not existing or not running * */ public void setWorkflowDataAttributes( final Class workflowClass, @@ -637,6 +687,7 @@ public void setWorkflowDataAttributes( * @param workflowClass required * @param workflowId required * @param dataAttributes required + * @throws NoRunningWorkflowException if the workflow is not existing or not running * */ public void setWorkflowDataAttributes( final Class workflowClass, @@ -766,6 +817,7 @@ public T newRpcStub(Class workflowClassForRpc, String workflowId) { * @param the input type * @param the output type * @return output + * @throws WorkflowNotExistsException if the workflow is not existing, or not running to accept a write operation in RPC */ public O invokeRPC(RpcDefinitions.RpcFunc1 rpcStubMethod, I input) { return rpcStubMethod.execute(null, input, null, null); @@ -779,6 +831,7 @@ public O invokeRPC(RpcDefinitions.RpcFunc1 rpcStubMethod, I input) * @param the input type * @param the output type * @return output + * @throws WorkflowNotExistsException if the workflow is not existing, or not running to accept a write operation in RPC */ public O invokeRPC(RpcDefinitions.RpcFunc1NoPersistence rpcStubMethod, I input) { return rpcStubMethod.execute(null, input, null); @@ -790,6 +843,7 @@ public O invokeRPC(RpcDefinitions.RpcFunc1NoPersistence rpcStubMeth * @param rpcStubMethod the RPC method from stub created by {@link #newRpcStub(Class, String, String)} * @param the output type * @return output + * @throws WorkflowNotExistsException if the workflow is not existing, or not running to accept a write operation in RPC */ public O invokeRPC(RpcDefinitions.RpcFunc0 rpcStubMethod) { return rpcStubMethod.execute(null, null, null); @@ -801,6 +855,7 @@ public O invokeRPC(RpcDefinitions.RpcFunc0 rpcStubMethod) { * @param rpcStubMethod the RPC method from stub created by {@link #newRpcStub(Class, String, String)} * @param the output type * @return output + * @throws WorkflowNotExistsException if the workflow is not existing, or not running to accept a write operation in RPC */ public O invokeRPC(RpcDefinitions.RpcFunc0NoPersistence rpcStubMethod) { return rpcStubMethod.execute(null, null); @@ -812,6 +867,7 @@ public O invokeRPC(RpcDefinitions.RpcFunc0NoPersistence rpcStubMethod) { * @param rpcStubMethod the RPC method from stub created by {@link #newRpcStub(Class, String, String)} * @param input the input of the RPC method * @param the input type + * @throws WorkflowNotExistsException if the workflow is not existing, or not running to accept a write operation in RPC */ public void invokeRPC(RpcDefinitions.RpcProc1 rpcStubMethod, I input) { rpcStubMethod.execute(null, input, null, null); @@ -823,6 +879,7 @@ public void invokeRPC(RpcDefinitions.RpcProc1 rpcStubMethod, I input) { * @param rpcStubMethod the RPC method from stub created by {@link #newRpcStub(Class, String, String)} * @param input the input of the RPC method * @param the input type + * @throws WorkflowNotExistsException if the workflow is not existing, or not running to accept a write operation in RPC */ public void invokeRPC(RpcDefinitions.RpcProc1NoPersistence rpcStubMethod, I input) { rpcStubMethod.execute(null, input, null); @@ -832,6 +889,7 @@ public void invokeRPC(RpcDefinitions.RpcProc1NoPersistence rpcStubMethod, * invoking the RPC through RPC stub * * @param rpcStubMethod the RPC method from stub created by {@link #newRpcStub(Class, String, String)} + * @throws WorkflowNotExistsException if the workflow is not existing, or not running to accept a write operation in RPC */ public void invokeRPC(RpcDefinitions.RpcProc0 rpcStubMethod) { rpcStubMethod.execute(null, null, null); @@ -841,6 +899,7 @@ public void invokeRPC(RpcDefinitions.RpcProc0 rpcStubMethod) { * invoking the RPC through RPC stub * * @param rpcStubMethod the RPC method from stub created by {@link #newRpcStub(Class, String, String)} + * @throws WorkflowNotExistsException if the workflow is not existing, or not running to accept a write operation in RPC */ public void invokeRPC(RpcDefinitions.RpcProc0NoPersistence rpcStubMethod) { rpcStubMethod.execute(null, null); @@ -854,6 +913,7 @@ public void invokeRPC(RpcDefinitions.RpcProc0NoPersistence rpcStubMethod) { * @param workflowRunId optional, can be empty * @param attributeKeys required, cannot be empty or null * @return the search attributes + * @throws WorkflowNotExistsException if the workflow is not existing */ public Map getWorkflowSearchAttributes( final Class workflowClass, @@ -873,6 +933,7 @@ public Map getWorkflowSearchAttributes( * @param workflowId required * @param attributeKeys required, cannot be empty or null * @return the search attributes + * @throws WorkflowNotExistsException if the workflow is not existing */ public Map getWorkflowSearchAttributes( final Class workflowClass, @@ -888,6 +949,7 @@ public Map getWorkflowSearchAttributes( * @param workflowId required * @param workflowRunId optional, can be empty * @return the search attributes + * @throws WorkflowNotExistsException if the workflow is not existing */ public Map getAllSearchAttributes( final Class workflowClass, @@ -903,6 +965,7 @@ public Map getAllSearchAttributes( * @param workflowClass required * @param workflowId required * @param searchAttributes required + * @throws NoRunningWorkflowException if the workflow is not existing or not running * */ public void setWorkflowSearchAttributes( final Class workflowClass, @@ -918,6 +981,7 @@ public void setWorkflowSearchAttributes( * @param workflowId required * @param workflowRunId optional, can be empty * @param searchAttributes required + * @throws NoRunningWorkflowException if the workflow is not existing or not running * */ public void setWorkflowSearchAttributes( final Class workflowClass, @@ -933,6 +997,7 @@ public void setWorkflowSearchAttributes( * @param workflowClass required * @param workflowId required * @return the search attributes + * @throws WorkflowNotExistsException if the workflow is not existing */ public Map getAllSearchAttributes( final Class workflowClass, @@ -947,6 +1012,7 @@ public Map getAllSearchAttributes( * @param workflowId required * @param workflowRunId optional, can be empty * @return the workflow's info + * @throws WorkflowNotExistsException if the workflow is not existing */ public WorkflowInfo describeWorkflow( final String workflowId, @@ -963,6 +1029,7 @@ public WorkflowInfo describeWorkflow( * * @param workflowId required * @return the workflow's info + * @throws WorkflowNotExistsException if the workflow is not existing */ public WorkflowInfo describeWorkflow( final String workflowId) { @@ -1106,9 +1173,10 @@ public void skipTimer( * A long poll API to wait for the completion of the state. This only waits for the first completion. * Note 1 The stateCompletion to wait for is needed to registered on starting workflow due to limitation in https://github.com/indeedeng/iwf/issues/349 * Note 2 The max polling time is configured as clientOptions as the Feign client timeout(default to 10s) - * If the state is not COMPLETED, throw the {@link ClientSideException} with the sub status of {@link ErrorSubStatus#LONG_POLL_TIME_OUT_SUB_STATUS} * @param workflowId the workflowId * @param stateClass the state class. + * @throws LongPollTimeoutException if the long poll timeout + * @throws WorkflowNotExistsException if the workflow is not existing */ public void waitForStateExecutionCompletion( final String workflowId, @@ -1124,6 +1192,8 @@ public void waitForStateExecutionCompletion( * @param workflowId the workflowId * @param stateClass the state class * @param waitForKey key provided by the client and to identity workflow + * @throws LongPollTimeoutException if the long poll timeout + * @throws WorkflowNotExistsException if the workflow is not existing */ public void waitForStateExecutionCompletion( final String workflowId, @@ -1141,6 +1211,8 @@ public void waitForStateExecutionCompletion( * @param workflowId the workflowId * @param stateClass the state class * @param stateExecutionNumber the state execution number. E.g. if it's 2, it means the 2nd execution of the state + * @throws LongPollTimeoutException if the long poll timeout + * @throws WorkflowNotExistsException if the workflow is not existing */ public void waitForStateExecutionCompletion( final String workflowId, diff --git a/src/main/java/io/iworkflow/core/Context.java b/src/main/java/io/iworkflow/core/Context.java index 01a7e549..e4dbd9da 100644 --- a/src/main/java/io/iworkflow/core/Context.java +++ b/src/main/java/io/iworkflow/core/Context.java @@ -8,6 +8,10 @@ public abstract class Context { public abstract Long getWorkflowStartTimestampSeconds(); + /** + * @return the StateExecutionId. + * Only applicable for state methods (waitUntil or execute) + */ public abstract Optional getStateExecutionId(); public abstract String getWorkflowRunId(); @@ -16,11 +20,20 @@ public abstract class Context { public abstract String getWorkflowType(); - // this is the start time of the first attempt of the API call. It's from ScheduledTimestamp of Cadence/Temporal activity.GetInfo - // require server version 1.2.2+, return -1 if server version is lower + /** + * @return the start time of the first attempt of the state method invocation. + * Only applicable for state methods (waitUntil or execute) + */ public abstract Optional getFirstAttemptTimestampSeconds(); - // Attempt starts from 1, and increased by 1 for every retry if retry policy is specified. It's from Attempt of Cadence/Temporal activity.GetInfo - // require server version 1.2.2+, return -1 if server version is lower + /** + * @return attempt starts from 1, and increased by 1 for every retry if retry policy is specified. + */ public abstract Optional getAttempt(); + + /** + * @return the requestId that is used to start the child workflow from state method. + * Only applicable for state methods (waitUntil or execute) + */ + public abstract Optional getChildWorkflowRequestId(); } diff --git a/src/main/java/io/iworkflow/core/RPC.java b/src/main/java/io/iworkflow/core/RPC.java index c85da78f..f8c921fc 100644 --- a/src/main/java/io/iworkflow/core/RPC.java +++ b/src/main/java/io/iworkflow/core/RPC.java @@ -38,6 +38,7 @@ * Only used when workflow has enabled {@link PersistenceOptions} CachingPersistenceByMemo * By default, it's false for high throughput support * flip to true to bypass the caching for strong consistent reads + * @return true if bypass caching for strong consistency */ boolean bypassCachingForStrongConsistency() default false; } \ No newline at end of file diff --git a/src/main/java/io/iworkflow/core/StateDecision.java b/src/main/java/io/iworkflow/core/StateDecision.java index bd8c9276..aad6c674 100644 --- a/src/main/java/io/iworkflow/core/StateDecision.java +++ b/src/main/java/io/iworkflow/core/StateDecision.java @@ -182,7 +182,7 @@ public static StateDecision singleNextState(final Class stateClass, final Object stateInput) { return singleNextState(stateClass.getSimpleName(), stateInput, null); diff --git a/src/main/java/io/iworkflow/core/WorkerService.java b/src/main/java/io/iworkflow/core/WorkerService.java index ff4e2698..ee8c8e30 100644 --- a/src/main/java/io/iworkflow/core/WorkerService.java +++ b/src/main/java/io/iworkflow/core/WorkerService.java @@ -388,6 +388,7 @@ private Context fromIdlContext(final io.iworkflow.gen.models.Context context, fi .workflowRunId(context.getWorkflowRunId()) .workflowStartTimestampSeconds(context.getWorkflowStartedTimestamp()) .stateExecutionId(Optional.ofNullable(context.getStateExecutionId())) + .childWorkflowRequestId(context.getWorkflowRunId()+"-"+context.getStateExecutionId()) .attempt(attempt) .firstAttemptTimestampSeconds(firstAttemptTimestamp) .build(); diff --git a/src/main/java/io/iworkflow/core/communication/Communication.java b/src/main/java/io/iworkflow/core/communication/Communication.java index 748760d8..71d6ec8a 100644 --- a/src/main/java/io/iworkflow/core/communication/Communication.java +++ b/src/main/java/io/iworkflow/core/communication/Communication.java @@ -16,8 +16,7 @@ public interface Communication { * trigger new state movements as the RPC results * NOTE: closing workflows like completing/failing are not supported * NOTE: Only used in RPC -- cannot be used in state APIs - * - * @param stateMovements + * @param stateMovements the state movements to trigger */ void triggerStateMovements(final StateMovement... stateMovements); } diff --git a/src/main/java/io/iworkflow/core/exceptions/NoRunningWorkflowException.java b/src/main/java/io/iworkflow/core/exceptions/NoRunningWorkflowException.java index 6bd94c9d..f20a8f04 100644 --- a/src/main/java/io/iworkflow/core/exceptions/NoRunningWorkflowException.java +++ b/src/main/java/io/iworkflow/core/exceptions/NoRunningWorkflowException.java @@ -2,7 +2,12 @@ import io.iworkflow.core.ClientSideException; -public class NoRunningWorkflowException extends WorkflowNotExistsOrOpenException { +/** + * A friendly named exception to indicate that the workflow does not exist or exists but not running. + * It's the same as {@link WorkflowNotExistsException} but with a different name. + * It's subclass of {@link ClientSideException} with ErrorSubStatus.WORKFLOW_NOT_EXISTS_SUB_STATUS + */ +public class NoRunningWorkflowException extends WorkflowNotExistsException { public NoRunningWorkflowException( final ClientSideException exception) { super(exception); diff --git a/src/main/java/io/iworkflow/core/exceptions/WorkflowNotExistsException.java b/src/main/java/io/iworkflow/core/exceptions/WorkflowNotExistsException.java new file mode 100644 index 00000000..dd29852e --- /dev/null +++ b/src/main/java/io/iworkflow/core/exceptions/WorkflowNotExistsException.java @@ -0,0 +1,14 @@ +package io.iworkflow.core.exceptions; + +import io.iworkflow.core.ClientSideException; + +/** + * A friendly named exception to indicate that the workflow does not exist + * It's subclass of {@link ClientSideException} with ErrorSubStatus.WORKFLOW_NOT_EXISTS_SUB_STATUS + */ +public class WorkflowNotExistsException extends ClientSideException { + public WorkflowNotExistsException( + final ClientSideException exception) { + super(exception); + } +} diff --git a/src/main/java/io/iworkflow/core/exceptions/WorkflowNotExistsOrOpenException.java b/src/main/java/io/iworkflow/core/exceptions/WorkflowNotExistsOrOpenException.java deleted file mode 100644 index 94471233..00000000 --- a/src/main/java/io/iworkflow/core/exceptions/WorkflowNotExistsOrOpenException.java +++ /dev/null @@ -1,14 +0,0 @@ -package io.iworkflow.core.exceptions; - -import io.iworkflow.core.ClientSideException; - -/** - * @deprecated Use NoRunningWorkflowException instead - */ -@Deprecated -public class WorkflowNotExistsOrOpenException extends ClientSideException { - public WorkflowNotExistsOrOpenException( - final ClientSideException exception) { - super(exception); - } -}