Hi,
How can i use the ImportSourceControlledEntities service to import a single entity: I guess i need to use the entityFilter parameter, but i'm not able to find the correct syntax:
hi cbaurand
entityFilter is not necessary parameter. please refer to below sample code which I ran successfully on TW9.3.2 instance.
let params = {
entityFilter: undefined /* INFOTABLE {"dataShape":"EntityDifference"} */,
path: "/Things" /* STRING */,
useDefaultDataProvider: undefined /* BOOLEAN {"defaultValue":true} */,
withSubsystems: undefined /* BOOLEAN {"defaultValue":false} */,
overwritePropertyValues: undefined /* BOOLEAN {"defaultValue":true} */,
repositoryName: "RepThing" /* THINGNAME */
};
// no return
Resources["SourceControlFunctions"].ImportSourceControlledEntities(params);
My intention was to import a single entity. Your response is irrelevant.
I attached a picture where I ran ImportSourceControlledEntities from composer. I defined entityFilter to only import thing with name "test2".
For your use case, you can define InfoTable with data shaple "EntityDifference", add a row to with entityType as "Thing" and name as target thing name.
I am also not sure about the syntax of the entityFilter, specifically the entityType, but I found in our support portal a case that suggests this works, even if you see in the log that they are processed.
If I would need a workaround now, I personally would move the entity I need to a temp folder, then process that folder via this service (without using entityFilter), then delete the folder at the end of the process.
Note: of course, if the case I shared does not apply, you should open a Technical Support case to get this function documented in a Support Article.
Actually, this case was found by Charlotte (ptc) and me a few weeks ago. Ii works, but the traces suggest that the filter doesn't work.
Thanks for your reply.
yes, below article also mentions that. Info Application log is output for every entity even with filtering.
https://www.ptc.com/en/support/article/cs370821
are we good to close this?
yes