Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
I am attempting to set the Lifecycle State of the Resulting (Document) Objects from within the Change Notice Workflow, the following code fails a Syntax Check (at LINE 1 below). Any ideas how to correct this and get this working ?
//Find Resulting Objects and set State to Under Review
wt.change2.ChangeOrder2 pbo = (wt.change2.ChangeOrder2) primaryBusinessObject;
wt.fc.QueryResult activities = wt.change2.ChangeHelper2.service.getChangeActivities(pbo);
while (activities.hasMoreElements()) {
wt.change2.ChangeActivity2 activity = (wt.change2.ChangeActivity2) activities.nextElement();
System.out.println("IDW 1 task " + activity.getDisplayIdentity().getLocalizedMessage(java.util.Locale.ENGLISH));
wt.fc.QueryResult resulting = wt.change2.ChangeHelper2.service.getChangeablesAfter(activity);
while (resulting.hasMoreElements()) {
// set State for each Document
wt.fc.Persistable persistable = (wt.fc.Persistable)resulting.nextElement();
if (persistable instanceof wt.doc.WTDocument){
wt.doc.WTDocument docAff = (wt.doc.WTDocument)persistable;
State state = toState("UNDERREVIEW"); //LINE 1
docAff.setLifeCycleState(state);
wt.doc.WTDocumentMaster dmaster = (wt.doc.WTDocumentMaster) docAff.getMaster();
String affName = dmaster.getName();
System.out.println("IDW 2 Affected Doc: " + affName);
}
}
}
