質問

Or I should say, what is the correct way/tool to implement a parallel split task?

I've got a single state/status for an entity involved in a workflow. I could add some additional statuses for each parallel path, but is there a better way to do this?

Thanks

EDIT

This is not really a full answer just yet, but what I ended up doing after much research was creating a sort of wrapper for a state machine. Existing tools I looked at were just too much overhead and didn't meet my needs. Each state machine is a "process", and each state of the process is part of a "session". A session in turn has a session key, which is just a collection of the current state of each process.

I'm serializing a session key token as a string, so a persisted session looks something like this:

"enroll=get-contact|verify=null|authorize=null"

The triggers for the various states can specify parallel split as a target. It seems to work pretty well actually.

役に立ちましたか?

解決

A state machine is not associated with execution semantics between states. All a state machine does is presenting transitions between states and the logic occurring validating and running during transitions.

The logic running during a transition itself can be run in parallel, by spawning new threads for example. The threads can run asynchronously to the execution or they can be spawned, then joined back to the main thread as part of the main thread.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top