mbonilla - Thursday, November 11, 2010 10:41 AM:
Hello everyone,
On my company I'm working on a project for ISO compliance. Most of the workflows we have done with ARAS standard workflows and everyone seems happy with the outcome. There is one outstanding item that I don't know how to handle from the workflow that I'm trying to do with scripting.
What I want to do is have a workflow to approve powerpoint files and after the final approvals are completed I want to copy those files from the Vault to a network directory where we keep the masters.
My question is any easy way to accompish this? If not any one knows of a code fragment that would be a good starting point? Any suggestions?
Thank you in advance.
Brian - Thursday, November 11, 2010 10:01 PM:
Hi,
I may be missing the point here but I would have thought that the Innovator Vault is a better place to keep the Masters than a network directory.
One of the aims of a product like Innovator is to help you to reduce redundancy. In this case you have controlled copies with full traceability held in the Vault and then another set of the same documents in arguably less secure environments with no history/traceabilty which you are treating as the Masters.
If you acknowledge that Innovator holds the Masters then your real question is to do with how you either expose those Master documents to users via Innovator through training etc or how you link to the originals held in the Vault.
Cheers,
Brian
mbonilla - Friday, November 12, 2010 9:59 AM:
Brian,
You are right Innovator is a good document repository and we use it as such for most documents. These particular documents that I'm trying to automate are work instructions for the manufacturing floor. We have a system that when someone is going to work on an assembly they scan the serial number on the traveler and the correct set of work instructions open in a display on their work statation. This system is expecting to find the work instructions files on a particulary locatin on the network. This network location is for the benefit of this software only -- humans never access these files directly.
Currently we have a workflow to review and approve these work instructions on ARAS and I want to automatically copy the correct files to the network location automatically upon approval therefore removing any chance that someone is going to forget to copy the files out.
Regards,
Milton
Brian - Friday, November 12, 2010 8:07 PM:
Hi Milton,
In that case try the following:
In this case I am just using a File object.
You would want to get the File Relationship from the controlled item being processed via the workflow.
The important trick is knowing how the vault is configured to store your files.
You need to do this in a Server Method to ensure that the system has access to the Vault Files.
See post after this one for properly posted code sample.
Brian - Friday, November 12, 2010 8:09 PM:
Sorry. Forgot how this forum mangles code.
// copy a file from the vault to a network directory
// once we have the file Item we know everything that we need
// to know to copy the file
// F742BB1DA5B64AD5A73726719DB45A29 test file ID
// vault configuration is:
// 1/2/29 so under the Vault directory the file above would be in:
// /F/74/2BB1DA5B64AD5A73726719DB45A29
System.Diagnostics.Debugger.Break();
Innovator inn = this.getInnovator();
string vaultDir = "c:/aras/vault/InnovatorSolutions920";
Item fle = this.newItem("File", "get");
fle.setID("F742BB1DA5B64AD5A73726719DB45A29");
fle = fle.apply();
if (fle.isError() )
{
return inn.newError("Error retrieving file: " + fle.getErrorDetail());
}
string fileName = fle.getProperty("filename");
string fileID = fle.getID();
string fullFileName = vaultDir + "/" + fileID.Substring(0,1) + "/" + fileID.Substring(1,2) + "/" + fileID.Substring(3,29) + "/" + fileName;
string destDir = "c:/aras/vault//" + fileName;
File.Copy(fullFileName, destDir, true);
return this;
Try this.
mbonilla - Tuesday, November 23, 2010 5:40 PM:
Brian,
Thank you for the example. I have been on vacation for the last 10 days but I will give it a try as soon as I get back.
Thank you.
Milton