sclasen/swf4go — pull request #54 by fabiokung (2014-12-06 03:23:01+00:00)
Title: Automatic ActivityTask tracking

Deciders have access to a new method: `FSMContext.ActivityType(HistoryEvent)`. It can be used to retrieve information about pending activity tasks, when handling ActivityTask related events (`EventTypeActivityTaskCompleted`, `EventTypeActivityTaskFailed`, etc.).

Information about pending activity tasks is being serialized into the event history, together with other state data in the `SerializedState` struct. Not all data in there needs to be replicated onto Kinesis streams, then only what's in `SerializedState.ReplicationData` will be sent (this name sucks, I know, I'm open to suggestions).

More details (from @148fb6c):

> Automatic task tracking makes it easier for deciders to retrieve information
about pending tasks when handling events related to ActivityTasks (e.g.:
EventTypeActivityTaskCompleted, EventTypeActivityTaskFailed, etc.).

> Deciders can now call FSMContext.ActivityType(lastEvent) to get information
about pending activity tasks.

> Pending tasks are automatically cleared when finished (completed, failed,
timed out, etc.).

One more thing that could be better (maybe on another PR?): tests are super verbose and there's a lot of duplication to set up events and decisions in there.