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

How to get InterfaceProfile data in ProfileLoad Script

Solved1.24K views14th December 2020process automation
4
Mieke Dryepondt [SLC] [DevOps Advocate]3.60K 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.03K 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;
}
}

1
João Severino [SLC] [DevOps Catalyst]13.02K Posted 14th December 2020 0 Comments

Hi Mieke,

The profile instance script parameter is a serialized dictionary of GUIDs that you then can use to retrieve data from the system.

Are you using the template “PA_ProfileLoadTemplate” script as a base for yours? Could you test with that one to see if you get the same result?

João Severino [SLC] [DevOps Catalyst] Answered question 14th December 2020
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