guru@windchillguru.com's Profile

2670
Points

Questions
15

Answers
26

  • Asked on May 16, 2015 in Windchill PDMLink.

    SELECT DISTINCT APPLICATIONDATA.FILENAME, FVMOUNT.PATH, LPAD(TRIM (TO_CHAR (FVITEM.UNIQUESEQUENCENUMBER, 'xxxxxxxxxxxxxx')), 14, '0') AS ENCRYPTEDFILENAME<br /> FROM FVITEM, APPLICATIONDATA, FVMOUNT<br /> WHERE FVITEM.IDA3A4 = FVMOUNT.IDA3A5 AND (FVITEM.IDA2A2, APPLICATIONDATA.FILENAME) IN (<br /> SELECT IDA3A5,FILENAME FROM (<br /> SELECT APPLICATIONDATA.IDA3A5,<br /> APPLICATIONDATA.FILENAME<br /> FROM APPLICATIONDATA<br /> WHERE (<br /> APPLICATIONDATA.ROLE = 'PRIMARY'<br /> AND APPLICATIONDATA.IDA2A2 IN ( <br /> SELECT DISTINCT HOLDERTOCONTENT.IDA3B5 FROM HOLDERTOCONTENT, WTDOCUMENT<br /> WHERE HOLDERTOCONTENT.IDA3A5 IN (<br /> SELECT IDA2A2 FROM (<br /> SELECT WTDOCUMENT.IDA2A2 FROM WTDOCUMENT, WTDOCUMENTMASTER<br /> WHERE ( <br /> WTDOCUMENT.IDA3MASTERREFERENCE = WTDOCUMENTMASTER.IDA2A2<br /> AND WTDOCUMENTMASTER.WTDOCUMENTNUMBER = '0000000062'<br /> AND WTDOCUMENT.LATESTITERATIONINFO = '1'<br /> AND WTDOCUMENT.STATECHECKOUTINFO IN ('c/i', 'wrk') )<br /> ORDER BY WTDOCUMENT.CREATESTAMPA2 DESC<br /> )<br /> WHERE ROWNUM = 1<br /> )<br /> ) <br /> )<br /> ORDER BY APPLICATIONDATA.CREATESTAMPA2 DESC<br /> )<br /> WHERE ROWNUM = 1<br /> )

    • 3094 views
    • 1 answers
    • 0 votes
  • Asked on May 16, 2015 in Windchill PDMLink.
    <pre>        QueryResult queryResultWTPartUsage = StructHelper.service.navigateUses(parentPart, false);
            while(queryResultWTPartUsage.hasMoreElements()){
                WTPartUsageLink wtpartusagelink = (WTPartUsageLink) queryResultWTPartUsage.nextElement();
        .........
    </pre>
    
    • 3914 views
    • 1 answers
    • 0 votes
  • Asked on May 15, 2015 in Windchill PDMLink.
    public static ArrayList<WTPrincipalReference> getParticipantsForRole(String role, wt.inf.team.ContainerTeam containerTeam) {
    ArrayList<WTPrincipalReference> principalObj = new ArrayList<WTPrincipalReference>();
    try {
    Role rolePM = wt.project.Role.toRole(role);
    ArrayList principalRef = containerTeam.getAllPrincipalsForTarget(rolePM);
    if (!principalRef.isEmpty()) {
    Iterator roleArrIterator = principalRef.iterator();
    while (roleArrIterator.hasNext()) {
    wt.org.WTPrincipalReference wtPrincipalRef = (wt.org.WTPrincipalReference) roleArrIterator.next();
    principalObj.add(wtPrincipalRef);
    }
    }
    } catch (Exception ex) {
    log.debug("Error while executing the getParticipantForRole() : " + ex.toString());
    }
    return principalObj;
    }
    

     

    This answer accepted by Alex. on May 15, 2015 Earned 15 points.

    • 4216 views
    • 1 answers
    • 0 votes
  • Asked on May 15, 2015 in Windchill PDMLink.
    public static void getRelatedProcesses(Persistable persistable) throws Exception {
    QueryResult queryresult = WfEngineHelper.service.getAssociatedProcesses(persistable, null, ((WTContained) persistable).getContainerReference());
    while(queryresult.hasMoreElements()){
    WfProcess wfprocess = (WfProcess)queryresult.nextElement(); //
    }
    }
    
    • 4446 views
    • 1 answers
    • 0 votes
  • Asked on May 15, 2015 in Windchill PDMLink.

    <br />public static URL getPrimaryContentURL(FormatContentHolder formatcontentholder) throws Exception {<br /> formatcontentholder = (FormatContentHolder)ContentHelper.service.getContents(formatcontentholder);<br /> ContentItem contentitem = ContentHelper.getPrimary(formatcontentholder);<br /> URL url = ContentHelper.getDownloadURL(formatcontentholder, (ApplicationData)contentitem, false);<br /> return url;<br />}<br />

    This answer accepted by Alex. on May 15, 2015 Earned 15 points.

    • 4215 views
    • 1 answers
    • 0 votes
  • Asked on May 15, 2015 in Windchill PDMLink.
    <pre>public static HashMap getIBAValueMap(IBAHolder ibaHolder) throws Exception { 
            HashMap ibaValueMap = new HashMap();
            ibaHolder = IBAValueHelper.service.refreshAttributeContainer(ibaHolder, null, WTContext.getContext().getLocale(), null);
            //Logger logger = LogR.getLogger(Util.class.getName());
    
    <a href="http://logger.info/">logger.info</a>("Testing message");
    
    DefaultAttributeContainer defaultattributecontainer = (DefaultAttributeContainer) ibaHolder.getAttributeContainer();        
            if (defaultattributecontainer != null){
                AbstractValueView aabstractvalueview[] = defaultattributecontainer.getAttributeValues();
                for (int i = 0; i &lt; aabstractvalueview.length; i++) {
                    String name = aabstractvalueview[i].getDefinition().getName();
                    String value = null;
                    if(aabstractvalueview[i] instanceof URLValueDefaultView) {
                       URLValueDefaultView urlv = (URLValueDefaultView) aabstractvalueview[i];
                       value = "<a href="http://www.ezcollab.com/%22%22">" + urlv.getDescription() + "</a>";
                    }
                    else {
                        value = IBAValueUtility.getLocalizedIBAValueDisplayString(aabstractvalueview[i], WTContext.getContext().getLocale());
                    }
    
    Object eValue = (Object) ibaValueMap.get(name);
                    if(eValue == null){
                        ibaValueMap.put(name, value);
                    } else {
                        ArrayList al = new ArrayList();
                        if(eValue instanceof ArrayList){
                            al = (ArrayList)eValue;
                            al.add(value);
                        } else {
                            al.add(eValue);
                            al.add(value);
                        }     
                        ibaValueMap.put(name, al);
                    }
                }           
            }
            return ibaValueMap;
        }</pre>
    

    This answer accepted by Alex. on May 15, 2015 Earned 15 points.

    • 3057 views
    • 1 answers
    • 0 votes