AnsweredAssumed Answered

PI AF Element 'already exists'

Question asked by sylpiette on Dec 6, 2015
Latest reply on Dec 7, 2015 by Marcos Vainer Loeff

Good sunday afternoon everyone,

 

I'm developing a tool in Processbook to create new elements in the PI AF database, based on existing templates. My starting point is the AFWrapper Library written in C# to which I have added a function to create a new AF element.

 

When I call the function from Processbook (a button in my display that runs a macro in VBA that calls the function) the first time, it works fine: when I click on refresh in PI System Explorer, I can see the new element where I expected it. Still in System Explorer, I delete this newly created Element, then click on "Check In".

 

I click on refresh and my new element is not shown anymore.

 

However, if I go back to Processbook then click on the button again, I get in C# an exception: "'MyNewElement' already exists". I check again in System Explorer (refresh), but it is not. If I close Processbook completely, then open my display again (which reload the AFWrapper .dll) and click on the button, it works (no exception, new element is created).

 

Is it possible that the AFWrapper Library works with a cached version a the AF database? If so, how can I force it to refresh its cache?

 

Thanks in advance

Outcomes