Can the following code create 2 workflows?
class UserJournalAction {
override def onCreate(...): Action.Effect[Empty] = {
val createRequest = Create.of(...)
val reply = components.workflow.create(createRequest).execute()
effects.asyncReply(reply)
}
}
The protobuf for the subscription would be …
service UserJournal {
option (kalix.codegen).action = {};
rpc OnCreate(...) returns (google.protobuf.Empty) {
option (kalix.method).eventing.in.event_sourced_entity = "users";
}
}
… and the protobuf for the workflow (it could be an entity as well) would be …
service Workflow {
option (kalix.codegen).workflow = { ... }
rpc Create(...) returns (google.protobuf.Empty) {
option (kalix.method).id_generator.algorithm = VERSION_4_UUID;
}
}
I can’t figure out from the docs whether the action can process an event twice (even if the first event was successful). Or whether committing the event as processed and the creation of the workflow is atomic.
If the answer is “yes”, then the utility of the id generation is drastically reduced
option (kalix.method).id_generator.algorithm = VERSION_4_UUID;
Thanks.