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

ADR: Composite Inline VariableMutations #1108

Open
coltmcnealy-lh opened this issue Nov 6, 2024 · 0 comments
Open

ADR: Composite Inline VariableMutations #1108

coltmcnealy-lh opened this issue Nov 6, 2024 · 0 comments
Labels
clients Affects all LH clients and the public API. May be used in conjunction with `server`. controversial Requires discussion from the community. For proposals, API changes, and big features. feature Issue that denotes a new feature, request, or performance improvement. server Affects the core LH Server code.

Comments

@coltmcnealy-lh
Copy link
Member

It is annoying that we can't do something like:

wf.mutate(myVar, ASSIGN, someOtherVar.multiply(10));

It would be nice to have this code do the same as myVar = someOtherVar * 10, without mutating someOtherVar. Right now, we have to define a separate internal variable to do this.

message VariableAssignment {
  message FormatString {
    VariableAssignment format = 1;
    repeated VariableAssignment args = 2;
  }
  optional string json_path = 1;

  // THIS IS NEW
  message CompoundAssignment {
    VariableAssignment lhs = 1;
    VariableMutationType mutation = 2;
    VariableAssignment rhs = 3;
  }

  oneof source {
    string variable_name = 2;
    VariableValue literal_value = 3;
    FormatString format_string = 4;

    // THIS IS NEW
    CompoundAssignment compound = 5;
  }
}

This would enable something like the following in our SDK:

// wf.execute("some-task", myIntVariable.times(10));
@coltmcnealy-lh coltmcnealy-lh added feature Issue that denotes a new feature, request, or performance improvement. server Affects the core LH Server code. controversial Requires discussion from the community. For proposals, API changes, and big features. clients Affects all LH clients and the public API. May be used in conjunction with `server`. labels Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clients Affects all LH clients and the public API. May be used in conjunction with `server`. controversial Requires discussion from the community. For proposals, API changes, and big features. feature Issue that denotes a new feature, request, or performance improvement. server Affects the core LH Server code.
Projects
None yet
Development

No branches or pull requests

1 participant