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

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

Conditional Statement Help

jlittle
6-Contributor

Conditional Statement Help

Would someone please take a look at the following code and validate it for me. It seems simple enough, but I keep getting errors when my WF hits this conditional:

//retrieve document type of the PBO
wt.doc.DocumentType docType = (((wt.doc.WTDocument)primaryBusinessObject).getDocType());

if (docType==wt.doc.DocumentType.toDocumentType("$$Technical Publication") )
result="SRP";
else
result="SRP";

I am trying to make a decision based on the WTDocument SubType and route accordingly.

Thanks,

James Little

Corning Cable Systems

CAD Administrator

5 REPLIES 5
rwelch
6-Contributor
(To:jlittle)

It should be:

if (docType.equals(wt.doc.DocumentType.toDocumentType("$$Technical Publication")) )



For both conditions , the result routes to "SRP" .Please correct that also

Ramesh Kumar
Tata Consultancy Services
jlittle
6-Contributor
(To:jlittle)


I realize both conditions point to the same route. At this point, I am just trying to resolve determining the document type associated with the PBO. Making the changes suggested by Mr. Welch did not correct the problem.

Is my first statement correct for determining the document type?

wt.doc.DocumentType docType = (((wt.doc.WTDocument)primaryBusinessObject).getDocType());

Thanks,

James

Rameshkumar Raja <rameshkumar.raja@tcs.com>


Rameshkumar Raja <rameshkumar.raja@tcs.com>
08/12/2009 01:17 AM
To
"Welch, Ronald P (US SSA)" <->
cc
James Little <james.little@corning.com>, "-" <->
Subject
jlittle
6-Contributor
(To:jlittle)


I realize both conditions point to the same route. At this point, I am just trying to resolve determining the document type associated with the PBO. Making the changes suggested by Mr. Welch did not correct the problem.

Is my first statement correct for determining the document type?

wt.doc.DocumentType docType = (((wt.doc.WTDocument)primaryBusinessObject).getDocType());

Thanks,

James

Rameshkumar Raja <rameshkumar.raja@tcs.com>


Rameshkumar Raja <rameshkumar.raja@tcs.com>
08/12/2009 01:17 AM
To
"Welch, Ronald P (US SSA)" <->
cc
James Little <james.little@corning.com>, "-" <->
Subject
ddemay
1-Newbie
(To:jlittle)



You can use this on any Typed object:



String docSoftType = wt.type.TypedUtilityServiceHelper.service.getExternalTypeIdentifier(primaryBusinessObject);





if ("mysofttypename".equals(docSoftType))

{

result = "dothis";

}

else

{

result="dothat";

}





HTH,

David DeMay



Top Tags