Skip to main content
5-Regular Member
May 14, 2026
Solved

Workflow expression to check if asm files are included in a Change Notice

  • May 14, 2026
  • 1 reply
  • 49 views

Hello,

anyone could help determining how the workflow expression should be composed to get a conditional when a CN includes asm files in the affected objects.

Thank you.

Best answer by d_graham

You’re very close. You need to change “ASSEMBLY” to “CADASSEMBLY”.

 

wt.fc.QueryResult affectedObjects = wt.change2.ChangeHelper2.service.getChangeablesBefore((wt.change2.WTChangeOrder2)primaryBusinessObject);
while(affectedObjects.hasMoreElements()) {
     wt.change2.Changeable2 chgable = (wt.change2.Changeable2)affectedObjects.nextElement();
     if(chgable instanceof wt.epm.EPMDocument && ((wt.epm.EPMDocument)chgable).getDocType().toString().equals("CADASSEMBLY")) {
        hasAssembly = true;
    }
}

1 reply

12-Amethyst
May 14, 2026

This case shows a nice visual of the links between change objects, and how you would get the “changeables” that are in the change.
https://www.ptc.com/en/support/article/CS63595
 

Look at the java doc for the ChangeHelper2 service. This will contain all the functions you would need to get the changeables, specifically if you’re looking for affected objects, getChangeablesBefore.


If you’re asking what the workflow would look like, it would be something like this….

 

5-Regular Member
May 14, 2026

Thanks a lot for the reply :)
I was already half way there, having identified the wt.change2.ChangeHelper2.service.getChangeablesBefore and how to setup the required conditional properties.
What i can’t figure out is the java syntax that i can use to check the affected objects returned by the getChangeablesBefore and look for assembly files that might be included.

The following attempt,  returns “No EnumeratedType exists with "ASSEMBLY" as its internal value”. I am no Java expert, so this is a bit difficult for me to figure out how it works.

wt.fc.QueryResult affectedObjects = wt.change2.ChangeHelper2.service.getChangeablesBefore((wt.change2.ChangeOrderIfc)primaryBusinessObject);
wt.epm.EPMDocument epmDoc = null;
wt.epm.EPMDocumentType assemblyType = wt.epm.EPMDocumentType.toEPMDocumentType("ASSEMBLY");
while(affectedObjects.hasMoreElements())
{
wt.fc.WTObject object = (wt.fc.WTObject)affectedObjects.nextElement();
if(object instanceof wt.epm.EPMDocument)
{
epmDoc = (wt.epm.EPMDocument)object;
if(assemblyType.equals(epmDoc.getDocType()))
{
hasAssembly = true;
}

}
}

 

d_graham18-OpalAnswer
18-Opal
May 15, 2026

You’re very close. You need to change “ASSEMBLY” to “CADASSEMBLY”.

 

wt.fc.QueryResult affectedObjects = wt.change2.ChangeHelper2.service.getChangeablesBefore((wt.change2.WTChangeOrder2)primaryBusinessObject);
while(affectedObjects.hasMoreElements()) {
     wt.change2.Changeable2 chgable = (wt.change2.Changeable2)affectedObjects.nextElement();
     if(chgable instanceof wt.epm.EPMDocument && ((wt.epm.EPMDocument)chgable).getDocType().toString().equals("CADASSEMBLY")) {
        hasAssembly = true;
    }
}