Decreasing WorkWithPlus generation time

WorkWithPlus generates a wide set of features that help you to quickly develop powerful applications. These features are always generated by using GeneXus code. A GeneXus developer can develop by its own this kind of features but the effort and cost of doing it for each screen is really high. And you also need to consider the cost and effort of maintaining those screens.

By using WorkWithPlus you can apply these features with zero effort and these features will evolve together with the evolution of the Knowledge Base.

Some of these features are really advanced so they required extensive code and complex web forms to be developed. As the complexity of the features increases, the generated object increases its complexity. In consequence, the GeneXus specification and generation time of the object increases too.  

In this page we'll suggest some ideas and tips you should consider in order to decrease your screens generation time. We'll focus on the "Selection" object. In most cases this implies to analyse the screens and define which features and resources are strongly necessary. You should lead to a compromise between features within the screen and the generation time that you consider reasonable for you.

Dynamic Filters

Dynamic Filters  allows user to decide at runtime which filters to apply, and which operators are associated to that filters.

 

Generated "Person" Web Panel with Insert, Excel, PDF, and Select columns buttons. A red box highlights three active filters: Search in First Name value Contains "e", Search in Last Name value Contains "e", and Search in Birth Date value "Between 26 and 50". Below, a grid lists Full Name, First Name, Id, Last Name, and Company columns with matching person rows and pagination controls.

When you include this kind of filters, WorkWithPlus adds in the web form all the necessary variables to create all the possible combinations of filters and operators that the user can include:

 

GeneXus form layout showing three repeated rows of Dynamic Filters controls: a "Search in" &DynamicFiltersSelectorN dropdown, a "value" &DynamicFiltersOperatorN dropdown, paired birth-date range fields (&PersonBirthDateN to &PersonBirthDate_ToN), and text boxes &PersonFullNameN, &PersonFirstNameN, &PersonGenderN, &PersonHobbyN, each row ending with add (+) and remove (-) buttons.

In addition, it will include all the necessary code and conditions within the Data Selector.

Suggestions

 

1 - Leave only the necessary attributes and operators in the screen

Analyse which attributes and operators are strongly needed in the screen.

When you add a new operator the code is added to manage all the possible combinations. For example, for a Numeric attribute, the default operators are: Lower than, Equals, Higher than but you could leave just two: Lower/Equal e Higher than.

If needed, you can customise the operators and filters applied by default from the WorkWithPlus Settings:

 

WorkWithPlus pattern editor Filters tree with the "Character" node (children StartsWith, Contains, Empty) highlighted by a red arrow pointing to its Properties panel. Properties show Default Operator "like", Default Operator Type "With dynamic operators", Include In Full Text Filter "True", Grid Title Filter settings (Search Box "Single", Data List "Dynamic", Allow Multiple Selection "False", Data List Max Values "50"), and Range settings (Range Middle Text "WWP_MiddleText", From/To Default Operators ">="/"<=").

Another tip, is to set as "Fixed Filters" those filters that should be always visible in the screen:

 

Filters tree section showing Dynamic Filters entries for PersonGender and PersonHobby (with StartsWith/Contains operators), followed by a "Fixed Filters" node highlighted in a red box containing PersonBirthDate (Past, Today, InTheFuture, Range), PersonFullName (StartsWith, Contains), and PersonFirstName (StartsWith, Contains).

 

2 - Set the "Max Filter" property

 

WorkWithPlus pattern tree for "ExtraSelection testsel (Person)" showing TableMain with TableActions (Insert, Export, ExportReport, EditColumns), TableRightHeader with ManageFilters, and TableFilters containing Orders and a selected "Dynamic Filters" node with child operator definitions for PersonBirthDate, PersonFullName, PersonFirstName, PersonGender, and PersonHobby. A red arrow links the node to its "Max Filters" property set to 3. The right preview panel shows the generated Web Panel with Insert, Excel, PDF buttons and a Full Name grid with sample Value rows and "Page 1 of 2" pagination.

With this property you can define how many filters can be included at the same time at runtime. By default this property is set to "3", but you can change the value according to your needs.

This is important because the amount of conditions is multiplied by the amount of filters that can be used to create all the possibilities. So, if you can decrease it to "2" or "1" it will generate a huge impact in the generation time

 

3 - Use "Full Text Filter"

From WorkWithPlus 12 you can use Full Text Search Filter in your screens:

 

WorkWithPlus pattern tree for "Selection (Person)" with TableFilters expanded to show Orders and a selected "Full text filter" node, pointed to by a red arrow, alongside a list of attributes (PersonId, PersonFirstName, PersonLastName, and others). The preview panel shows the generated Web Panel with Insert, Excel, PDF buttons and a Full Name grid.

In this way, you will be able to have just one filter in the screen where the user can search by all the requested attributes:

 

WorkWithPlus pattern editor with the "Full text filter" node selected and its Attributes property set to "Default attributes" (highlighted). An open "Full text filter attributes" dialog lists attribute name/description pairs (e.g. PersonId/Person Id, PersonFirstName/First Name, PersonFullName/Full Name, PersonBirthDate/Birth Date) with Add, Remove, Move up, Move down, OK, and Cancel buttons.

By using this kind of filters you will have just one variable in the screen and you will avoid the code regarding the possible combinations.

So, if possible we recommend to delete your "Dynamic Filters" from the instance and use "Full Text Search" instead. You will notice a huge impact in the generation time.

