Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EventDefinition does not have dataOnly attribute #183

Closed
fjtirado opened this issue Mar 1, 2022 · 7 comments · Fixed by #184
Closed

EventDefinition does not have dataOnly attribute #183

fjtirado opened this issue Mar 1, 2022 · 7 comments · Fixed by #184
Assignees
Labels
bug Something isn't working

Comments

@fjtirado
Copy link
Contributor

fjtirado commented Mar 1, 2022

What happened:

Cannot find dataOnly attribute in EventDefinition

What you expected to happen:
EventDefinition to have a boolean dataOnly attribute as specified in the spec https://github.com/serverlessworkflow/specification/blob/main/specification.md#event-definition

How to reproduce it:
This is the decompiled EventDefinition class in version 4.0.2


package io.serverlessworkflow.api.events;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.validation.Valid;
import javax.validation.constraints.Size;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonValue;
import io.serverlessworkflow.api.correlation.CorrelationDef;

@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
    "name",
    "source",
    "type",
    "correlation",
    "kind",
    "metadata"
})
public class EventDefinition implements Serializable
{

    /**
     * Event Definition unique name
     * 
     */
    @JsonProperty("name")
    @JsonPropertyDescription("Event Definition unique name")
    @Size(min = 1)
    private java.lang.String name;
    /**
     * CloudEvent source UUID
     * 
     */
    @JsonProperty("source")
    @JsonPropertyDescription("CloudEvent source UUID")
    private java.lang.String source;
    /**
     * CloudEvent type
     * 
     */
    @JsonProperty("type")
    @JsonPropertyDescription("CloudEvent type")
    private java.lang.String type;
    /**
     * CloudEvent correlation definitions
     * 
     */
    @JsonProperty("correlation")
    @JsonPropertyDescription("CloudEvent correlation definitions")
    @Size(min = 1)
    @Valid
    private List<CorrelationDef> correlation = new ArrayList<CorrelationDef>();
    /**
     * Defines the events as either being consumed or produced by the workflow. Default is consumed
     * 
     */
    @JsonProperty("kind")
    @JsonPropertyDescription("Defines the events as either being consumed or produced by the workflow. Default is consumed")
    private EventDefinition.Kind kind = EventDefinition.Kind.fromValue("consumed");
    /**
     * Metadata
     * 
     */
    @JsonProperty("metadata")
    @JsonPropertyDescription("Metadata")
    @Valid
    private Map<String, String> metadata;
    private final static long serialVersionUID = -7106400632209024391L;

    /**
     * Event Definition unique name
     * 
     */
    @JsonProperty("name")
    public java.lang.String getName() {
        return name;
    }

    /**
     * Event Definition unique name
     * 
     */
    @JsonProperty("name")
    public void setName(java.lang.String name) {
        this.name = name;
    }

    public EventDefinition withName(java.lang.String name) {
        this.name = name;
        return this;
    }

    /**
     * CloudEvent source UUID
     * 
     */
    @JsonProperty("source")
    public java.lang.String getSource() {
        return source;
    }

    /**
     * CloudEvent source UUID
     * 
     */
    @JsonProperty("source")
    public void setSource(java.lang.String source) {
        this.source = source;
    }

    public EventDefinition withSource(java.lang.String source) {
        this.source = source;
        return this;
    }

    /**
     * CloudEvent type
     * 
     */
    @JsonProperty("type")
    public java.lang.String getType() {
        return type;
    }

    /**
     * CloudEvent type
     * 
     */
    @JsonProperty("type")
    public void setType(java.lang.String type) {
        this.type = type;
    }

    public EventDefinition withType(java.lang.String type) {
        this.type = type;
        return this;
    }

    /**
     * CloudEvent correlation definitions
     * 
     */
    @JsonProperty("correlation")
    public List<CorrelationDef> getCorrelation() {
        return correlation;
    }

    /**
     * CloudEvent correlation definitions
     * 
     */
    @JsonProperty("correlation")
    public void setCorrelation(List<CorrelationDef> correlation) {
        this.correlation = correlation;
    }

