Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X
Is there a way to set up an OIR for a wtDocument where it automatically assigns URL content? If so is it possible to use the new autogenerated document number as a parameter in the URL?
In theory yes, Your main problem is that the URL content can only be stored after the WTDocument is persisted.
Worflow (Recommended)
I would really recommend against this, I would use a cusom workflow that triggers an event just after the 'Start' flag. This method could easily take the WTDocuemnts number and generate a URL, the workflow could then call a method which takes the URL and persists it as secondary content.
OIR (A more interesting approach)
However if you still like the idea of using the OIR the rough guide would be:
Add a 'dummy-attribute' none persisted (NPA) iba/sda attribute to the WTDocument.
Change the WTDocument OIR file and add:
<AttrValue id="dummy-attribute" algorithm="com.ptc.arbortext.windchill.algorithm.CreateUrlContent">
<Attr id="number"/> <!-- maybe the oid as well -->
</AttrValue>
Add a general listener which listens on POST_STORE of the WTDocument.
In the listener retrigger the oir for the 'dummy-attribute'. When retriggered it should rerun the CreateUrlContent and create secondary content now the WTDocument is persisted.
Retrigger the oir in the listener by:
Object value = InitRuleHelper.evaluator.getValue('dummy-attribute', document, containerRef)
In the CreateUrlContent algorithm using the number (or oid if you can get it) test if the WTDocument is persisted. If it is the generate the secondary content
Hope this helps,
-Ste