Virtual File System for Input/Output Capability in Windchill
Windchill+ supports customization with input/output capabilities through a cloud-backed Virtual File System (VFS). The VFS is a PTC managed virtual storage that allows external applications to read, write, and delete files. When files are available in VFS, the customization code utilizes the supported APIs to read, write, and delete files, and manage corresponding objects in Windchill.
Refer to the Windchill JavaDoc at
Reference Documents | PTC for the class
com.ptc.windchill.vfs.FileSystemUtils to understand the usage of supported APIs.
Use Case
Consider an external system that generates and stores multiple files (XML, JSON, etc.) on a file store. Using the PTC managed VFS and Windchill+ customization code, you can achieve the following:
• Upload the files from the files store to the VFS. PTC provides the SAS URL for this VFS after Windchill+ deployment.
• Invoke customization code to identify and read files available in VFS and create corresponding objects in Windchill. This customization code utilizes the Windchill supported APIs and is submitted through CCD.
|
All file formats are supported such as text, zip, archive, and binary. PTC strongly recommends to not use executables.
|
Sample Customization
This sample customization demonstrates how VFS APIs enable input/output capabilities. You can run this sample customization on an on-premises Windchill development environment to ensure that customization submitted through CCD will work on a Windchill+ environment.
On your on-premises Windchill development environment, run the following command:
xconfmanager -s "vfs.container.level.sas.url=<SAS URL>" -t codebase/wt.properties -p
PTC will provide a temporary SAS URL to execute and verify the customization.
| This configuration is provided out-of-the-box (OOTB) in a Windchill+ deployment. |
Prerequisites to run the sample customization:
• Run the following command (for Linux) to copy the IntegrationsExample sample to /opt/ptc.
cp -rp $WT_HOME/prog_examples/IntegrationsExample/customization /opt/ptc
• Change the working directory to $WT_HOME/bin/customizationTools.
cd $WT_HOME/bin/customizationTools
• Use ant to compile, deploy, and load data.
ant compile deploy load.data
| For detailed information on the prerequisites, refer to the readme.md located in the $WT_HOME/prog_examples/IntegrationsExample folder. |
Follow the steps below to run the sample customization:
1. Log in as a site administrator.
2. Navigate to > > .
3. Initiate the workflow ACME FileSystemUtils Sample.
After the workflow completes successfully,
• A folder named Parent-Folder-<timestamp> is created in VFS and the sample files are added to this folder.
• A document is created in the ACME product for each sample file in VFS. You can view these documents by logging in as acmeorgadmin.
• In case of .txt files in VFS, the files are updated with sample text and the file name is appended with _updated.txt in the file name.
• A zip file named WTDocs.zip is created in the same folder using the primary content of Windchill document.
• Using the container-level SAS URL for the VFS, verify that all files excluding _updated.txt and WTDocs.zip are deleted from VFS.
In the Windchill+ development environment, you can author customization code and submit it using a CCD package, based on successful implementations from the on-premises environment.
| You can utilize java.util.zip.ZipOutputStream and ZipInputStream with VFS to manage zip contents within blobs. However, the current implementation supports up to 50,000 zip entries per ZipOutputStream. |