Skip to content

v0.1.0-beta.7

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 04 Nov 01:23
· 10 commits to main since this release
810a16d

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 an Optional; and itinera-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 under org.itineradev.itinera, such as step, workflow or journey.
  • Steps, classes implementing ItineraStep marked 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 an Outcome: 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 with noRetryOnAbnormalTermination is not retried after an abnormal termination.
  • Values, the only data a journey holds: the data bag, read through DataBag and Read in org.itineradev.itinera.journey with a TypeToken naming the type a read wants, generics and nullability included, records and Kotlin data classes as initial data, and JourneyResult.output, which reads a journey's output as a record or data class whose components @Datum may key, or throws OutputException saying why it cannot.
  • Rescue steps: a step may have a rescue step, a class implementing ItineraRescueStep marked with @RescueStep or a factory given to RescueStepDescriptor.builder, or asyncRescueStep in itinera-kotlin, attached with StepBuilder.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, which Violation.RescuedStepRetried refuses.
  • Step and workflow policies, classes implementing ItineraStepPolicy or ItineraWorkflowPolicy marked with @StepPolicy or @WorkflowPolicy whose 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.FinishWorkflow or Lifecycle.FailWorkflow, typed as OnSuccess or OnFailure so that each hook kind returns only what it may; and roles, interfaces marked with @Role that the workflow implements and lends to hooks.
  • Input adapters, methods of a workflow class marked with @InputAdapter, which supply a step's input with supply or from the data bag with fromDataBag, reading it through DataBagAccess.
  • 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 with provide, which names the implementation it made on the service_provided event, or says it made none with noInstance.
  • Workflows declared with @Workflow and @WithStep on a class implementing ItineraWorkflow, or ItineraAsyncWorkflow in itinera-kotlin, or with the builder, which also takes a step, rescue step or policy class read alone, through StepDescriptor.builder(name, type), RescueStepDescriptor.of, StepPolicyDescriptor.of and WorkflowPolicyDescriptor.of, or asyncStep(name, type), asyncRescueStepOf, asyncStepPolicyOf and asyncWorkflowPolicyOf in itinera-kotlin; refused with Violations when they break a rule of the specification, and listed, with their steps, policies, input adapters, services and rescue steps, by WorkflowDescriptor.listing, without running anything.
  • Workflow instances with their initial data, global metadata and reporters, and journey IDs made by a method marked with @IdGenerator or as a random UUID; LocalExecutor, which runs a synchronous workflow's journey on the caller's thread, and AsyncLocalExecutor in itinera-kotlin, which runs an asynchronous one in the caller's coroutine, each giving the journey's JourneyResult, or refusing it before it starts with a Refusal. When custom code was interrupted, LocalExecutor.run sets 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, with DefaultDispatcher, and DebugReporter, which prints every event, each with an asynchronous form in itinera-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 with setGlobalMetadata.
  • Test support, in itinera-testing: RecordingReporter, which keeps every event and the latest value of each entry of global metadata, and whose path lists the flow a journey took; TestInstanceBuilder and Fake, which put a fake in place of a service provider; scripted runs, started with scripted, 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; and TestMistake, 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.
  • ExperimentalItineraApi in org.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.