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

Default topics in Discussion forums for change objects

Highlighted
Participant

Default topics in Discussion forums for change objects

We have a need to have a second topic to be automatically created in
change objects (Problem Reports, Change Requests, and Change Notices).

I can't find any references in the documentation to setting this up. PTC
tech support says it isn't a configuration item and the call is being
handed off to customization help.

Any ideas?

Thanks,
Wes
2 REPLIES 2
Highlighted

Default topics in Discussion forums for change objects

Wes,
You can use the following expression to create new topics.

wt.workflow.forum.DiscussionForum forum = NmPostingCommands.getForumFromOid(primaryBusinessObject);

//Change Admin Notes
wt.workflow.forum.DiscussionTopic topic = NmPostingCommands.service.getTopic(forum,"Change Admin Notes");
if (topic == null)
{
topic = wt.workflow.forum.DiscussionTopic.newDiscussionTopic("Change Admin Notes", forum);
topic = ForumHelper.service.saveTopic((wt.workflow.forum.DiscussionTopic)topic);
}

//Clarification Comments
wt.workflow.forum.DiscussionTopic topic2 = NmPostingCommands.service.getTopic(forum,"Clarification Comments");
if (topic2 == null)
{
topic2 = wt.workflow.forum.DiscussionTopic.newDiscussionTopic("Clarification Comments", forum);
topic2 = ForumHelper.service.saveTopic((wt.workflow.forum.DiscussionTopic)topic2);
}


Thank you,
Dax Williams
Windchill Business Administrator
Lifetime Products
Highlighted

Default topics in Discussion forums for change objects

Thanks Dax! (..and others who replied with suggestions.)
I had to fully qualify the NmPostingcommands and ForumHelper, but was
able to add an expression robot at the start of the Change Notice
workflow that created the extra Discussion Forum Topic we needed:

//1) grab the forum
wt.workflow.forum.DiscussionForum forum =
com.ptc.netmarkets.forumPosting.NmPostingCommands.getForumFromOid(primar
yBusinessObject);

//2) make sure there isn't a "StatusUpdate topic already
wt.workflow.forum.DiscussionTopic topic =
com.ptc.netmarkets.forumPosting.NmPostingCommands.service.getTopic(forum
,"StatusUpdate");
if (topic == null)
{
//3) create the new topic
topic =
wt.workflow.forum.DiscussionTopic.newDiscussionTopic("StatusUpdate",
forum);
topic =
wt.workflow.forum.ForumHelper.service.saveTopic((wt.workflow.forum.Discu
ssionTopic)topic);
}



Announcements