Column Filters

Column Filters allows the user to filter records from the title of the grid columns, and also reorder them, both server side:

 

Generated grid with a "Search in Full Name value Starts with" filter at top and columns Full Name, Id, Last Name, Nickname, Company, Home address. The Last Name column header dropdown is open, highlighted in red, showing "Sort from A to Z", "Sort from Z to A", a search box, and a scrollable facet list with value counts (Alvarez (7), Bimson (3), Bolt (4), Cage (6), Carlsen (1)).

When you include this kind of filters, WorkWithPlus needs to include in the web form, all the necessary user controls to show the drop down menu in each column:

 

GeneXus Web Form designer layout showing four gear-menu dropdown controls (each listing Option 1, Option 2, Option 3) positioned beside placeholder text boxes labeled &ddo_PersonIdTitleControlIdToReplace, &ddo_PersonFirstNameTitleControlIdToReplace, &ddo_PersonLastNameTitleControlIdToReplace, and &ddo_PersonFullNameTitleControlIdToReplace, representing dynamic filter title control placeholders in the form.

 

In addition, it will include the necessary code within the events to manage all the possible actions within the drop down menu and the possible conditions. 

As the filters and orders are server-side, they are developed by using Rest Services, so WorkWithPlus generates a procedure (exposed as Service) with the necessary code:

 

GeneXus procedure "PersonWWGetFilterData" Source code tab showing the auto-generated header comment "Generated by DVelop Work With Plus Pattern <a href='Start'>Start</a> - Do not change", variable initializations (&Options, &OptionsDesc, &OptionIndexes), and a Do Case block loading options per dynamic filter DDO (e.g. PersonFirstName, PersonLastName, PersonFullName, PersonHobby, CompanyName). The Properties panel shows Expose as Web Service "True" with REST Protocol enabled, pointed to by a red arrow.

As you can see, this is a complex feature with a complex development behind.

Suggestions

 

1 - Define which attributes really need this resource

In most escenarios, you don't need this resource in each column. So, you can easily define which column will have it: 

 

WorkWithPlus pattern editor shows the node tree for a Person Selection object, with the PersonHomeTelNumber attribute selected. The Properties panel on the right displays settings for that attribute grouped under Link, Form, Control Info, Advanced Security, General, Responsive Customization, Columns Selector, Export, ExportReport, ExportCSV, and Title Filter, including Autolink True, Width 0, and Visible by Default True. A red arrow points from the tree node to the 'Include Title Filter' property.

You should always try to wisely combine "Dynamic Filters" with "Column Filters" in order to avoid repeating them.

 

2 - Define which data types will include Column Filters

You can define which data types will include by default the Column Filters. In this way, you can define that some data types are included in "Full Text Filter" and the others as "Columns Filters":

 

WorkWithPlus Filters node tree lists filter types (Character, Varchar, Numeric, Date) with the Numeric node selected. A red arrow points to the Properties panel's Filter tab, highlighting 'Include In Full Text Filter' set to False, alongside other Grid Title Filter settings such as Include Title Filter True, Search Box Range, and Data List Max Values 50.

This is done just once, and then every instance will consider this configuration.

 

3 - Define the behaviour of the "Title Sorting"

Title Sorting is developed by adding a drop down menu within the column (the same drop down menu that is included for "Column Filters") so the web form is really complex as it has all the drop down menus. This will imply more generation time needed.

 

Generated grid header row shows column titles Company, Name, Description, and Large Description, each with a dropdown arrow. The Name column's dropdown is open, displaying sort options 'Sort from A to Z' and 'Sort from Z to A', with a red arrow pointing to the ascending sort option; a sample row '3 3M' with a company description appears below.

If an attribute doesn't have its "Column Filter", a drop down menu will be included anyway for the "Title Sorting". This behaviour can be changed so when the attribute doesn't have "Column Filter", the "Title Sorting" won't include the drop down menu:

 

WorkWithPlus Settings tree shows the Grid node selected under WorkWithPlus Settings. A red arrow points to the Properties panel's Orders section, highlighting 'Include Sortable By Title In Drop Down Options' set to 'Only when DDO created for other options', among other Grid properties like Save Grid Current Page True and Column Auto Resize True.

In this way you will keep the sorting feature but you won't include the drop down menu in the form (and the code regarding it)

Security

If you use Advanced Security or GAM + WorkWithPlus, you can include security for each attribute. This is a really useful feature but it will include the necessary code to validate the permissions for each attribute:

 

Code editor shows the auto-generated 'InitializeColumnsSelector' subroutine created by the DVelop WorkWithPlus pattern. It loads the columns selector state, checks security functionality keys for attributes like PersonFirstName, PersonGender, and PersonHomeTelNumber via SecGAMIsAuthByFunctionalityKey, and calls 'RemoveColumn_ColumnsSelector' when access is denied.

You should include this resource when necessary.

Tabs in View

WorkWithPlus generates a tab for each related transaction within the View object. By default it generates at most 10 tabs, but you can decrease this number in order to generate less tabs by default (you can manually add them later if necessary)

 

WorkWithPlus Settings tree shows the Template node selected. A red arrow points to the Properties panel's Default Instance section, highlighting 'Max View Tabs' set to 10, along with related settings like Tabs for parallel transactions True, Generate View True, Generate Selection True, and Max Grid Attributes 25.