Edit: I've recently read that EPDM 2014 has "automatic caching options" which address this issue.
This is a tough one. I wish I could force the local cache to clear on a regular basis for quite a few of my users, some of them never do it.
I have PCs down in the shop and I've told them to only open files using a data card button that runs a little API program (VB.Net.) Part of the program runs a get latest operation on the whole folder that they're viewing. This has basically eliminated the issue for me.
Here's the get latest code:
Private Sub GetLatestFiles(ByVal vault As IEdmVault12, ByVal objfile As IEdmFile8, _
ByVal folder As IEdmFolder7)
Dim bg As IEdmBatchGet = vault.CreateUtility(EdmUtility.EdmUtil_BatchGet)
Dim sellist As New List(Of EdmSelItem)
Dim esi As New EdmSelItem
esi.mlProjID = folder.ID
esi.mlDocID = 0 ' Don't specify a document and it'll just run on the entire folder
Dim getOpCallback As EdmGetOpCallback
getOpCallback = New EdmGetOpCallback()
Also, your question made me take another look at the EPDM Programmer's Reference Guide, there's a function to clear the whole cache already spelled out:
Private Sub Test()
Dim poVault As IEdmVault8
Dim poClear As IEdmClearLocalCache
poClear = poVault.CreateUtility(EdmUtility.EdmUtil_ClearLocalCache)
You could probably come up with a clever way to trigger this. Have you ever used the API?
How would I apply the code above?
I'm in the same boat as Mike. How would I apply the code?
Specifically, it'll depend on your workflow. There are lots of ways to do it.
In my case we're using virtual documents as "work orders." The work orders have their own data card with information regarding the manufacturing schedule, etc. They're linked as references to the models and drawings for the part to be made. So, instead of allowing the users to browse through the vault, they use a custom search that only shows their work orders. To open the drawings they use a button on the work order data card. The button triggers a vb.net add-in and, based on the reference tree, it locates the part or drawing file and runs the "get latest" code before opening it.
So I would ask you:
Have you ever written or installed an add-in?
Obviously you want the code to be automatic so what are your users doing that you could "hook" onto?
Do they check files in and out? Or are they just viewing them?
What level of understanding are the users currently at?
How would you like it to work?
Basically, I need an idea of what your process is and how you imagine the code could be implemented. Then I can make a suggestion for application.
I have never written an add-in, I've delt with some codeing before though. I would like it to maybe "hook-in" everytime they open a specific folder.
They only veiw the files. The users don't understand much, they only know how to get in and open a file. I dont even think they know how to check one out!
I hope this better explains my situation.
I'll think about it over the next couple days and try to come up with a good answer.
I made a VBS script with the clear cache code, and I have it triggered via Windows task scheduler every moring for some of my users. Been working great for almost 3 years now!
Nice, that's probably exactly what these guys need. Care to elaborate any more?
First create the vbs script, basically a text file and change the ".txt" to ".VBS"
Set vault = CreateObject("ConisioLib.EdmVault")
Call vault.LoginAuto("NAME OF YOUR VAULT", 0)
If vault.IsLoggedIn Then
Set folder = vault.GetFolderFromPath("C:\NAME OF YOUR VAULT") 'CHANGE TO ANY FOLDER
Set clearCache = vault.CreateUtility(19) '19 BEING ENUM FOR EdmUtil_ClearLocalCache
Call clearCache.AddFolder(folder.ID, true) ' TRUE FOR RECURSIVE
Save the VBS somewhere, I save them on the desktop so users can aslo DBL click to run at their choice.
Then go to Start>All Programs>Accessories>System Tools>Task Scheduler
Create task> Create a name
General: I use Run only when user is logged on
Triggers: Daily at 7 am every day
Actions: Start program "file path to the VBS script"
You can also export the task to share it more easily.
That's an elegant solution and I love it. You should have seen the complex domino triggers that were spinning out of my head.
Andrew and Mike, If you're not familiar with vbs scripts your IT guy should know exactly how to do this.
Just a guess, but when I was using EPDM if you would go to file, and open the file
from the bottom of the file menu "recent" it would open what was in cache,
does this happen when you do a file, open, then browse to your file?
I am suspicious about needing to go to all the trouble with an add-in before thoroughly examining your release strategy, "show working versions" folder permission, and "read file contents" state permissions.
These are designed to couple together and control specifically what you are trying to accomplish. But also remember the user has to be trained so they have accountability in this system as well. They have to do work, which means they have to make sure to get the version they need. Self-servicing.
If this is not enough control, I recommend upgrading to 2014 which has configurable cache management so your user's cache can be emptied upon logout and refreshed upon login.
Hope this helps,
The first half of this comment is me thanking Tim for helping me (a newbie to posting forum answers) realize that I have a responsibility to be as objective and untainted as possible when offering advice. I could have left it out but I thought others may benefit from my revelation. Scroll down to the Important: heading if you'd rather skip the insights.
First of all, I don't know how many times I've used your ideas and advice from posts on this forum to overcome challenges.
Thanks for that!
I like your perspective and you are right. Educating the users on vault functionality:
- What caching is and why it's important to clear the local cache at intervals.
- How to get the latest version using the RMB context menu before viewing the file, etc.
... That's the absolute correct answer and certainly the first place to start. In fact I would urge Andrew to make a short training video or detailed document with screen shots to convey the points and significance. Never hurts to document training.
When I wrote my response I made the mistake of using my personal situation and solution (with "baggage") right off the bat. Your input made me realize it and I'm a bit embarrassed. I've been reading posts for a long time and just started posting within the past few days. I will try to be more objective, correct and clean in the future. And only bust out the code fixes if it's specifically requested or as a last resort. I certainly wouldn't want to make someone worse off due to complications.
My experience has led me to jump straight to tinkering and forcing the program to do what I want automatically rather than trying to train. The events that have transpired to taint me involve a wide range of users at varying skill levels. Some of them barely know the functions of windows explorer. I don't need to get too detailed but training has been very hit and miss and even some of my best and brightest colleagues (and myself) have made big mistakes as a result of local version issues.
We've done the whole shebang with "always work with latest versions" explorer setting, "show working versions" folder permission and "read file contents" state permissions. And ultimately I decided to write code to eliminate all the possible mistakes. However, I think a thorough understanding of these three switches would help everyone a lot but I haven't been satisfied with the explanations in the help guide.
Correct me if I'm wrong on any of these, I don't believe my understanding to be complete:
Let's start with "always work with latest versions" - This function does what it says. I believe the confusion comes with the definition of "latest version." In the image below, it's my understanding that the "versions" are A and B, and the numbered versions/revisions are the "working versions." If I'm right then the "latest version" would be B. However, let's imagine that B doesn't exist.
If B doesn't exist then the "latest version" is A (A, A-25, A-26, A-27) so if you have A-25 cached on your machine the vault concludes that you have the "latest version" and doesn't "get latest" even though A-27 is the file you really want.
So, if I wanted to make sure that everyone in the shop only saw the real latest versions of files, I would create a "Released" state with "read file contents" turned on and "show working versions" turned off. I would also make sure that when a file is moved to the "Released" state, the version/revision is set/incremented. Then I would disallow any changes to be made to the file. An engineer would have to change the state to "Under Change," while making the changes. The shop users would then lose the ability to see the file until the engineer moved the file back into the "Released" state which would increment the revision and cause the vault to "get latest" next time the shop user tries to open the file.
I believe this theory is right (however, it might not be and if it's not I hope you can tell me.)
- Engineers must be able to see the working versions. So how would you fix the issue for them? Trigger a revision increment every time a file is checked out?
- Some files only have "working versions." For example "Uncontrolled" state documents like .pdfs, images and also my virtual document work orders. So if I don't allow the shop to see "working versions" they lose access to A LOT of files. I could fix this but I believe the existing files wouldn't get updated automatically, it would only apply to files added after I made the workflow changes... (I might be wrong about that too)
The version dropdown for an "Uncontrolled" .pdf, I believe this file would be invisible if I turned "show working versions" off:
Sorry I ended up writing a Novel but I'm glad we're discussing this because I inherted all the current workflow settings from the person before me and hadn't thought to really examine the logic. The more I think about it, the more I think I need to do some remodeling.
This can be one of the more vexing issues with EPDM. People are used to looking in Windows Explorer to see the version of the file that exists, not the version they have cached on their machine. It definitely takes alot of education to get this point across.
Our "view" users have always work with latest versions set. They also have permission to read file contents once a file is initially "released" (the revision is incremented), even if it moves to an edit state later. The reason for this is that we don't want files "disappearing" from their vault view. They don't see working versions because we don't want them to see work in process. Yes, this means that we increment the version on "read-only" documents like PDFs using an automatic transition.
I have everyone out of engineering only get the lastest version only. At night when their computers shutdown they automatically clear their cache.