    public EventDefinition withCorrelation(List<CorrelationDef> correlation) {
        this.correlation = correlation;
        return this;
    }

    /**
     * Defines the events as either being consumed or produced by the workflow. Default is consumed
     * 
     */
    @JsonProperty("kind")
    public EventDefinition.Kind getKind() {
        return kind;
    }

    /**
     * Defines the events as either being consumed or produced by the workflow. Default is consumed
     * 
     */
    @JsonProperty("kind")
    public void setKind(EventDefinition.Kind kind) {
        this.kind = kind;
    }

    public EventDefinition withKind(EventDefinition.Kind kind) {
        this.kind = kind;
        return this;
    }

    /**
     * Metadata
     * 
     */
    @JsonProperty("metadata")
    public Map<String, String> getMetadata() {
        return metadata;
    }

    /**
     * Metadata
     * 
     */
    @JsonProperty("metadata")
    public void setMetadata(Map<String, String> metadata) {
        this.metadata = metadata;
    }

    public EventDefinition withMetadata(Map<String, String> metadata) {
        this.metadata = metadata;
        return this;
    }

    public enum Kind {

        CONSUMED("consumed"),
        PRODUCED("produced");
        private final java.lang.String value;
        private final static Map<java.lang.String, EventDefinition.Kind> CONSTANTS = new HashMap<java.lang.String, EventDefinition.Kind>();

        static {
            for (EventDefinition.Kind c: values()) {
                CONSTANTS.put(c.value, c);
            }
        }

        private Kind(java.lang.String value) {
            this.value = value;
        }

        @Override
        public java.lang.String toString() {
            return this.value;
        }

        @JsonValue
        public java.lang.String value() {
            return this.value;
        }

        @JsonCreator
        public static EventDefinition.Kind fromValue(java.lang.String value) {
            EventDefinition.Kind constant = CONSTANTS.get(value);
            if (constant == null) {
                throw new IllegalArgumentException(value);
            } else {
                return constant;
            }
        }

    }

}

Anything else we need to know?:

Environment:

  • Specification version used: Using serverlessworkflow-api-4.0.2.final.jar
@tsurdilo tsurdilo self-assigned this Mar 1, 2022
@tsurdilo tsurdilo added the bug Something isn't working label Mar 1, 2022
@tsurdilo
Copy link
Collaborator

tsurdilo commented Mar 1, 2022

Thanks for reporting!
This was added in spec release 0.7 but it seems we completely missed it. Will add.
We can talk about doing a 4.0.3.Final sdk release if this is a must have for you right now.

@fjtirado
Copy link
Contributor Author

fjtirado commented Mar 1, 2022

@tsurdilo Hi Tiho, thanks for the quick response, Im testing that our implementation is working by using as workaround

 events: [{
      "name": "waitEvent",
      "source": "",
      "type": "wait",
      "metadata" : { "dataOnly" : "false"}
    }}

but it will be nice if we can add this to 4.0.3.Final to remove that "hack"

@tsurdilo
Copy link
Collaborator

tsurdilo commented Mar 1, 2022

Got it. Ok give me a week and ill have it released :) Ping me in case I forgot hehe

@fjtirado
Copy link
Contributor Author

fjtirado commented Mar 8, 2022

@tsurdilo Hi Tiho, I do not see any PR opened, so just pinging you in case your forgot ;) Thanks a lot man

@tsurdilo
Copy link
Collaborator

tsurdilo commented Mar 8, 2022

@fjtirado thanks! yeah still on it. need to update some images in spec doc so its taking time

@tsurdilo tsurdilo linked a pull request Mar 21, 2022 that will close this issue
@tsurdilo tsurdilo changed the title EventDefinition does not have readOnly attribute EventDefinition does not have dataOnly attribute Mar 21, 2022
@tsurdilo
Copy link
Collaborator

fix in master and 4.0.x branch

@tsurdilo
Copy link
Collaborator

will do release this week

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants