Skip to main content
1-Visitor
December 18, 2023
Solved

Whether it's possible to branch the workflow based on the content of cells in an attached Excel

  • December 18, 2023
  • 2 replies
  • 1127 views

I am using Windchill PDMLink Release 11.0 and Datecode with CPS N/A

In the scenario of customizing workflows in PTC PDMLink with Java coding, is it possible to make decisions in the workflow based on the contents of cells in an attached Excel sheet? Or, is it feasible to retrieve the contents of cells from an Excel sheet attached to the workflow?

Best answer by HelesicPetr

Hi @DH_10667582 

Yes it is possible.

You just need to write own class and code where you find the attached excel,

Open the excel read the cell and check what value is in the cell. 

 

You just need to know how to write the code, but it is possible.

there are some APIs to read a excel based on the type. XLSx or XLS

// XLSx
org.apache.poi.xssf.usermodel.XSSFWorkbook
//XLS
org.apache.poi.hssf.usermodel.HSSFWorkbook

PetrH

2 replies

16-Pearl
December 18, 2023

Hi there,

Good scenario. What I think is a possibility is to do a Excel Macro that extracts the Cell Value and populates it to a WTDocument Attribute. Then its a home run in Windchill using Expression Robots.

I am keen to hear other approaches here from experts, probably they might have come across this already.

 

Best Regards

Hari

HelesicPetr
22-Sapphire II
22-Sapphire II
December 18, 2023

Hi @DH_10667582 

Yes it is possible.

You just need to write own class and code where you find the attached excel,

Open the excel read the cell and check what value is in the cell. 

 

You just need to know how to write the code, but it is possible.

there are some APIs to read a excel based on the type. XLSx or XLS

// XLSx
org.apache.poi.xssf.usermodel.XSSFWorkbook
//XLS
org.apache.poi.hssf.usermodel.HSSFWorkbook

PetrH