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
    • YouTube Videos
    • Solutions & Use Cases
      • Solutions
      • Use Case Library
    • Agility
      • Book your Agile Fundamentals training
      • Book you Kanban workshop
      • Learn more about 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)
    • >> Go to DataMiner Docs
  • DevOps
    • About the DevOps Program
    • Sign up for the DevOps Pogram
    • DataMiner DevOps Support
    • Feature Suggestions
  • Swag Shop
  • Downloads
  • PARTNERS
    • All Partners
    • Technology Partners
    • Strategic Partner Program
    • Solutions
    • Deal Registration
  • Contact
    • Sales, Training & Certification
    • DataMiner Support
    • Global Feedback Survey
  • >> Go to dataminer.services

How to get InterfaceProfile data in ProfileLoad Script

Solved1.31K views14th December 2020process automation
4
Mieke Dryepondt [SLC] [DevOps Advocate]3.69K 14th December 2020 0 Comments

How can I retrieve the values of the params associated to the Input profile definition Instance?
The ProfileLoad script has an script param: ProfileInstance. This contains a Json with Node and In:
ProfileInstance {"Node":"89704d47-4ebf-4a8b-b10a-ebe0c40863fd","In":"e96cd576-ac3e-4e23-9fa7-f9d6300fd5ea"}

NodeProfileConfiguration nodeProfileConfiguration = new NodeProfileConfiguration(this.InputData.ProfileInstance);
var helper = new ProfileParameterEntryHelper(engine);
engine.GenerateInformation("** amount of interfaces " + nodeProfileConfiguration.Interfaces.Count());

When using this code the amount of interfaces is 0.
So how can I get the params of the Input Interface?

Mieke Dryepondt [SLC] [DevOps Advocate] Selected answer as best 14th December 2020

2 Answers

  • Active
  • Voted
  • Newest
  • Oldest
5
Jarno Lernou [SLC] [DevOps Enabler]5.07K Posted 14th December 2020 2 Comments

In our script, we load the script parameter like this:

ProfilesInstance = LoadScriptParameter<Dictionary<string, Guid>>(engine, ProfileInstanceParamName);

By using the "In" key, we get the profile instance:

InterfaceProfileInstance = profileHelper.GetProfileInstance(interfaceProfileInstanceGuid);

Then you can do something like this to get a specific parameter:

ProfileParameterEntry profileParameter = InterfaceProfileInstance .Values.SingleOrDefault(x => x.Parameter.Name == paramName);

Mieke Dryepondt [SLC] [DevOps Advocate] Selected answer as best 14th December 2020
Jarno Lernou [SLC] [DevOps Enabler] commented 14th December 2020

Note: the code examples are using the ProfileManagerHelper. In case you use the ProfileHelper – which is more recent and prefered – you can get the profile instance by doing this:

FilterElement filter = ProfileInstanceExposers.ID.Equal(guid);
interfaceProfileInstance = profileHelper.ProfileInstances.Read(filter).FirstOrDefault();

Mieke Dryepondt [SLC] [DevOps Advocate] commented 14th December 2020

Thank you Jarno. The below piece of code did the trick for me.

string domReference = string.Empty;
var interfaceProfileInstanceGuid = InputData.ProfileInstance[“In”];
var profileHelper = new ProfileHelper(Engine.SLNet.SendMessages);
FilterElement filter = ProfileInstanceExposers.ID.Equal(interfaceProfileInstanceGuid);
var interfaceProfileInstance = profileHelper.ProfileInstances.Read(filter).FirstOrDefault();
if (interfaceProfileInstance != null)
{
var domInputParam = interfaceProfileInstance.Values.FirstOrDefault(x => x.Parameter.Name == Constants.PD.Parameters.DomReference);
if(domInputParam!= null)
{
string value = domInputParam.Value.Type == ParameterValue.ValueType.Double ? Convert.ToString(domInputParam.Value.DoubleValue) : domInputParam.Value.StringValue;
domReference = value;
}
}

You are viewing 1 out of 2 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