Replies: 5 comments 4 replies
-
Thanks for the great feedback. Some of the things you mention require improvements to be made, others may need some clarification. The comment on lack of XML comments is duly noted 👍🏻
Although the response does get recorded in the log, it's currently not exposed through the UI. This is something we need to add. For example, take the following workflow that makes an HTTP requests but with a missing field that is required by the API:
Maybe this is a bug in 2.3, but I don't see this issue when I try with the current version. I am able to configure multiple outcomes I wish to handle in the workflow, like this: With regards to the programmatic API however, I see your point and is a complete oversight in the extension method for the SendHttpRequest API. What we need is an additional parameter that lets you create connections from the activity to subsequent activities. E.g.: builder.SendHttpRequest(activity => activity
.WithUrl(new Uri("https://reqres.in/api/login"))
.WithMethod(HttpMethod.Post.Method)
.WithContent("{\"email\": \"peter@klaven\"}")
.WithReadContent(true)
.WithSupportedHttpCodes(new[]{ 200, 400, 500 }),
activity =>
{
activity.When("200").WriteLine("OK!");
activity.When("400").WriteLine("Missing some fields!");
activity.When("500").WriteLine("Server is sad :(");
});
} I just pushed an update that allows you to do the above. Once this build completes successfully, you can try it using the latest MyGet preview packages if you want. If you don't want to upgrade to 2.5.1 prereleases yet, you could try to following syntax instead: builder.Then<SendHttpRequest>(activity => activity
.WithUrl(new Uri("https://reqres.in/api/login"))
.WithMethod(HttpMethod.Post.Method)
.WithContent("{\"email\": \"peter@klaven\"}")
.WithReadContent(true)
.WithSupportedHttpCodes(new[] { 200, 400 }), activity =>
{
activity.When("200").WriteLine("OK!");
activity.When("400").WriteLine("Missing some fields!");
activity.When("500").WriteLine("Server is sad :(");
}); Which is almost the same, the difference being that, here I'm using |
Beta Was this translation helpful? Give feedback.
-
Hello! Thanks for your quick reply. I'm really looking forward to having this issue fixed! I've seen that the bug you've created for this has been added to the 2.5.1 milestone, but that milestone is no logner part of the milestones page. The earliest next milestone listed there is now 2.6.0. Will 2.5.1 be in fact 2.6.0? Regarding the issue with 2.5.0, here's what I've done:
Note: I've finally reverted all ELSA NuGet packages back to 2.3.0 and restored my ELSA 2.3.0 DB using my DB snapshot. Then I've re-applied all upgrades up to 2.4.2.1. This is where I'm now. My workflows still appear in the registry. I hope this is enough for you to repro that issue. |
Beta Was this translation helpful? Give feedback.
-
That is indeed confusing! I renamed the 2.5.1 milestone to 2.6.0 - I should probably have just closed 2.5.1 instead and create 2.6.0 😄 |
Beta Was this translation helpful? Give feedback.
-
Hello Sipke, I've just attempted an upgrade from ELSA 2.4.2.1 to 2.6.0, but unfortunately the result is exactly the same as with my previous attempt with 2.5.0: none of my code-built workflows appear anymore in the Workflow Registry in the Dashboard! So once again, I had to roll back the upgrade. This means that I'm stuck with ELSA 2.4.2.1 and consequently I can't get any bug fix (especially #2748, which was initiated by this discussion). I have no clue what's specific to my situation and why you can't reproduce it with a code-built workflow created with a previous version (say, 2.4.2.1) and then all ELSA NuGet packages are upgraded to 2.6.0. A question you should ask yourself is what in ELSA (especially 2.5.0 and later) can cause a code-built workflow never to appear in the Registry? Please help! |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Hello,
I'm new to ELSA (I'm using 2.3) and I still haven't figured out what's the best way to handle the possible results of a
SendHttpRequest
.Note: I don't use the designer to build my workflows, only builders.
I have a very common use case here:
SendHttpRequest
returned a successful HTTP status code (like 200 or 201), I want to execute another part of my workflow.Problems:
.WithReadContent(true)
has been specified on theSendHttpRequest
. This makes it very difficult to identify the root cause of the failed HTTP request.SendHttpRequest
)..WithSupportedHttpCodes
.Using the "Done" outcome is not acceptable because once connected to another activity, that other activity is also executed when
SendHttpRequest
has returned an error HTTP status code.I've tried to use
.When("200")
to connect with HTTP status code 200, but it doesn't work as expected:SendHttpRequest
, no connection is created (and ELSA does not notify you of this problem, which is questionable).SendHttpRequest
has returned HTTP status code 200, then the connection is finally visible in the workflow instance. This also implies that, for a given workflow, its diagram and its instance diagrams may be significantly different in terms of connections, which is questionable.I even tried to use an
If
activity to manually check the HTTP status code, but getting theResponse
property of theSendHttpRequest
withGetNamedActivityPropertyAsync
is impossible, asIf
has no provision for an async expression for the first parameter.So I'm stuck. Please help!
One last request: the lack of XML comments in most ELSA code (which means that no documentation is displayed in VS with IntelliSense), makes the learning curve of ELSA very slow. Please kindly consider adding XML comments to the public surface of the ELSA APIs.
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions