g. Use the default get and set methods automatically generated for each attribute to also print out attribute information.
i. As before, exceptions will be thrown and need to be handled.
j. Run the program, then use the OOTB search UI to verify the results.
Step 3. Create a custom Part.
a. Create a Java application with a Main method.
b. Add a method createPart(). Call this method from the Main method.
c. objects are stored in containers. Inside createPart(), first execute a search for the container named “GOLF_CART”.
d. From the results — stored in a QueryResult (variable “qr”) — get a reference to the container:
e. Initialize the custom Part and set the attributes. Below is an example of setting an EnumeratedType attribute where the name of the EnumeratedType attribute is “Material”, and the name of the role association is “matl”:
The number for the object will be the current date and time.
f. Set the folder and persist the object. Note that the assignLocation() method uses the reference to the GOLF_CART container found previously:
g. As before, exceptions will be thrown and need to be handled.
h. Run the program and use the UI to verify custom Parts are being created.
Summary
After completing this module, you should be able to:
• Perform tasks in the Engineer Component element of the Application Solution Development module of the System RVP work stream.
• Implement a custom link.
• Implement a listener service.
i. As before, exceptions will be thrown and need to be handled.
j. Run the program, then use the OOTB search UI to verify the results.
Step 3. Create a custom Part.
a. Create a Java application with a Main method.
b. Add a method createPart(). Call this method from the Main method.
c. objects are stored in containers. Inside createPart(), first execute a search for the container named “GOLF_CART”.
d. From the results — stored in a QueryResult (variable “qr”) — get a reference to the container:
e. Initialize the custom Part and set the attributes. Below is an example of setting an EnumeratedType attribute where the name of the EnumeratedType attribute is “Material”, and the name of the role association is “matl”:
The number for the object will be the current date and time.
f. Set the folder and persist the object. Note that the assignLocation() method uses the reference to the GOLF_CART container found previously:
g. As before, exceptions will be thrown and need to be handled.
h. Run the program and use the UI to verify custom Parts are being created.
Summary
After completing this module, you should be able to:
• Perform tasks in the Engineer Component element of the Application Solution Development module of the System RVP work stream.
• Implement a custom link.
• Implement a listener service.
本文介绍了一个具体的步骤来创建自定义零件,包括使用默认的获取和设置方法生成每个属性信息,并处理异常。此外还介绍了如何通过Java应用程序实现搜索容器、初始化自定义零件及设置属性等操作。
1326

被折叠的 条评论
为什么被折叠?



