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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

How to create an Object soft-type via API (Static Factory Method)

kpritchard
12-Amethyst

How to create an Object soft-type via API (Static Factory Method)

Hi All,


I have some code that creates an Change Requestvia static factory method in a Workflow Expression Robot. I am trying to adapt to create a soft-type of Change Request. I thought that disbaling OIR's for the parent type (or setting the instantiable checkbox in the type and attribute manager would do the trick, butno luck. Any ideas?

2 REPLIES 2

You have to set the type identifier via API before persisting it. Easier to
just look at LWCNormalizedObject then doing with code from the older days
unless you are still on 9.1. I can share if you need.

On Wed, Dec 24, 2014 at 1:03 PM, Keir Pritchard <->
wrote:

> Hi All,
>
> I have some code that creates an Change Request via static factory method
> in a Workflow Expression Robot. I am trying to adapt to create a soft-type
> of Change Request. I thought that disbaling OIR's for the parent type (or
> setting the instantiable checkbox in the type and attribute manager would
> do the trick, but no luck. Any ideas?
>

Hi, you can use the "unsupported" method I used to create a subtype of WTChangeActivity2 (see attached snipped code)


See statement


((Typed)ca).setTypeDefinitionReference(TypedUtilityServiceHelper.service.getTypeDefinitionReference(targetType));


where targetType is defined as String.


I am sure it should work for ChangeRequest.


Regards,


Vittorio

Announcements


Top Tags