Annotations

Infinitic is still in active development. Subscribe here to follow its progress.

@Name

A workflow instance is internally described by both its full java name (including its package) and the name of the method called.

In some situations we may want to avoid coupling those names with the underlying implementation, for example if we want to rename the class or method, or if we mix programming languages.

Infinitic provides a @Name (io.infinitic.annotations.Name) annotation that let us declare explicitly the names that Infinitic should use internally. For example:

package hello.world.workflows;

import io.infinitic.annotations.Name;

@Name("HelloWorkflow")
public interface HelloWorld {

    @Name("welcome")
    String greet(@Nullable String name);
}
package hello.world.workflows

import io.infinitic.annotations.Name

@Name('HelloWorkflow')
interface HelloWorld {

    @Name('welcome')
    fun greet(name: String?): String
}

When using this annotation, the name setting in workflow worker configuration file should be the one provided by the annotation:

workflows:
  - name: HelloWorkflow
    class: hello.world.workflows.HelloWorldImpl

@Ignore

At each step of the execution of a workflow, its properties are automatically serialized and stored. Those properties are part of the state of the workflow.

But some properties need to be ignored:

  • user-created channels
  • workflow context
  • stubs created by newTask, newWorkflow, getWorkflowById, getWorkflowByTag
  • SLF4J loggers

The @Ignore (io.infinitic.annotations.Ignore) annotation lets us tag other properties that are not part of the workflow state and should not be serialized during the workflow execution.

Edit this page on GitHub Updated at Mon, Oct 25, 2021