Repository navigation
v0.1.0-beta.7
Pre-release
Pre-release
·
10 commits
to main
since this release
The first release, a beta: specification 0.1.0, tier 1, capabilities sync, async and testing for Kotlin and sync and testing for Java, cases v0.1.0-rc.20. Its version is the one itinera-rs and itinera-ts give their next releases, which pass the same cases. The artifacts run on JDK 17 and later, and need the Kotlin standard library 2.3 or later; itinera-kotlin also needs kotlinx.coroutines 1.11 or later.
Added
- The core,
itinera, written in Kotlin and used from Kotlin and Java alike, with everything a synchronous workflow needs;itinera-kotlin, which reads Kotlin classes and data classes as Kotlin declares them, runs asynchronous workflows on coroutines and gives reified forms of the core's API;itinera-java, requests in Java's own forms, such as an optional input whose answer is anOptional; anditinera-bom, the bill of materials that names every artifact's version once. Each artifact but the bill of materials is a Java module, and each concept a package of its own underorg.itineradev.itinera, such asstep,workfloworjourney. - Steps, classes implementing
ItineraStepmarked with@Step, or factories given to the builder, built for each attempt from the requests they declare, such as inputs from the data bag with@Input, a contributor, a step reporter or a service with@Service, and ending with anOutcome: success, failure with a reason, or skipped. Only an attempt that succeeds commits its contributions to the data bag of values. A retry budget alone decides whether a failed or abnormally terminated attempt is tried again; a step declared withnoRetryOnAbnormalTerminationis not retried after an abnormal termination. - Values, the only data a journey holds: the data bag, read through
DataBagandReadinorg.itineradev.itinera.journeywith aTypeTokennaming the type a read wants, generics and nullability included, records and Kotlin data classes as initial data, andJourneyResult.output, which reads a journey's output as a record or data class whose components@Datummay key, or throwsOutputExceptionsaying why it cannot. - Rescue steps: a step may have a rescue step, a class implementing
ItineraRescueStepmarked with@RescueStepor a factory given toRescueStepDescriptor.builder, orasyncRescueStepinitinera-kotlin, attached withStepBuilder.rescue, which runs when the step fails or terminates abnormally and, once it succeeds, lets the step run again. A rescue step is named<step name>_rescue, and input adapters and service providers are attached to it by that name; a step that has a rescue step has no retry budget, whichViolation.RescuedStepRetriedrefuses. - Step and workflow policies, classes implementing
ItineraStepPolicyorItineraWorkflowPolicymarked with@StepPolicyor@WorkflowPolicywhose methods are marked with their hook kinds, such as@OnStepFailure, or descriptors made with their builders, with every hook kind, its requests and what it returns:KeepDefault, or a lifecycle,Lifecycle.FinishWorkfloworLifecycle.FailWorkflow, typed asOnSuccessorOnFailureso that each hook kind returns only what it may; and roles, interfaces marked with@Rolethat the workflow implements and lends to hooks. - Input adapters, methods of a workflow class marked with
@InputAdapter, which supply a step's input withsupplyor from the data bag withfromDataBag, reading it throughDataBagAccess. - Services that steps request by key and type, made by service providers, methods of a workflow class marked with
@Provider, for the journey or for each attempt, attached to chosen steps, rescue steps included, or serving every step. A provider returns its service withprovide, which names the implementation it made on theservice_providedevent, or says it made none withnoInstance. - Workflows declared with
@Workflowand@WithStepon a class implementingItineraWorkflow, orItineraAsyncWorkflowinitinera-kotlin, or with the builder, which also takes a step, rescue step or policy class read alone, throughStepDescriptor.builder(name, type),RescueStepDescriptor.of,StepPolicyDescriptor.ofandWorkflowPolicyDescriptor.of, orasyncStep(name, type),asyncRescueStepOf,asyncStepPolicyOfandasyncWorkflowPolicyOfinitinera-kotlin; refused withViolationswhen they break a rule of the specification, and listed, with their steps, policies, input adapters, services and rescue steps, byWorkflowDescriptor.listing, without running anything. - Workflow instances with their initial data, global metadata and reporters, and journey IDs made by a method marked with
@IdGeneratoror as a random UUID;LocalExecutor, which runs a synchronous workflow's journey on the caller's thread, andAsyncLocalExecutorinitinera-kotlin, which runs an asynchronous one in the caller's coroutine, each giving the journey'sJourneyResult, or refusing it before it starts with aRefusal. When custom code was interrupted,LocalExecutor.runsets the thread's interrupt flag again once the journey ends. - Events, one record for each kind under the sealed interface
Event, reporters, dispatchers and their factories, withDefaultDispatcher, andDebugReporter, which prints every event, each with an asynchronous form initinera-kotlin. Global metadata: entries of a key and a value, apart from the data bag, that every reporter receives as soon as each one is set, starting with the journey ID; steps, hooks and service providers set entries withsetGlobalMetadata. - Test support, in
itinera-testing:RecordingReporter, which keeps every event and the latest value of each entry of global metadata, and whosepathlists the flow a journey took;TestInstanceBuilderandFake, which put a fake in place of a service provider; scripted runs, started withscripted, which play what named steps' attempts do without their business rules; recorders that lend a step or a hook its contributor, its reporter or read access to a data bag outside any journey; mocks of steps, rescue steps and policies; andTestMistake, which names each mistake a test can make. - Compile errors, instead of checks while a journey runs, for the rules the specification lets an implementation make impossible to express: a lifecycle a hook may not return, a part of the other mode in a workflow, a rescue step that skips, a service provider of journey scope requesting the attempt, an input adapter writing to the data bag, and a test's script choosing a fraction of an attempt; in Kotlin, also custom code returning what its call cannot return and an ID generator returning something that is not a string. Where an annotated class can still declare one, the workflow is refused when it is described, and
itinera-checker, added to javac's annotation processor path or to KSP's symbol processors, reports it as a compile error, also in a step, rescue step or policy class that no workflow names. ExperimentalItineraApiinorg.itineradev.itinera, the opt-in marker of API whose proposal itinera does not claim yet, which may change or go in any release; nothing in this release carries it.