Skip to content

Change types to be serializable-friendly #978

@mcruzdev

Description

@mcruzdev

Context

It is not an issue but we need to discuss a pain from quarkiverse/quarkus-flow extension.

Trying to solve the quarkiverse/quarkus-flow#50 issue where is expected to:

  1. Get the file containing a workflow descriptor from YAML
  2. Create a Workflow through WorkflowReader.readWorkflow(file);
  3. Create a SyntheticBean recording the Workflow:
+    public Supplier<WorkflowDefinition> workflowDefinitionSupplier(Workflow workflow) {
+        return () -> {
+            try {
+                final WorkflowApplication app = Arc.container().instance(WorkflowApplication.class).get();
+                return app.workflowDefinition(workflow);
+            } catch (Exception e) {
+                throw new RuntimeException("Failed to create WorkflowDefinition for " + workflow, e);
+            }
+        };
+    }

Problem

It is not possible to record the TaskItem object, because it is read-only and it is not possible to record the URI from UriTemplate#literalUri beacuse URI is read-only too and not serializable-friendly.

References:

Possible solutions

  • Add setters to TaskItem at UnevaluatedPropertiesRule something like GeneratorUtils#getterMethod. And, change the String literalUri to String.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions