Skip to content

Add an IActivity.Abort method allowing activities to define their abort results - #1420

Draft
1nf0rmagician wants to merge 1 commit into
futurefrom
feature/support-aborting-activities
Draft

Add an IActivity.Abort method allowing activities to define their abort results#1420
1nf0rmagician wants to merge 1 commit into
futurefrom
feature/support-aborting-activities

Conversation

@1nf0rmagician

Copy link
Copy Markdown
Member

Currently an activity only supports to Complete with a given result number (for which you need to know the possible results of the activity type and hence the activity type) and to Fail. While the fact that ICell.ProcessAborting exists is a detail of a different namespace and should not lead implementation directly, this function would allow for more generic and activity independent cell implementations. And since aborting an activity and having activity specific result creation has semantic meaning, this extension is proposed.

Example:

void ICell.ProcessAborting(Activity affectedActivity)
{
    var result = affectedActivity.Abort();
    PublishActivityCompleted(_currentActivityStart.CreateResult());
}

…bort results

Currently an activity only supports to `Complete` with a given result number (for which you need to know the possible results of the activity type and hence the activity type) and to `Fail`.
While the fact that `ICell.ProcessAborting` exists is a detail of a different namespace and should not lead implementation directly, this function would allow for more generic and activity independent cell implementations.
And since aborting an activity and having activity specific result creation has semantic meaning, this extension is proposed.

Example:
```csharp
void ICell.ProcessAborting(Activity affectedActivity)
{
    var result = affectedActivity.Abort();
    PublishActivityCompleted(_currentActivityStart.CreateResult());
}
```
@1nf0rmagician 1nf0rmagician added this to the Framework 12.0.0 milestone Aug 11, 2026
@1nf0rmagician 1nf0rmagician self-assigned this Aug 11, 2026
@1nf0rmagician 1nf0rmagician added the enhancement New feature or request label Aug 11, 2026
@1nf0rmagician

Copy link
Copy Markdown
Member Author

@dbeuchler, @andreniggemann, @seveneleven let me know what you think about the idea 😊

@andreniggemann

Copy link
Copy Markdown
Collaborator

I like the idea, but I have an alternative idea I would like to propose.
What if we combine this abort and the existing Fail Method to receive a parameter to allow reacting to different generally applicable results?

Let's say we have different standardized results similar to the DefaultActivtyResult that includes the current values from the DefaultActivityResult, Aborted and maybe others.
This would give us a generic way to set a value according to all the standard result types.

@1nf0rmagician

Copy link
Copy Markdown
Member Author

Let's say we have different standardized results similar to the DefaultActivtyResult that includes the current values from the DefaultActivityResult, Aborted and maybe others.

Sounds interesting to me. Any ideas how you would start to implement something like that @andreniggemann? Currently the results are only added as Attributes (and I'm not a big fan of changing it, as it would result in loads of changes in application code). I could not spin up an idea how to get to your proposed solution from the top of my head 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants