0

Is there a way to test whether an Azure Durable Functions Activity Function exists other than calling context.CallActivityAsync and catching an exception? I'd like to have graceful "not yet implemented" functionality and I'd like to check this before the code is ready to actually use the Activity Function.

jeffcodes
  • 36
  • 1
  • I want to know why you have this need? Why is there a situation where a non-existent activity trigger is used? – Cindy Pau Jun 15 '20 at 08:21

1 Answers1

0

If you are using the latest version of the extension (2.2.2 at the time of writing this answer), we have added a Durable Functions analyzer to the extension, meaning we now provide compile time warnings if you try to call an Activity Function that does not exist. The Durable Task analyzer should also provide many other compile time guarantees to make sure you are not violating any orchestration rules.

Connor McMahon
  • 1,318
  • 7
  • 15
  • Thanks Connor. I'm afraid I'm looking for a runtime answer, but the compile time analysis is certainly goodness. For context, the scenario I have is an application to test long running workflows. The front end of this application is using SpecFlow/Gherkin to define test scenarios and steps. The steps are bundled and sent to the Durable Functions app for execution that may run for days or weeks. The steps to run the tests are created with Activity functions. – jeffcodes Jun 17 '20 at 20:09
  • Since the scenario/step definitions are decoupled from the test execution (which provides nice benefits), all the necessary activity functions to run the test may not exist when specflow executes the scenario. That's ok, but I want to avoid starting the long running test if I can't eventually execute all the steps to complete it. So I would like to determine, at the time the orchestration function receives the bundle of steps to execute, if activity functions exist for each step so I can gracefully fail the test without launching part of it. – jeffcodes Jun 17 '20 at 20:09
  • Note that the activity functions implementing the test steps are reusable by many scenarios, so it will often be the case that most of the steps for a particular new scenario exist but not all of them. – jeffcodes Jun 17 '20 at 20:10