2016-11-21 23-23-05
Gonçalo Borrêga
Select part of an action flow and "Refactor to action"
3633
Views
25
Comments
Implemented
Backend
OutSystems 10

Allow creating an action from the selected section of a flow. The action would get the required inputs and outputs, and the flow from where it was extracted should automatically fill the action parameters with the local variables it was using

2016-04-21 20-09-55
J.
 
MVP
That would be a nice refactoring tool,



like this option!

Nice - perhaps it could be called the 'refactoring rubberband?'
Thumbs up! : )

Not sure if this is new, but have been in my head in a long time now.

In some good IDE's there is an option that allows developers to better write code by not allowing it to be very big, at least at screen level actions. 

This feature should allow you to:

- select a sub-set from our logic flow, 

- create a new Server action with the selected flow inside;

- All the unreachable variables inside that action, should becamean Input variable;

- All the needed variables (in the original flow) should becomethe Output variables from the new screen action and the variables replaced bythose Output vars from the action; 

 

That will provide us with a much faster refactoring with noErrors, allowing every developer to properly follow the best practices andsimplify the logic inside the actions and screen actions.


This is the idea:

https://refactoring.com/catalog/extractMethod.html



Merged from '"Extract flow to Action" operation that allows faster encapsulation of logic' (idea created on 2017-02-23 10:59:09 by José Queirós), on 2017-02-25 10:35:40 by Goncalo Borrega
Select part of the flow chart and display the "Create Action" (Refactory)

Merged from 'Select part of the flow chart and display the "Create Action" (Refactory)' (idea created on 2011-12-01 17:16:36 by Carlos Abreu), on 2017-02-25 10:39:02 by Goncalo Borrega
I haven't got a clue what you're talking about. Some explanation please?

Merged from 'Select part of the flow chart and display the "Create Action" (Refactory)' (idea created on 2011-12-01 17:16:36 by Carlos Abreu), on 2017-02-25 10:39:02 by Goncalo Borrega
2016-04-21 20-09-55
J.
 
MVP
What he means is, you select a certain part of a (screen)action, for example a complete for-loop,

then create a custom action for it.


just making life easier, instead of creating an action.
copy/cut the for-loop
paste it in the newly created action.
solve the errors.
link the action in the previous action, so it actually gets called.
etc.


Merged from 'Select part of the flow chart and display the "Create Action" (Refactory)' (idea created on 2011-12-01 17:16:36 by Carlos Abreu), on 2017-02-25 10:39:02 by Goncalo Borrega
- Select a number of (valid) actions from flow
- right click->group or keyboard shortcut
- creates a new action + input/output parameters required to use it


Merged from 'Create Action based on selection' (idea created on 2015-10-01 09:41:08 by Markus Henschel), on 2017-02-25 10:39:29 by Goncalo Borrega
This is an AMAZING idea, thank you! It should also immediately replace the selection with a call to the new Action! Instant refactor!

J.Ja


Merged from 'Create Action based on selection' (idea created on 2015-10-01 09:41:08 by Markus Henschel), on 2017-02-25 10:39:29 by Goncalo Borrega
Yeah, +1 from me. Comes in handy when refactoring.

Merged from 'Create Action based on selection' (idea created on 2015-10-01 09:41:08 by Markus Henschel), on 2017-02-25 10:39:29 by Goncalo Borrega
Awesome! it looks pretty innovative. I've never seen something similar in other programming languages.

Merged from 'Create Action based on selection' (idea created on 2015-10-01 09:41:08 by Markus Henschel), on 2017-02-25 10:39:29 by Goncalo Borrega

It would be nice when I have a bigger action, that I can select some if-clauses, queries etc, press right mouse click 'Create subaction' and that it create a subaction with that logic. 

It would be even better if it automatically generates the right input and output parameters. 



Merged from 'Refactoring: Create a subaction from selected logic-blocks' (idea created on 2017-04-03 12:28:21 by Hans Dollen), on 2017-05-25 10:54:44 by Goncalo Borrega

Hi Hans, 


This idea is the same as: https://www.outsystems.com/ideas/106/select-part-of-an-action-flow-and-refactor-to-action



Merged from 'Refactoring: Create a subaction from selected logic-blocks' (idea created on 2017-04-03 12:28:21 by Hans Dollen), on 2017-05-25 10:54:44 by Goncalo Borrega

Great idea.

2022-07-06 03-36-19
Hanno
 
MVP

Sometimes you want to extract certain logic into a reusable server action. 

It would be nice if there was an option in the designer context menu that would allow this. 

The following should happen when the option is selected:

  • Create a new server action that contains the logic selected
  • In/out parameters should be determined automatically
  • The start and end nodes should link correctly to the logic flow
  • Replace the selected logic in the original screen with the new server action
  • Connector lines should automatically reconnect correctly
  • Set the parameters as needed for the new action call


Merged from 'Extract selected logic to action' (idea created on 2017-09-15 22:35:45 by Hanno Coetzee), on 2017-09-20 04:10:42 by Leonardo Fernandes

This idea is the same as https://www.outsystems.com/ideas/106/select-part-of-an-action-flow-and-refactor-to-action.



Merged from 'Extract selected logic to action' (idea created on 2017-09-15 22:35:45 by Hanno Coetzee), on 2017-09-20 04:10:42 by Leonardo Fernandes
2022-07-06 03-36-19
Hanno
 
MVP

Thanks Pedro. I did do a search but couldn't find any existing ideas   


Moderators, please merge with this idea.



Merged from 'Extract selected logic to action' (idea created on 2017-09-15 22:35:45 by Hanno Coetzee), on 2017-09-20 04:10:42 by Leonardo Fernandes
2014-02-07 17-02-43
Vasco Pessanha

Hi guys,

As promised in our Service Studio's gifts post, I'm happy to announce that a new Extract to Action command was introduced in 10.0.716.0 version. It will allow you to extract and reuse complicated logic that you created in a different place. Just select the piece of logic and click! Your action is now reusable :)

Hope you enjoy the feature :)

Thanks a lot for your feedback, please keep influencing and improving the product. Also, thanks to the MVPs that pre-tested the feature!

Really cool and handy!

2014-02-07 17-02-43
Vasco Pessanha

Hi guys,

Yesterday we found a bug in Extract to Action feature, even after being tested and validated by dozens of Beta users, including some of our MVPs... Unfortunately, these things happen :(

We removed 10.0.716.0 version from the download list and there is already a new version (10.0.717.0) with this problem fixed (available here: https://www.outsystems.com/home/downloads/)

Please, go get it (and sorry for the inconvenience).

Hell yeah! 


I believe that is long overdue. I think that is a core feature for everyone that wishes to enforce encapsulation and good architecture in a Low Code platform. 


Well done!

2014-02-07 17-02-43
Vasco Pessanha

Hey José,

Glad you enjoyed the feature ;)

Oh heck, yes!

I've been itching to use this for the past week, and today, I had something with giant actions that could really do with refactoring. Perfect!

If I may make one small suggestion: place the End where the next node after the refactoring was...

The new End gets put here:

It would be nice - if it's possible - to put it where the next node after the split was, e.g.

2016-11-21 23-23-05
Gonçalo Borrêga
Merged this idea with 'Select part of the flow chart and display the "Create Action" (Refactory)' (created on 2011-12-01 17:16:36 by Carlos Abreu)