cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Translate the entire conversation x

Help with pulling attributes from a Soft-type into Workflow

MichaelWright
1-Visitor

Help with pulling attributes from a Soft-type into Workflow

To give you a little background on myself, I have no real programming knowledge, so messing with Java is completely new to me. I've done some C++ in the past, but that's not really helping me out here. We are using PDMLink 9.1 (if that matters as it is the only one I have used so I'm not entirely sure of the differences)

I have a Reference Document that I have set up and it has about 5 Attributes I am trying to pull information for so that we can route it through different conditionals. I am operating on my own a lot here, so I'm basically beating my head against a wall trying to fix this without the knowledge to fix it. I am working off of an example we have in our Change Activity Process, but I just keep getting Syntax Errors as I try to adapt it, which I figure I'm missing something big here to re-route the path to where I'm pulling the information from. The coding I'm working off of is:

wt.fc.QueryResult qr = null;
qr = wt.change2.ChangeHelper2.service.getChangeOrder((wt.change2.ChangeActivityIfc)primaryBusinessObject);
wt.change2.WTChangeOrder2 cn = (wt.change2.WTChangeOrder2)qr.nextElement();
qr = null;
qr = wt.change2.ChangeHelper2.service.getChangeRequest(cn);
wt.change2.WTChangeRequest2 cr = (wt.change2.WTChangeRequest2)qr.nextElement();
ext.generic.util.IBAUtil objHelper = new ext.generic.util.IBAUtil(cr);
isNewArtReqd=objHelper.getIBAValue("isNewArtReqd");
newColorantResinReqd=objHelper.getIBAValue("newColorantResinReqd");
changeProcessOrLabor=objHelper.getIBAValue("changeProcessOrLabor");
changeProductSpecs=objHelper.getIBAValue("changeProductSpecs");
createUpdatePackSpec=objHelper.getIBAValue("createUpdatePackSpec");
exclusivityChange=objHelper.getIBAValue("exclusivityChange");
changeRelevantDate=objHelper.getIBAValue("changeRelevantDate");
isPOP=objHelper.getIBAValue("isPOP");
outsourceExistMolds=objHelper.getIBAValue("outsourceExistMolds");

I'm attempting to pull from a Reference document that is named TestRequest, and I'm not entirely sure what I am supposed to change to make this happen. I think I understand the getIBAValue coding as it seems rather self explanatory, of course, let me know if I might be off-base on that as well. Any help or tutorials/help documents you guys can provide/point me toward would be greatly appreciated.

2 REPLIES 2

This is very standard method you can use to pass your subtype and IBA

public static String getIBAValue(IBAHolder ibaHolder, String name) {
String s = null;
try {
ibaHolder = IBAValueHelper.service.refreshAttributeContainer(ibaHolder, null, SessionHelper.manager.getLocale(), null);
DefaultAttributeContainer theContainer = (DefaultAttributeContainer) ibaHolder.getAttributeContainer();
if( theContainer != null ) {
AttributeDefDefaultView[] theAtts = theContainer.getAttributeDefinitions();
for( int i = 0; i < theAtts.length; i++ ) {
if(theAtts[i].getName().equals(name)) {
AbstractValueView[] theValues = theContainer.getAttributeValues(theAtts[i]);
if( theValues != null ) {
for(int j=0; j<theValues.length; j++) {
if(theValues[j] instanceof TimestampValueDefaultView){
s=((TimestampValueDefaultView)theValues[j]).getValue().toString();
}else{
if(s==null)
s = IBAValueUtility.getLocalizedIBAValueDisplayString(theValues[j], SessionHelper.manager.getLocale());
else
s += "," +IBAValueUtility.getLocalizedIBAValueDisplayString(theValues[j], SessionHelper.manager.getLocale());
}
}
}
}
}
}
} catch( Exception e ) {
e.printStackTrace();
}
return s;
}

Please let me know if you need more help.

I found the answer on a Java Forum. I had misdefined my variables and was receiving an error due to that.

Announcements
Top Tags