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

How do I link two Document subtypes?

VladiSlav
17-Peridot

How do I link two Document subtypes?

Hi, everybody!
I have created a subtype of the Document using the following code:

package com.acme;

import wt.doc.WTDocument;
import wt.util.WTException;
import com.ptc.windchill.annotations.metadata.*;

@GenAsPersistable(superClass=WTDocument.class,
   properties={
   @GeneratedProperty(name="sizeC", 
      type=Integer.class, initialValue="3",
      javaDoc="Integer value to represent the size of C.")},
 
  iconProperties=@IconProperties(standardIcon="netmarkets/images/stop.gif", 
    openIcon="netmarkets/images/stop.gif")
)
public class AcmeModeledDoc extends _AcmeModeledDoc {

   static final long serialVersionUID = 1;

   public static AcmeModeledDoc newAcmeModeledDoc()
            throws WTException {
      AcmeModeledDoc instance = new AcmeModeledDoc();
      instance.initialize();
      return instance;
   }
}

Everything works , I can create a document, specify the sizeС.

I tried creating a second subtype with link it to the previous one:

package com.acme;

import wt.doc.WTDocument;
import wt.util.WTException;
import com.ptc.windchill.annotations.metadata.*;

@GenAsPersistable(superClass=WTDocument.class,
properties={
@GeneratedProperty(name="sizeTwo", 
   type=Integer.class, initialValue="3",
   javaDoc="Integer value to represent the size of C."),
// link 
@GeneratedProperty(name="sizeC", type=AcmeModeledDoc.class)},

iconProperties=@IconProperties(standardIcon="netmarkets/images/start.gif", 
 openIcon="netmarkets/images/start.gif")

)

public class AcmeModeledDocTwo extends _AcmeModeledDocTwo {

	   static final long serialVersionUID = 1;

	   public static AcmeModeledDocTwo newAcmeModeledDocTwo()
	            throws WTException {
		   AcmeModeledDocTwo instance = new AcmeModeledDocTwo();
	      instance.initialize();
	      return instance;
	   }
	}

 

But now I can 't create a document


Can you tell me how to set up a connection?

0 REPLIES 0
Announcements

Top Tags