elsa-core icon indicating copy to clipboard operation
elsa-core copied to clipboard

ForEach and While missing Iterator in designer?

Open martin-indexeb opened this issue 6 years ago • 10 comments

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 { ... }

martin-indexeb avatar Jul 10 '20 10:07 martin-indexeb

Yeah that would make sense. Not sure how that got removed.

sfmskywalker avatar Jul 11 '20 15:07 sfmskywalker

@sfmskywalker even I am able see the OutcomeNames.Done but not OutcomeNames.Iterate in the workflow designer. But it suppose to be both outcomenames. image

jayachandra21 avatar Jul 14 '20 14:07 jayachandra21

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);
}

martin-indexeb avatar Jul 14 '20 15:07 martin-indexeb

It Resolved the issue.Thank You.

jayachandra21 avatar Jul 14 '20 15:07 jayachandra21

Hello. I have a similar problem. Can someone tell me where to paste this above code to solve the issue ? I can see this in the attribute declaration for the dev branch that I pulled in today.

[ActivityDefinition( Category = "Control Flow", Description = "Iterate over a collection.", Icon = "far fa-circle", Outcomes = "[ 'Done', 'Iterate' ]")]

nimishdesai1989 avatar Jul 25 '20 14:07 nimishdesai1989

Hello. I have a similar problem. Can someone tell me where to paste this above code to solve the issue ? I can see this in the attribute declaration for the dev branch that I pulled in today.

[ActivityDefinition( Category = "Control Flow", Description = "Iterate over a collection.", Icon = "far fa-circle", Outcomes = "[ 'Done', 'Iterate' ]")]

@nimishdesai1989 Paste the above code in the Activity Definition section. Please refer screen below for your reference.

image

jayachandra21 avatar Jul 25 '20 17:07 jayachandra21

@jayachandra21 . Thanks a lot for helping. The issue is resolved now. Many thanks

nimishdesai1989 avatar Jul 25 '20 18:07 nimishdesai1989

#285 #303 at those pull request it's done, i think this issues can close.

mertyildiz41 avatar Oct 29 '20 07:10 mertyildiz41

Indeed. Thanks @mertyildiz41

sfmskywalker avatar Oct 29 '20 08:10 sfmskywalker

Thanks for the fix guys.

Cheers, Martin

Kind regards, ​ ​Martin Martin Clarke Index eBusiness Ltd +44 1252 636060 [email protected] 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 [email protected] Sent: 29 October 2020 08:32 To: elsa-workflows/elsa-core [email protected] Cc: Martin Clarke [email protected]; Author [email protected] 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.

martin-indexeb avatar Oct 29 '20 17:10 martin-indexeb