Skip to content
DataMiner DoJo

More results...

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
Search in posts
Search in pages
Log in
Menu
  • Updates & Insights
  • Questions
  • Learning
    • E-learning Courses
    • Empower Replay: Limited Edition
    • Tutorials
    • Open Classroom Training
    • Certification
      • DataMiner Fundamentals
      • DataMiner Configurator
      • DataMiner Automation
      • Scripts & Connectors Developer: HTTP Basics
      • Scripts & Connectors Developer: SNMP Basics
      • Visual Overview – Level 1
      • Verify a certificate
    • Video Library
    • Books We Like
    • >> Go to DataMiner Docs
  • Expert Center
    • Solutions & Use Cases
      • Solutions
      • Use Case Library
    • Markets & Industries
      • Media production
      • Government & defense
      • Content distribution
      • Service providers
      • Partners
      • OSS/BSS
    • Agile
      • Agile Webspace
      • Everything Agile
        • The Agile Manifesto
        • Best Practices
        • Retro Recipes
      • Methodologies
        • The Scrum Framework
        • Kanban
        • Extreme Programming
      • Roles
        • The Product Owner
        • The Agile Coach
        • The Quality & UX Coach (QX)
    • DataMiner DevOps Professional Program
      • About the DevOps Program
      • DataMiner DevOps Support
  • Downloads
  • More
    • DataMiner Releases & Updates
    • Feature Suggestions
    • Climb the leaderboard!
    • Swag Shop
    • Contact
    • Global Feedback Survey
  • PARTNERS
    • All Partners
    • Technology Partners
    • Strategic Partner Program
    • Deal Registration
  • >> Go to dataminer.services

Dynamic column name in GQI – LCA

Solved487 views11th October 2024DOM dymanic column name GQI GQI Data Source LCA
1
Baranisudha Murugesan784 10th October 2024 2 Comments

Im returing a table of rows from GQI to LCA. Currently i have static column names. But I want to make it dynamic. I have fetched the necessary column names from DOM, but i can only access it in the method GetNextPage() as i want DM service to fetch the column names. Below is the code,

public GQIPage GetNextPage(GetNextPageInputArgs args)
{
var rows = new List<GQIRow>();
var serviceList = GetElements();
_logger.Information("SERVICE LIST -- " + serviceList.Count);
foreach (var service in serviceList)
{
var templateInstance = _domHelper.DomInstances.ReadAll().Where(x => x.GetSectionField<string>(
Em_Resourcemanagement.Sections.Protocol.Id,
Em_Resourcemanagement.Sections.Protocol.Workflow_Name) == service.Name && x.GetSectionField<string>(Em_Resourcemanagement.Sections.Serviceparams.Id,
Em_Resourcemanagement.Sections.Serviceparams.Is_Resource_Console) == "True");
foreach (var instance in templateInstance)
{
_resources=GetPidsFromDom(instance);
}
_logger.Information("ServiceName - " + service.Name);
var childInfos = service.Children.ToList();
//my other logics

_logger.Information("ROWS Length -- " + rows.Count);
return new GQIPage(rows.ToArray());
}

public GQIColumn[] GetColumns()
{
var resourceColumns = _resources.Select(x => new GQIStringColumn(x.DisplayColName)).ToList();
resourceColumns.Insert(0, new GQIStringColumn("Service"));
resourceColumns.Insert(1, new GQIStringColumn("Element"));
return resourceColumns.ToArray();
}

Previously i have declared the column names in OnInit function itself. After changing my code like this im getting error in my LCA. based on the logs i can see GetNextPage is not reached. The method hierarchy is On init function, Argument processed, Get Columns - error is caught in Get columns function and _resources will be empty

Marieke Goethals [SLC] [DevOps Catalyst] Selected answer as best 11th October 2024
Sebastiaan Dumoulein [SLC] [DevOps Enabler] commented 10th October 2024

Since _resources is only initialized in the GetNextPage() step, it remains null during the GetColumns() step, which is called earlier. It might be possible to execute your logic in the OnInit step so that it’s ready for the GetColumns() step. Have you already considered this? If so, what issue did you encounter?

Baranisudha Murugesan commented 10th October 2024

I have added this code in get columns itself and now i could see the columns. Init was giving error as the input argument was not yet processed.
thanks for the suggestion

1 Answer

  • Active
  • Voted
  • Newest
  • Oldest
1
Sebastiaan Dumoulein [SLC] [DevOps Enabler]12.79K Posted 10th October 2024 0 Comments

As mentioned in the comments on your question, the _resources should be fetched and set in the first lifecycle hook that has all the necessary information.

You're depending on both the callback (provided during OnInit) and the arguments (available in OnArgumentsProcessed). According to the lifecycle documentation, OnArgumentsProcessed is called after OnInit, meaning you will have all the required information starting from that point.

Docs: https://docs.dataminer.services/user-guide/Advanced_Modules/Dashboards_and_Low_Code_Apps/GQI/Extensions/Ad_hoc_data/Ad_hoc_Life_cycle.html?q=cycle

Marieke Goethals [SLC] [DevOps Catalyst] Selected answer as best 11th October 2024
You are viewing 1 out of 1 answers, click here to view all answers.
Please login to be able to comment or post an answer.

My DevOps rank

DevOps Members get more insights on their profile page.

My user earnings

0 Dojo credits

Spend your credits in our swag shop.

0 Reputation points

Boost your reputation, climb the leaderboard.

Promo banner DataMiner DevOps Professiona Program
DataMiner Integration Studio (DIS)
Empower Katas
Privacy Policy • Terms & Conditions • Contact

© 2025 Skyline Communications. All rights reserved.

DOJO Q&A widget

Can't find what you need?

? Explore the Q&A DataMiner Docs

[ Placeholder content for popup link ] WordPress Download Manager - Best Download Management Plugin