diff --git a/api/src/main/java/io/serverlessworkflow/api/interfaces/State.java b/api/src/main/java/io/serverlessworkflow/api/interfaces/State.java index 556babae..00c8f114 100644 --- a/api/src/main/java/io/serverlessworkflow/api/interfaces/State.java +++ b/api/src/main/java/io/serverlessworkflow/api/interfaces/State.java @@ -19,6 +19,7 @@ import io.serverlessworkflow.api.error.Error; import io.serverlessworkflow.api.filters.StateDataFilter; import io.serverlessworkflow.api.states.DefaultState.Type; +import io.serverlessworkflow.api.timeouts.TimeoutsDefinition; import io.serverlessworkflow.api.transitions.Transition; import java.util.List; @@ -43,4 +44,6 @@ public interface State { String getCompensatedBy(); Map getMetadata(); + + TimeoutsDefinition getTimeouts(); } \ No newline at end of file diff --git a/api/src/main/java/io/serverlessworkflow/api/mapper/WorkflowModule.java b/api/src/main/java/io/serverlessworkflow/api/mapper/WorkflowModule.java index 17db57d9..9a154262 100644 --- a/api/src/main/java/io/serverlessworkflow/api/mapper/WorkflowModule.java +++ b/api/src/main/java/io/serverlessworkflow/api/mapper/WorkflowModule.java @@ -34,6 +34,7 @@ import io.serverlessworkflow.api.states.DefaultState; import io.serverlessworkflow.api.states.OperationState; import io.serverlessworkflow.api.states.ParallelState; +import io.serverlessworkflow.api.timeouts.TimeoutsDefinition; import io.serverlessworkflow.api.transitions.Transition; import io.serverlessworkflow.api.workflow.*; diff --git a/api/src/main/java/io/serverlessworkflow/api/serializers/WorkflowSerializer.java b/api/src/main/java/io/serverlessworkflow/api/serializers/WorkflowSerializer.java index 3185a1c7..c2db774a 100644 --- a/api/src/main/java/io/serverlessworkflow/api/serializers/WorkflowSerializer.java +++ b/api/src/main/java/io/serverlessworkflow/api/serializers/WorkflowSerializer.java @@ -98,10 +98,6 @@ public void serialize(Workflow workflow, workflow.getExpressionLang()); } - if (workflow.getExecTimeout() != null) { - gen.writeObjectField("execTimeout", workflow.getExecTimeout()); - } - if (workflow.isKeepActive()) { gen.writeBooleanField("keepActive", workflow.isKeepActive()); } @@ -159,6 +155,10 @@ public void serialize(Workflow workflow, gen.writeObjectField("constants", workflow.getConstants().getConstantsDef()); } + if(workflow.getTimeouts() != null ) { + gen.writeObjectField("timeouts", workflow.getTimeouts()); + } + if (workflow.getStates() != null && !workflow.getStates().isEmpty()) { gen.writeArrayFieldStart("states"); for (State state : workflow.getStates()) { diff --git a/api/src/main/java/io/serverlessworkflow/api/workflow/Constants.java b/api/src/main/java/io/serverlessworkflow/api/workflow/Constants.java index 07deea41..40e3e430 100644 --- a/api/src/main/java/io/serverlessworkflow/api/workflow/Constants.java +++ b/api/src/main/java/io/serverlessworkflow/api/workflow/Constants.java @@ -23,6 +23,16 @@ public class Constants { private String refValue; private JsonNode constantsDef; + public Constants() {} + + public Constants(String refValue) { + this.refValue = refValue; + } + + public Constants(JsonNode constantsDef) { + this.constantsDef = constantsDef; + } + public String getRefValue() { return refValue; } diff --git a/api/src/main/java/io/serverlessworkflow/api/workflow/Secrets.java b/api/src/main/java/io/serverlessworkflow/api/workflow/Secrets.java index 4a38257d..aca18f99 100644 --- a/api/src/main/java/io/serverlessworkflow/api/workflow/Secrets.java +++ b/api/src/main/java/io/serverlessworkflow/api/workflow/Secrets.java @@ -21,6 +21,16 @@ public class Secrets { private String refValue; private List secretDefs; + public Secrets() {} + + public Secrets(String refValue) { + this.refValue = refValue; + } + + public Secrets(List secretDefs) { + this.secretDefs = secretDefs; + } + public String getRefValue() { return refValue; } diff --git a/api/src/main/resources/schema/actions/action.json b/api/src/main/resources/schema/actions/action.json index 883c23c3..de6caded 100644 --- a/api/src/main/resources/schema/actions/action.json +++ b/api/src/main/resources/schema/actions/action.json @@ -19,10 +19,6 @@ "description": "References a sub-workflow to invoke", "$ref": "../functions/subflowref.json" }, - "timeout": { - "type": "string", - "description": "Time period to wait for function execution to complete" - }, "actionDataFilter": { "$ref": "../filters/actiondatafilter.json" } diff --git a/api/src/main/resources/schema/branches/branch.json b/api/src/main/resources/schema/branches/branch.json index 551d570d..cdfdb6d0 100644 --- a/api/src/main/resources/schema/branches/branch.json +++ b/api/src/main/resources/schema/branches/branch.json @@ -14,6 +14,9 @@ "type": "object", "$ref": "../actions/action.json" } + }, + "timeouts": { + "$ref": "../timeouts/timeoutsdef.json" } }, "oneOf": [ diff --git a/api/src/main/resources/schema/states/callbackstate.json b/api/src/main/resources/schema/states/callbackstate.json index 3cef4586..c8a2c5a7 100644 --- a/api/src/main/resources/schema/states/callbackstate.json +++ b/api/src/main/resources/schema/states/callbackstate.json @@ -17,10 +17,6 @@ "type" : "string", "description": "References an unique callback event name in the defined workflow events" }, - "timeout": { - "type": "string", - "description": "Time period to wait for incoming events (ISO 8601 format)" - }, "eventDataFilter": { "description": "Callback event data filter definition", "$ref": "../filters/eventdatafilter.json" diff --git a/api/src/main/resources/schema/states/defaultstate.json b/api/src/main/resources/schema/states/defaultstate.json index 45a5afac..9b76dd4b 100644 --- a/api/src/main/resources/schema/states/defaultstate.json +++ b/api/src/main/resources/schema/states/defaultstate.json @@ -57,6 +57,9 @@ "type": "string", "minLength": 1, "description": "Unique Name of a workflow state which is responsible for compensation of this state" + }, + "timeouts": { + "$ref": "../timeouts/timeoutsdef.json" } }, "required": [ diff --git a/api/src/main/resources/schema/states/eventstate.json b/api/src/main/resources/schema/states/eventstate.json index f6278968..e476c2ca 100644 --- a/api/src/main/resources/schema/states/eventstate.json +++ b/api/src/main/resources/schema/states/eventstate.json @@ -21,10 +21,6 @@ "type": "object", "$ref": "../events/onevents.json" } - }, - "timeout": { - "type": "string", - "description": "Time period to wait for incoming events (ISO 8601 format)" } }, "required": [ diff --git a/api/src/main/resources/schema/states/switchstate.json b/api/src/main/resources/schema/states/switchstate.json index b9fda118..b4f6263c 100644 --- a/api/src/main/resources/schema/states/switchstate.json +++ b/api/src/main/resources/schema/states/switchstate.json @@ -25,10 +25,6 @@ "$ref": "../switchconditions/datacondition.json" } }, - "eventTimeout": { - "type": "string", - "description": "If eventConditions is used, defines the time period to wait for events (ISO 8601 format)" - }, "defaultCondition": { "description": "Default transition of the workflow if there is no matching data conditions. Can include a transition or end definition", "$ref": "../defaultcondition/defaultconditiondef.json" diff --git a/api/src/main/resources/schema/timeouts/timeoutsdef.json b/api/src/main/resources/schema/timeouts/timeoutsdef.json new file mode 100644 index 00000000..abb4ecc2 --- /dev/null +++ b/api/src/main/resources/schema/timeouts/timeoutsdef.json @@ -0,0 +1,31 @@ +{ + "type": "object", + "javaType": "io.serverlessworkflow.api.timeouts.TimeoutsDefinition", + "description": "Timeouts Definition", + "properties": { + "workflowExecTimeout": { + "$ref": "workflowexectimeout.json" + }, + "stateExecTimeout": { + "type": "string", + "description": "State execution timeout duration (ISO 8601 duration format)", + "minLength": 1 + }, + "actionExecTimeout": { + "type": "string", + "description": "Single actions definition execution timeout duration (ISO 8601 duration format)", + "minLength": 1 + }, + "branchExecTimeout": { + "type": "string", + "description": "Single branch execution timeout duration (ISO 8601 duration format)", + "minLength": 1 + }, + "eventTimeout": { + "type": "string", + "description": "Timeout duration to wait for consuming defined events (ISO 8601 duration format)", + "minLength": 1 + } + }, + "required": [] +} \ No newline at end of file diff --git a/api/src/main/resources/schema/exectimeout/exectimeout.json b/api/src/main/resources/schema/timeouts/workflowexectimeout.json similarity index 70% rename from api/src/main/resources/schema/exectimeout/exectimeout.json rename to api/src/main/resources/schema/timeouts/workflowexectimeout.json index 6db50989..9010b1e4 100644 --- a/api/src/main/resources/schema/exectimeout/exectimeout.json +++ b/api/src/main/resources/schema/timeouts/workflowexectimeout.json @@ -1,16 +1,16 @@ { "type": "object", - "javaType": "io.serverlessworkflow.api.exectimeout.ExecTimeout", + "javaType": "io.serverlessworkflow.api.timeouts.WorkflowExecTimeout", "properties": { "duration": { "type": "string", - "description": "Timeout duration (ISO 8601 duration format)", + "description": "Workflow execution timeout duration (ISO 8601 duration format). If not specified should be 'unlimited'", "minLength": 1 }, "interrupt": { "type": "boolean", "description": "If `false`, workflow instance is allowed to finish current execution. If `true`, current workflow execution is abrupted.", - "default": false + "default": true }, "runBefore": { "type": "string", diff --git a/api/src/main/resources/schema/workflow.json b/api/src/main/resources/schema/workflow.json index ed26cd54..ff5b1a7f 100644 --- a/api/src/main/resources/schema/workflow.json +++ b/api/src/main/resources/schema/workflow.json @@ -45,10 +45,6 @@ "default": "jq", "minLength": 1 }, - "execTimeout": { - "description": "Workflow execution timeout", - "$ref": "exectimeout/exectimeout.json" - }, "keepActive": { "type": "boolean", "default": false, @@ -82,6 +78,9 @@ "existingJavaType": "io.serverlessworkflow.api.workflow.Constants", "description": "Workflow constants definitions" }, + "timeouts": { + "$ref": "timeouts/timeoutsdef.json" + }, "states": { "type": "array", "description": "State Definitions", diff --git a/api/src/test/java/io/serverlessworkflow/api/test/MarkupToWorkflowTest.java b/api/src/test/java/io/serverlessworkflow/api/test/MarkupToWorkflowTest.java index 982b266f..714faa61 100644 --- a/api/src/test/java/io/serverlessworkflow/api/test/MarkupToWorkflowTest.java +++ b/api/src/test/java/io/serverlessworkflow/api/test/MarkupToWorkflowTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.databind.JsonNode; import io.serverlessworkflow.api.Workflow; import io.serverlessworkflow.api.actions.Action; +import io.serverlessworkflow.api.branches.Branch; import io.serverlessworkflow.api.datainputschema.DataInputSchema; import io.serverlessworkflow.api.defaultdef.DefaultConditionDefinition; -import io.serverlessworkflow.api.exectimeout.ExecTimeout; import io.serverlessworkflow.api.functions.FunctionDefinition; import io.serverlessworkflow.api.functions.FunctionRef; import io.serverlessworkflow.api.functions.SubFlowRef; @@ -28,9 +28,11 @@ import io.serverlessworkflow.api.retry.RetryDefinition; import io.serverlessworkflow.api.states.EventState; import io.serverlessworkflow.api.states.OperationState; +import io.serverlessworkflow.api.states.ParallelState; import io.serverlessworkflow.api.states.SwitchState; import io.serverlessworkflow.api.switchconditions.DataCondition; import io.serverlessworkflow.api.test.utils.WorkflowTestUtils; +import io.serverlessworkflow.api.timeouts.WorkflowExecTimeout; import io.serverlessworkflow.api.workflow.Constants; import io.serverlessworkflow.api.workflow.Retries; import io.serverlessworkflow.api.workflow.Secrets; @@ -255,9 +257,10 @@ public void testKeepActiveExecTimeout(String workflowLocation) { assertNotNull(workflow.getStates()); assertTrue(workflow.isKeepActive()); - assertNotNull(workflow.getExecTimeout()); + assertNotNull(workflow.getTimeouts()); + assertNotNull(workflow.getTimeouts().getWorkflowExecTimeout()); - ExecTimeout execTimeout = workflow.getExecTimeout(); + WorkflowExecTimeout execTimeout = workflow.getTimeouts().getWorkflowExecTimeout(); assertEquals("PT1H", execTimeout.getDuration()); assertEquals("GenerateReport", execTimeout.getRunBefore()); } @@ -545,4 +548,53 @@ public void testConstants(String workflowLocation) { assertEquals("pas", serbianTranslationNode.asText()); } + + @ParameterizedTest + @ValueSource(strings = {"/features/timeouts.json", "/features/timeouts.yml"}) + public void testTimeouts(String workflowLocation) { + Workflow workflow = Workflow.fromSource(WorkflowTestUtils.readWorkflowFile(workflowLocation)); + + assertNotNull(workflow); + assertNotNull(workflow.getId()); + assertNotNull(workflow.getName()); + assertNotNull(workflow.getStates()); + + assertNotNull(workflow.getTimeouts()); + assertNotNull(workflow.getTimeouts().getWorkflowExecTimeout()); + + WorkflowExecTimeout execTimeout = workflow.getTimeouts().getWorkflowExecTimeout(); + assertEquals("PT1H", execTimeout.getDuration()); + assertEquals("GenerateReport", execTimeout.getRunBefore()); + + assertNotNull(workflow.getStates()); + assertEquals(2, workflow.getStates().size()); + assertTrue(workflow.getStates().get(0) instanceof EventState); + + EventState firstState = (EventState) workflow.getStates().get(0); + assertNotNull(firstState.getTimeouts()); + assertNotNull(firstState.getTimeouts().getStateExecTimeout()); + assertNotNull(firstState.getTimeouts().getEventTimeout()); + assertEquals("PT5M", firstState.getTimeouts().getStateExecTimeout()); + assertEquals("PT2M", firstState.getTimeouts().getEventTimeout()); + + + assertTrue(workflow.getStates().get(1) instanceof ParallelState); + ParallelState secondState = (ParallelState) workflow.getStates().get(1); + assertNotNull(secondState.getTimeouts()); + assertNotNull(secondState.getTimeouts().getStateExecTimeout()); + assertEquals("PT5M", secondState.getTimeouts().getStateExecTimeout()); + + assertNotNull(secondState.getBranches()); + assertEquals(2, secondState.getBranches().size()); + List branches = secondState.getBranches(); + + assertNotNull(branches.get(0).getTimeouts()); + assertNotNull(branches.get(0).getTimeouts().getBranchExecTimeout()); + assertEquals("PT3S", branches.get(0).getTimeouts().getBranchExecTimeout()); + + assertNotNull(branches.get(1).getTimeouts()); + assertNotNull(branches.get(1).getTimeouts().getBranchExecTimeout()); + assertEquals("PT4S", branches.get(1).getTimeouts().getBranchExecTimeout()); + + } } diff --git a/api/src/test/resources/examples/checkcarvitals.json b/api/src/test/resources/examples/checkcarvitals.json index fbf48b0a..69f66740 100644 --- a/api/src/test/resources/examples/checkcarvitals.json +++ b/api/src/test/resources/examples/checkcarvitals.json @@ -57,7 +57,9 @@ } } ], - "timeout": "PT2M", + "timeouts": { + "eventTimeout": "PT2M" + }, "transition": "ShouldStopOrContinue" }, { diff --git a/api/src/test/resources/examples/checkcarvitals.yml b/api/src/test/resources/examples/checkcarvitals.yml index 2db78a4b..986036b1 100644 --- a/api/src/test/resources/examples/checkcarvitals.yml +++ b/api/src/test/resources/examples/checkcarvitals.yml @@ -30,7 +30,8 @@ states: - StopVitalsCheck eventDataFilter: toStateData: "${ .stopReceived }" - timeout: PT2M + timeouts: + eventTimeout: PT2M transition: ShouldStopOrContinue - name: ShouldStopOrContinue type: switch diff --git a/api/src/test/resources/examples/creditcheck.json b/api/src/test/resources/examples/creditcheck.json index ac9e0014..b70e191c 100644 --- a/api/src/test/resources/examples/creditcheck.json +++ b/api/src/test/resources/examples/creditcheck.json @@ -40,7 +40,9 @@ } }, "eventRef": "CreditCheckCompletedEvent", - "timeout": "PT15M", + "timeouts": { + "stateExecTimeout": "PT15M" + }, "transition": "EvaluateDecision" }, { diff --git a/api/src/test/resources/examples/creditcheck.yml b/api/src/test/resources/examples/creditcheck.yml index 85c643e7..f2679380 100644 --- a/api/src/test/resources/examples/creditcheck.yml +++ b/api/src/test/resources/examples/creditcheck.yml @@ -24,7 +24,8 @@ states: arguments: customer: "${ .customer }" eventRef: CreditCheckCompletedEvent - timeout: PT15M + timeouts: + stateExecTimeout: PT15M transition: EvaluateDecision - name: EvaluateDecision type: switch diff --git a/api/src/test/resources/examples/eventbasedtransition.json b/api/src/test/resources/examples/eventbasedtransition.json index cad06ca4..841dfa6c 100644 --- a/api/src/test/resources/examples/eventbasedtransition.json +++ b/api/src/test/resources/examples/eventbasedtransition.json @@ -31,7 +31,9 @@ "transition": "HandleRejectedVisa" } ], - "eventTimeout": "PT1H", + "timeouts": { + "eventTimeout": "PT1H" + }, "defaultCondition": { "transition": "HandleNoVisaDecision" } diff --git a/api/src/test/resources/examples/eventbasedtransition.yml b/api/src/test/resources/examples/eventbasedtransition.yml index bb4797ce..9bfd1345 100644 --- a/api/src/test/resources/examples/eventbasedtransition.yml +++ b/api/src/test/resources/examples/eventbasedtransition.yml @@ -19,7 +19,8 @@ states: transition: HandleApprovedVisa - eventRef: visaRejectedEvent transition: HandleRejectedVisa - eventTimeout: PT1H + timeouts: + eventTimeout: PT1H defaultCondition: transition: HandleNoVisaDecision - name: HandleApprovedVisa diff --git a/api/src/test/resources/examples/roomreadings.json b/api/src/test/resources/examples/roomreadings.json index 543276bc..334dae38 100644 --- a/api/src/test/resources/examples/roomreadings.json +++ b/api/src/test/resources/examples/roomreadings.json @@ -4,9 +4,11 @@ "version": "1.0", "specVersion": "0.7", "start": "ConsumeReading", - "execTimeout": { - "duration": "PT1H", - "runBefore": "GenerateReport" + "timeouts": { + "workflowExecTimeout": { + "duration": "PT1H", + "runBefore": "GenerateReport" + } }, "keepActive": true, "states": [ diff --git a/api/src/test/resources/examples/roomreadings.yml b/api/src/test/resources/examples/roomreadings.yml index c0fde4e5..bf18cde8 100644 --- a/api/src/test/resources/examples/roomreadings.yml +++ b/api/src/test/resources/examples/roomreadings.yml @@ -3,9 +3,10 @@ name: Room Temp and Humidity Workflow version: '1.0' specVersion: '0.7' start: ConsumeReading -execTimeout: - duration: PT1H - runBefore: GenerateReport +timeouts: + workflowExecTimeout: + duration: PT1H + runBefore: GenerateReport keepActive: true states: - name: ConsumeReading @@ -44,4 +45,4 @@ functions: - name: LogReading operation: http.myorg.io/ordersservices.json#logreading - name: ProduceReport - operation: http.myorg.io/ordersservices.json#produceReport \ No newline at end of file + operation: http.myorg.io/ordersservices.json#produceReport diff --git a/api/src/test/resources/examples/vetappointmentservice.json b/api/src/test/resources/examples/vetappointmentservice.json index a2bfe926..e956b528 100644 --- a/api/src/test/resources/examples/vetappointmentservice.json +++ b/api/src/test/resources/examples/vetappointmentservice.json @@ -31,10 +31,12 @@ }, "actionDataFilter": { "results": "${ .appointmentInfo }" - }, - "timeout": "PT15M" + } } ], + "timeouts": { + "actionExecTimeout": "PT15M" + }, "end": true } ] diff --git a/api/src/test/resources/examples/vetappointmentservice.yml b/api/src/test/resources/examples/vetappointmentservice.yml index 66216a10..df2f1851 100644 --- a/api/src/test/resources/examples/vetappointmentservice.yml +++ b/api/src/test/resources/examples/vetappointmentservice.yml @@ -22,5 +22,6 @@ states: resultEventRef: VetAppointmentInfo actionDataFilter: results: "${ .appointmentInfo }" - timeout: PT15M - end: true \ No newline at end of file + timeouts: + actionExecTimeout: PT15M + end: true diff --git a/api/src/test/resources/features/keepactiveexectimeout.json b/api/src/test/resources/features/keepactiveexectimeout.json index faec3dda..6e9aeb03 100644 --- a/api/src/test/resources/features/keepactiveexectimeout.json +++ b/api/src/test/resources/features/keepactiveexectimeout.json @@ -3,9 +3,11 @@ "name": "Keep Active and Exec Timeout Test Workflow", "version": "1.0", "specVersion": "0.7", - "execTimeout": { - "duration": "PT1H", - "runBefore": "GenerateReport" + "timeouts": { + "workflowExecTimeout": { + "duration": "PT1H", + "runBefore": "GenerateReport" + } }, "keepActive": true, "states": [ diff --git a/api/src/test/resources/features/keepactiveexectimeout.yml b/api/src/test/resources/features/keepactiveexectimeout.yml index 77a0d58b..dc143b94 100644 --- a/api/src/test/resources/features/keepactiveexectimeout.yml +++ b/api/src/test/resources/features/keepactiveexectimeout.yml @@ -2,8 +2,9 @@ id: keepactiveexectimeout name: Keep Active and Exec Timeout Test Workflow version: '1.0' specVersion: '0.7' -execTimeout: - duration: PT1H - runBefore: GenerateReport +timeouts: + workflowExecTimeout: + duration: PT1H + runBefore: GenerateReport keepActive: true -states: [] \ No newline at end of file +states: [] diff --git a/api/src/test/resources/features/timeouts.json b/api/src/test/resources/features/timeouts.json new file mode 100644 index 00000000..619d0010 --- /dev/null +++ b/api/src/test/resources/features/timeouts.json @@ -0,0 +1,52 @@ +{ + "id": "timeouts", + "name": "Timeouts Workflow", + "version": "1.0", + "specVersion": "0.7", + "timeouts": { + "workflowExecTimeout": { + "duration": "PT1H", + "runBefore": "GenerateReport" + } + }, + "start": "FirstState", + "states": [ + { + "name": "FirstState", + "type": "event", + "onEvents": [ + { + "eventRefs": ["someEventRef"] + } + ], + "timeouts": { + "stateExecTimeout": "PT5M", + "eventTimeout": "PT2M" + }, + "transition": "SecondState" + }, + { + "name": "SecondState", + "type": "parallel", + "completionType": "allOf", + "branches": [ + { + "name": "ShortDelayBranch", + "timeouts": { + "branchExecTimeout": "PT3S" + } + }, + { + "name": "LongDelayBranch", + "timeouts": { + "branchExecTimeout": "PT4S" + } + } + ], + "timeouts": { + "stateExecTimeout": "PT5M" + }, + "end": true + } + ] +} \ No newline at end of file diff --git a/api/src/test/resources/features/timeouts.yml b/api/src/test/resources/features/timeouts.yml new file mode 100644 index 00000000..1922052b --- /dev/null +++ b/api/src/test/resources/features/timeouts.yml @@ -0,0 +1,32 @@ +id: timeouts +name: Timeouts Workflow +version: '1.0' +specVersion: '0.7' +timeouts: + workflowExecTimeout: + duration: PT1H + runBefore: GenerateReport +start: FirstState +states: + - name: FirstState + type: event + onEvents: + - eventRefs: + - someEventRef + timeouts: + stateExecTimeout: PT5M + eventTimeout: PT2M + transition: SecondState + - name: SecondState + type: parallel + completionType: allOf + branches: + - name: ShortDelayBranch + timeouts: + branchExecTimeout: PT3S + - name: LongDelayBranch + timeouts: + branchExecTimeout: PT4S + timeouts: + stateExecTimeout: PT5M + end: true diff --git a/api/src/test/resources/features/vetappointment.json b/api/src/test/resources/features/vetappointment.json index c2fc636a..17315d96 100644 --- a/api/src/test/resources/features/vetappointment.json +++ b/api/src/test/resources/features/vetappointment.json @@ -21,10 +21,12 @@ }, "actionDataFilter": { "results": "${ .appointmentInfo }" - }, - "timeout": "PT15M" + } } ], + "timeouts": { + "actionExecTimeout": "PT15M" + }, "onErrors": [ { "error": "TimeoutError", diff --git a/api/src/test/resources/features/vetappointment.yml b/api/src/test/resources/features/vetappointment.yml index 8fa21724..2a1705ea 100644 --- a/api/src/test/resources/features/vetappointment.yml +++ b/api/src/test/resources/features/vetappointment.yml @@ -4,8 +4,8 @@ description: Vet service call via events version: '1.0' specVersion: '0.7' start: MakeVetAppointmentState -events: features/vetappointmenteventrefs.yml -retries: features/vetappointmentretries.yml +events: features/vetappointmenteventrefs.json +retries: features/vetappointmentretries.json states: - name: MakeVetAppointmentState type: operation @@ -17,7 +17,8 @@ states: resultEventRef: VetAppointmentInfo actionDataFilter: results: "${ .appointmentInfo }" - timeout: PT15M + timeouts: + actionExecTimeout: PT15M onErrors: - error: TimeoutError code: '500' diff --git a/diagram/src/test/resources/examples/checkcarvitals.json b/diagram/src/test/resources/examples/checkcarvitals.json index fbf48b0a..69f66740 100644 --- a/diagram/src/test/resources/examples/checkcarvitals.json +++ b/diagram/src/test/resources/examples/checkcarvitals.json @@ -57,7 +57,9 @@ } } ], - "timeout": "PT2M", + "timeouts": { + "eventTimeout": "PT2M" + }, "transition": "ShouldStopOrContinue" }, { diff --git a/diagram/src/test/resources/examples/checkcarvitals.yml b/diagram/src/test/resources/examples/checkcarvitals.yml index 2db78a4b..986036b1 100644 --- a/diagram/src/test/resources/examples/checkcarvitals.yml +++ b/diagram/src/test/resources/examples/checkcarvitals.yml @@ -30,7 +30,8 @@ states: - StopVitalsCheck eventDataFilter: toStateData: "${ .stopReceived }" - timeout: PT2M + timeouts: + eventTimeout: PT2M transition: ShouldStopOrContinue - name: ShouldStopOrContinue type: switch diff --git a/diagram/src/test/resources/examples/creditcheck.json b/diagram/src/test/resources/examples/creditcheck.json index ac9e0014..b70e191c 100644 --- a/diagram/src/test/resources/examples/creditcheck.json +++ b/diagram/src/test/resources/examples/creditcheck.json @@ -40,7 +40,9 @@ } }, "eventRef": "CreditCheckCompletedEvent", - "timeout": "PT15M", + "timeouts": { + "stateExecTimeout": "PT15M" + }, "transition": "EvaluateDecision" }, { diff --git a/diagram/src/test/resources/examples/creditcheck.yml b/diagram/src/test/resources/examples/creditcheck.yml index 85c643e7..f2679380 100644 --- a/diagram/src/test/resources/examples/creditcheck.yml +++ b/diagram/src/test/resources/examples/creditcheck.yml @@ -24,7 +24,8 @@ states: arguments: customer: "${ .customer }" eventRef: CreditCheckCompletedEvent - timeout: PT15M + timeouts: + stateExecTimeout: PT15M transition: EvaluateDecision - name: EvaluateDecision type: switch diff --git a/diagram/src/test/resources/examples/eventbasedtransition.json b/diagram/src/test/resources/examples/eventbasedtransition.json index cad06ca4..841dfa6c 100644 --- a/diagram/src/test/resources/examples/eventbasedtransition.json +++ b/diagram/src/test/resources/examples/eventbasedtransition.json @@ -31,7 +31,9 @@ "transition": "HandleRejectedVisa" } ], - "eventTimeout": "PT1H", + "timeouts": { + "eventTimeout": "PT1H" + }, "defaultCondition": { "transition": "HandleNoVisaDecision" } diff --git a/diagram/src/test/resources/examples/eventbasedtransition.yml b/diagram/src/test/resources/examples/eventbasedtransition.yml index bb4797ce..9bfd1345 100644 --- a/diagram/src/test/resources/examples/eventbasedtransition.yml +++ b/diagram/src/test/resources/examples/eventbasedtransition.yml @@ -19,7 +19,8 @@ states: transition: HandleApprovedVisa - eventRef: visaRejectedEvent transition: HandleRejectedVisa - eventTimeout: PT1H + timeouts: + eventTimeout: PT1H defaultCondition: transition: HandleNoVisaDecision - name: HandleApprovedVisa diff --git a/diagram/src/test/resources/examples/roomreadings.json b/diagram/src/test/resources/examples/roomreadings.json index 543276bc..334dae38 100644 --- a/diagram/src/test/resources/examples/roomreadings.json +++ b/diagram/src/test/resources/examples/roomreadings.json @@ -4,9 +4,11 @@ "version": "1.0", "specVersion": "0.7", "start": "ConsumeReading", - "execTimeout": { - "duration": "PT1H", - "runBefore": "GenerateReport" + "timeouts": { + "workflowExecTimeout": { + "duration": "PT1H", + "runBefore": "GenerateReport" + } }, "keepActive": true, "states": [ diff --git a/diagram/src/test/resources/examples/roomreadings.yml b/diagram/src/test/resources/examples/roomreadings.yml index c0fde4e5..bf18cde8 100644 --- a/diagram/src/test/resources/examples/roomreadings.yml +++ b/diagram/src/test/resources/examples/roomreadings.yml @@ -3,9 +3,10 @@ name: Room Temp and Humidity Workflow version: '1.0' specVersion: '0.7' start: ConsumeReading -execTimeout: - duration: PT1H - runBefore: GenerateReport +timeouts: + workflowExecTimeout: + duration: PT1H + runBefore: GenerateReport keepActive: true states: - name: ConsumeReading @@ -44,4 +45,4 @@ functions: - name: LogReading operation: http.myorg.io/ordersservices.json#logreading - name: ProduceReport - operation: http.myorg.io/ordersservices.json#produceReport \ No newline at end of file + operation: http.myorg.io/ordersservices.json#produceReport diff --git a/diagram/src/test/resources/examples/vetappointmentservice.json b/diagram/src/test/resources/examples/vetappointmentservice.json index a2bfe926..e956b528 100644 --- a/diagram/src/test/resources/examples/vetappointmentservice.json +++ b/diagram/src/test/resources/examples/vetappointmentservice.json @@ -31,10 +31,12 @@ }, "actionDataFilter": { "results": "${ .appointmentInfo }" - }, - "timeout": "PT15M" + } } ], + "timeouts": { + "actionExecTimeout": "PT15M" + }, "end": true } ] diff --git a/diagram/src/test/resources/examples/vetappointmentservice.yml b/diagram/src/test/resources/examples/vetappointmentservice.yml index 66216a10..df2f1851 100644 --- a/diagram/src/test/resources/examples/vetappointmentservice.yml +++ b/diagram/src/test/resources/examples/vetappointmentservice.yml @@ -22,5 +22,6 @@ states: resultEventRef: VetAppointmentInfo actionDataFilter: results: "${ .appointmentInfo }" - timeout: PT15M - end: true \ No newline at end of file + timeouts: + actionExecTimeout: PT15M + end: true pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy