Skip to main content
1-Visitor
June 21, 2021
Question

Updating only Model tags with some custom service.

  • June 21, 2021
  • 2 replies
  • 1549 views

Hi Team,

 

Suppose I have a set of entities under some project and I want to change the model tags of of all the entities under that project with some custom service (without changing the vocabulary terms), what would be the snippet for this custom service?

 

Thanks in advance.

2 replies

15-Moonstone
June 21, 2021
RK_07051-VisitorAuthor
1-Visitor
June 21, 2021

@abjain 

Actually what happens, all the entities are having different types like Mashups, Things, ThingTemplates etc so I am not able to write a single generic syntax in one code with passing input runtime entity type.

 

Actually I want to access these services with input as dynamic group type just like :-

[EntityType][row.name].AddTags();

 

where input is EntityType.

 

What would be the actual syntax for this scenario.

 

Just like.... Things[ThingName].AddTags()  //default one

 

Please advise.

15-Moonstone
June 21, 2021

@RK_0705 : For each entity you will have then have to find its corresponding base type. For this you can utilize the service 'SearchModelEntities' in SearchFunctions resource. Attaching sample screenshot for its usage. After getting the type, in your service there should be conditional statements(like if/else) for each type where you can call the addatgs for specific type.

Ex:

if (entitytype=='Thing')

{

Things[Enityname].AddTags() ;

}

else if(entitytype=='Mashup')

{

Mashups[Enityname].AddTags() ;

}

and so on....

abjain_0-1624268379187.png

 

 

Support
July 12, 2021

Hi @RK_0705

 

Please let me know if you have found a solution with the help of one of the previous responses.  If so, please mark the appropriate one as the Accepted Solution for the benefit of others with the same issue.

 

If you are still searching for a solution, please let us know.

 

Regards.

 

--Sharon