This replaces the `Then(string activityName)` method with `ThenNamed(string activityName)`.
A new method is added to allow connecting to activities by type name: `ThenTypeNamed(string activityTypeName)`.
The reason for this change and addition is to allow workflow builders to connect to activity types that do not have a corresponding type.
For example, the Telnyx project has an activity type provider that *dynamically* provides activity types based on Telnyx webhook callback types.
As stated in the comments for
WorkflowMayContainDuplicateActivitiesIntegrationTests
These tests might not describe actually-desired behaviour.
If they begin to "get in the way" in future, then it would
probably be safe to remove them.
This also includes a change to the workflow used in the test-case.
There are quite complex reasons for this, as explained here:
https://github.com/elsa-workflows/elsa-core/issues/728#issuecomment-794319236
The real crux of it is that the workflow must have an activity
which suspends it, and that activity that suspends the workflow
must not be the starting activity. This is why I added an unused
set-variable activity as the starter.
This commit shows that the various persistence test cases _mostly_
work OK, with the one exception of ActivityExecuted.
Actually, this unit test does not repro the issue.
Frustratingly I can't get it to save the executed workflow
into MongoDB at all. I see workflow execution logs
being saved, but the instance doesn't go in.
I'm not sure if this is a mistake I'm making or whether
I have found a different bug of some sort.
* WIP #653 - Delete two tests
These two couldn't easily be fixed, in both cases they were
integration tests which involved passing through many classes.
It wasn't immediately clear what needed to be done to fix them.
As noted in the issue description, removing them was an
acceptable fix.
* WIP #653 - Fix a failing test
I split this test into two. Per the discussion at:
https://github.com/xunit/xunit/issues/350
XUnit seems quite opinonated about not having assertion messages.
Thus, without changing assertion library (which deserves discussion
before I just do it), the logical next best thing is to split into two
single-assert tests, so it's clear which assertion failed on a test
failure.
Also, I moved the AutoMoqData attribute to the shared test lib, so
that it can be used anywhere. That allowed me to eliminate the
constructor for this test class, except for initialising the base class.
* Provisionally resolve#653 - reinstate tests in CI
This should complete the issue although we need to see a
passing CI build with this code change before we can say
it's done.
* Provisionally resolves#653 - Add test script
* Initial version of workflow reviver
* Fix DI things
* Rename workflow builder parameter to `builder`
* Update EF Core stores to use short-lived db contexts
* Update serializer to use new settings to reset ID seed
* Write fault details
* Add faulty workflows sample project
* Switch to free & open source Z.EntityFramework.Plus.EFCore
* Add content type header
* Fix call to virtual OnSaving/OnLoading
* Fix retry
Before this change, the aforementioned activities would always schedule the Done outcome.
After this change, the Done outcome is scheduled **after** the Iterate branch and True or False branches have completed