question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ForEach and While missing Iterator in designer?

See original GitHub issue

Should the ForEach and While activity classes have ‘Iterate’ and ‘Done’ outcomes set in the attribute declaration? At the moment I’m not seeing the Iterate option in the designer.

e.g.

[ActivityDefinition(
    Category = "Control Flow",
    Description = "Iterate over a collection.", 
    Icon = "far fa-circle", 
    Outcomes = new[] { OutcomeNames.Iterate, OutcomeNames.Done })]
public class ForEach : Activity { ... }

instead of

[ActivityDefinition(Category = "Control Flow", Description = "Iterate over a collection.", Icon = "far fa-circle")]
public class ForEach : Activity { ... }

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
martin-indexebcommented, Jul 14, 2020

Jayachandra21, depending on how you are using the designer, you can always patch this manually for now with something like this:

public Task<ActivityDescriptor[]> GetActivityDefinitions() {
      var patchControlFlows = new List<string>() { "For Each", "While" };
      var definitions = _options.Value.ActivityDefinitions.ToArray();
      definitions
        .Where(x => patchControlFlows.Contains(x.DisplayName))
        .Each(x => x.Outcomes = new[] { OutcomeNames.Iterate, OutcomeNames.Done });
      return Task.FromResult(definitions);
}
0reactions
martin-indexebcommented, Oct 29, 2020

Thanks for the fix guys.

Cheers, Martin

Kind regards, ​ ​Martin Martin Clarke Index eBusiness Ltd +44 1252 636060 martin@indexeb.co.uk www.indexeb.co.uk Index eBusiness Ltd is a company registered in England and Wales under number 07337877. ​Registered office: 182-184 Fleet Road, Fleet, Hampshire, GU51 4BS, United Kingdom. Index eBusiness Ltd accepts no liability for the content of this email, or for the consequences of any actions taken on the basis of the information provided, unless that information is subsequently confirmed in writing. Any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. From: Sipke Schoorstra notifications@github.com Sent: 29 October 2020 08:32 To: elsa-workflows/elsa-core elsa-core@noreply.github.com Cc: Martin Clarke martin@indexeb.co.uk; Author author@noreply.github.com Subject: Re: [elsa-workflows/elsa-core] ForEach and While missing Iterator in designer? (#339)

Indeed. Thanks @mertyildiz41https://github.com/mertyildiz41

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/elsa-workflows/elsa-core/issues/339#issuecomment-718477341, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AM7CV3PGY7233FZB3SKXKYDSNESBLANCNFSM4OWPIRXA.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why can't we assign a foreach iteration variable, whereas ...
foreach is a read only iterator that iterates dynamically classes that implement IEnumerable, each cycle in foreach will call the ...
Read more >
foreach, the last iteration is not executed
I have two nested \foreach loops. The inner loop works fine, but the outer loop does not. There are two commands which should...
Read more >
Iterators in Java
The Iterator provides a safe way to remove elements from a collection during iteration without causing any concurrent modification exceptions.
Read more >
ES6 In Depth: Iterators and the for-of loop
Might just mention that Array.some can at least deal with the missing “break” of Array.forEach by returning true (and “continue” can be done...
Read more >
Iterator - Manual
Order of operations when using a foreach loop: 1. Before the first iteration of the loop, Iterator::rewind() is called. 2. Before each iteration...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found