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

Functionality Proposal #53

Open
ElanHasson opened this issue Sep 29, 2021 · 6 comments
Open

Functionality Proposal #53

ElanHasson opened this issue Sep 29, 2021 · 6 comments

Comments

@ElanHasson
Copy link
Contributor

Below is what is written to the mongo storage provider for grain state.

Is there a way to get at this information?

if not, are you open to a PR that does that, and also adds status information to the activity values

{ 
    "_id" : "GrainReference=422d0a3a946dfeb1a396449587bd519403ffffffc58d5186", 
    "_etag" : "c35f06df-184c-4aa4-80eb-c2ea78491a63", 
    "_doc" : {
        "__id" : "38", 
        "__type" : "Orleans.Sagas.SagaState, Orleans.Sagas", 
        "Activities" : {
            "__type" : "System.Collections.Generic.List`1[[Orleans.Sagas.ActivityDefinition, Orleans.Sagas]], System.Private.CoreLib", 
            "__values" : [
                {
                    "__id" : "39", 
                    "__type" : "Orleans.Sagas.ActivityDefinition, Orleans.Sagas", 
                    "Type" : "KitchenSink.Shared.Application.AddClientActivity, KitchenSink.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", 
                    "Properties" : {
                        "__id" : "40", 
                        "__type" : "Orleans.Sagas.SagaPropertyBag, Orleans.Sagas", 
                        "ContextProperties" : {
                            "__type" : "System.Collections.Generic.Dictionary`2[[System.String, System.Private.CoreLib],[System.String, System.Private.CoreLib]], System.Private.CoreLib", 
                            "ClientName" : "{\"Name\":\"elsgwsa,lma[pn\"}"
                        }
                    }
                }, 
                {
                    "__id" : "41", 
                    "__type" : "Orleans.Sagas.ActivityDefinition, Orleans.Sagas", 
                    "Type" : "KitchenSink.Shared.Application.SetLegalNameActivity, KitchenSink.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", 
                    "Properties" : {
                        "__id" : "42", 
                        "__type" : "Orleans.Sagas.SagaPropertyBag, Orleans.Sagas", 
                        "ContextProperties" : {
                            "__type" : "System.Collections.Generic.Dictionary`2[[System.String, System.Private.CoreLib],[System.String, System.Private.CoreLib]], System.Private.CoreLib", 
                            "LegalName" : "{\"Value\":\"Google, I;nc.\"}", 
                            "ClientName" : "{\"Name\":\"elsgwsa,lma[pn\"}"
                        }
                    }
                }
            ]
        }, 
        "NumCompletedActivities" : NumberInt(2), 
        "Status" : NumberInt(2), 
        "CompensationIndex" : NumberInt(0), 
        "HasBeenAborted" : false, 
        "Properties" : {
            "__id" : "43", 
            "__type" : "System.Collections.Generic.Dictionary`2[[System.String, System.Private.CoreLib],[System.String, System.Private.CoreLib]], System.Private.CoreLib", 
            "AddClientActivity-Result" : "{\"Status\":4}", 
            "SetLegalNameActivityResult" : "{\"Events\":[],\"Status\":2}"
        }
    }
}
@creyke
Copy link
Collaborator

creyke commented Oct 1, 2021

What is the scope of what you want to expose? What is the goal of doing so? This state structure may evolve over time to support additional flows such as DAGs, so it's concerning to have it exposed in the client API.

@ElanHasson
Copy link
Contributor Author

Hi @creyke,

Sorry this got lost in all of my notifications.

I'm looking to expose via a UI to show progress of the process to users, i.e. $"Out of the 5 activities in the saga, 3 of 5 are completed and we are still {Saga.Status}."

DAGs would be awesome, which also makes it harder to express the above sample UI statement.

I don't think leaking the underlying model is desirable-- as with everything, some sort of abstraction is necessary to hide internal implementation details.

Of course, the saga model for consumption would most likely be different, but derived from today's linear flow status.

It's also desirable to get access to the Saga Properties (global and activity) to gain more information by process managers (i.e. saga initiators) so they can decide what to do next.

I think this there is something that needs to happen around visibility into the execution of the flow in addition to what exists today.

Today though, I think there is an opportunity here to show individual activity status (i.e. "Pending", "Failed", "Active", etc)

Instead of sending a PR-- perhaps more discussion is appropriate for a longer term solution.

@creyke
Copy link
Collaborator

creyke commented Oct 6, 2021

I'm happy to discuss on a call for example, although alternatively you could propose an API-only PR which exposes the state-abstracted public objects you feel are appropriate as a starting point?

@ElanHasson
Copy link
Contributor Author

Thanks Roger-- I may take you up on that, I'm on the Gitter.

When I circle back around to my saga work I'll take a stab at it.

@cecilphillip
Copy link
Contributor

@ElanHasson did you ever end up doing this?

@ElanHasson
Copy link
Contributor Author

Hi @cecilphillip,

Nope, I actually switched companies shortly after this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants