Commit graph

37 commits

Author SHA1 Message Date
Sipke Schoorstra 2b77ac8fe0 Handle potential null dictionary 2021-05-28 16:38:59 +02:00
Sipke Schoorstra 899551463e Refactor workflow collection and execution 2021-05-16 21:05:34 +02:00
Sipke Schoorstra ce957b95e7 Cleanup 2021-04-07 13:13:13 +02:00
Sipke Schoorstra 38be994e31 Break up WorkflowRunner into smaller types and extracted reusable trigger logic 2021-04-02 12:43:14 +02:00
Sipke Schoorstra 6fef9874da **BREAKING API** Update Builder API to allow to connect to named activities as well as activities by type name
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.
2021-03-26 11:40:22 +01:00
Sipke Schoorstra 0c15c94ea7
Telnyx Activities (#768)
* Fix liquid syntax for accessing activity output

* Initial scaffolding of Telnyx module + API changes

* Make Telnyx Notification activity blocking

* Implement Telnyx correlation

* Post workflow suspension tasks improvements

* Add Telnyx activities

* Add HangupCall and TransferCall activities

* Call activity improvements
2021-03-17 13:07:14 +01:00
Craig Fowler 2320d216f2
Resolve #683 - Tests to prove no exception (#758)
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.
2021-03-14 14:38:58 +01:00
Craig Fowler 32bcf9a751 WIP #728 - Add test cases for persistence
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.
2021-03-09 19:57:02 +00:00
Craig Fowler 672e32a7ca WIP #552 - Add unit test to repro
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.
2021-03-06 17:22:37 +00:00
Craig Fowler f34409696d
Should resolve #653 - Reinstate tests in CI process for v2 branch (#658)
* 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
2021-02-25 09:24:00 +01:00
Sipke Schoorstra 0bf3fecf18 Rename IfElse to If 2021-02-20 15:56:32 +01:00
Sipke Schoorstra a02147d2ee Fix Finish + CompositeActivity 2021-02-13 11:16:20 +01:00
Sipke Schoorstra 7cfe24ba94
Implement revival of faulted workflow (#595)
* 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
2021-01-30 12:47:50 +01:00
Sipke Schoorstra fcfe7f08b4 Change For/While/ForEach/IfElse behavior
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
2021-01-12 09:28:48 +01:00
Sipke Schoorstra 020e74e7bc Use shared Iterate outcome const 2021-01-03 19:22:17 +01:00
Sipke Schoorstra 993e08ea89
Refactored Switch Activity (#545)
* Add IfThen activity + sample

* Add match mode

* Rename IfThen to Switch
2020-12-29 16:40:21 +01:00
Sipke Schoorstra 28ac92b6ff
Introduce Workflow Instance Name (#538)
* Add Name property to Workflow Instance models and update Dashboard UI

* Add SetName activity

* Add naming workflow sample

* Add modal html

* Implement search by workflow instance name
2020-12-24 14:30:55 +01:00
Sipke Schoorstra 8078e7bccc Disable tests due to removed ExecutionLog 2020-12-20 20:20:36 +01:00
Sipke Schoorstra c047d66942 Update packages 2020-12-19 15:35:11 +01:00
Sipke Schoorstra d6cc7d7f56
Implement Specification pattern (#517)
* Add specifications

* Update persistence providers with specification pattern
2020-12-14 17:15:39 +01:00
Sipke Schoorstra 0facd8f93f
Introduce activity type providers (#480)
* Add activity type provider API

* Rename ReceiveHttpRequest to HttpRequestReceived
2020-11-30 15:21:36 +01:00
Sipke Schoorstra 0038702dd8 Fix gRPC serialization 2020-11-14 17:46:25 +01:00
Sipke Schoorstra be92fe7d74 Incremental work on activity picker fetching activities from Elsa server using gRPC 2020-11-14 15:44:03 +01:00
Sipke Schoorstra c75196f696 Add component tests 2020-11-13 20:47:08 +01:00
Sipke Schoorstra 3a9eaeb799 fix Signal activities, triggers and add sample 2020-11-03 16:58:00 +01:00
Sipke Schoorstra ae40d36c72 Fix Instant event behavior 2020-10-30 16:16:06 +01:00
Sipke Schoorstra 6755002f51 Add file/blob storage-based provider + test 2020-10-23 14:20:52 +02:00
Sipke Schoorstra 7d77e501f6 Fix While activity + add test 2020-10-23 14:00:10 +02:00
Sipke Schoorstra bc4924e57b Add Switch extensions + tests 2020-10-23 13:46:34 +02:00
Sipke Schoorstra f8e4cd1e6c Add IfElse extensions + tests 2020-10-23 13:20:22 +02:00
Sipke Schoorstra a4d7713ae7 Fix Join activity 2020-10-23 12:40:33 +02:00
Sipke Schoorstra 7c807c4e71 Fix Join behavior 2020-10-22 22:38:05 +02:00
Sipke Schoorstra 9663040c31 Rename Complete activity to Finish and add test 2020-10-22 20:34:12 +02:00
Sipke Schoorstra 39890d1460 Fix ForEach scheduling (introducing post-schedule) 2020-10-21 21:25:53 +02:00
Sipke Schoorstra 3f276e25be Rename builder to workflow 2020-10-21 19:55:21 +02:00
Sipke Schoorstra ed7265bb61 Add ParallelForEach activity 2020-10-21 19:54:42 +02:00
Sipke Schoorstra bd3b41440a Incremental work on tests and QA 2020-10-19 22:12:11 +02:00