cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

Delete the contents of a Workspace in Windchill automatically

Zoltán
13-Aquamarine

Delete the contents of a Workspace in Windchill automatically

Hi,

 

In short:

I'm looking for a way to clear the contents of a Workspace and the cache automatically, without user intervention.

 

Long story:

We've got a server that's running a Creo 7.0.x.0 installation for conversion from prt/asm to stp.
We can't use a worker for this as we've got a third party software involved.


The Creo session is started using a batch-file, so adding an "rmdir \..\..\.cache2008" command is trivial for clearing the cache as we see fit, if we don't want to use the dm_cache_limit setting (which we don't).

 

However, the Workspace is still just adding more and more new items as it's downloading, and around some GB or 20k files, it's slowed down the task a lot. Manually logging onto the server is a way to do it, but not ideal.
So, this is done from the Windchill side apparently, and that would involve prorgamming something beyond DOS probably.

 

Anyone with an idea?

ACCEPTED SOLUTION

Accepted Solutions

Zoli, hi

 

Maybe you could describe the big picture?

For example how do you know it’s time to generate a stp file and run it through the third party tool?

 

Are you working off a list of numbers thus a bulk stp creation?

Are you doing this when the objects state is set to whatever?

 

Maybe you can supply details on your process?

 

That said, how do you know which WS to remove from?

I wrote a utility that will remove all objects from workspace given the WS. It works great but if you don't want any user interaction there needs to be some logic to determine which WS to remove the objects from. 

 

The utility can be triggered anyway that's required. Below I ran it in a Windchill shell.

d_graham_0-1628195870674.png

 

 

David

View solution in original post

6 REPLIES 6

@Zoltán 

 

You can probably automatically run the stp files through your third party tool after they are created by a publishing job.

If running third party tool includes arguments for input file and output file this should be doable.

 

I have done this a few times with different file type.  In all cases the code gets the published file (stp, pdf, hpgl, whatever) from the Windchill vault; runs it through the third party tool; replaces the original file in the Windchill vault with the output file from the third party tool. Or adds the output file as new content.

If the output files need to be moved/copied to a location outside of Windchill that too can be part of the automation.

In all cases the code is triggered to run automatically. No user input is required.

 

That doesn't answer the remove for WS question which is also doable but if the only reason you are not getting the stp files from a publishing job is due to the requirement to run them through the third party tool I would think that's the problem that needs to be addressed? True?

 

David

Zoltán
13-Aquamarine
(To:d_graham)

Hi David,

That is one way of getting around the problem, I'll discuss this with the team.
Thanks.

Zoli, hi

 

Maybe you could describe the big picture?

For example how do you know it’s time to generate a stp file and run it through the third party tool?

 

Are you working off a list of numbers thus a bulk stp creation?

Are you doing this when the objects state is set to whatever?

 

Maybe you can supply details on your process?

 

That said, how do you know which WS to remove from?

I wrote a utility that will remove all objects from workspace given the WS. It works great but if you don't want any user interaction there needs to be some logic to determine which WS to remove the objects from. 

 

The utility can be triggered anyway that's required. Below I ran it in a Windchill shell.

d_graham_0-1628195870674.png

 

 

David

Zoltán
13-Aquamarine
(To:d_graham)

Hi David,

 

First of all, I apologise for the lack of reaction or reply. I didn't have the priority to look further into this, running a delete manually.

 

To answer your questions in short:

  1. 3rd party tool uses Creo to download from Windchill to a set Workspace, open the .adm or .prt and convert to .stp via its own script (vbs).
  2. It's done in bulk for items in Released state.
  3. The WS is the same all the time, manually created, so that's making it easier as it's a constant.

Again, thank you for your time on even replying.

Was this script complex to set up/create? I'm not a programmer, thus the question.

 

Kind regards

/Z

Zoli,

 

The code was not complex, particularly if it's always the same WS.

An understanding of how things work in the dB and a little knowledge of Java is all you need.

 

The code can be run automatically by setting up Schedule Queue entry that automatically runs the code at regular intervals (once a week maybe) that would not conflict with the running of the 3rd party tool.

I use this technique for any maintenance that should be done on a regular basis such as removing unreferenced files or cleaning out publishing queue.

Or perhaps hook it to your script to run before the script does the download or after the job is done.

 

Hope this help,

 

David

 

Zoltán
13-Aquamarine
(To:d_graham)

Yes, we have a scheduled task, running a batch file, pointing to the vbs, so I'll ask out programmer to create this, and I'll add it to the .bat-file for each start of the task.

Announcements


Top Tags