Auto Create wt.document
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Auto Create wt.document
Hi all,
I want to use robot in workflow, which will generate wt.document of specific type. Kindly help me in doing so..
Solved! Go to Solution.
- Labels:
-
Other
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi Nilesh,
you can check with this code.
System.out.println("document Creation Activity");
if (primaryBusinessObject !=null) {
try {
wt.doc.WTDocument document=wt.doc.WTDocument.newWTDocument();
document.setName("testpart02");
document.setNumber("testpart02");
document.setContainer(((wt.change2.ChangeIssue)primaryBusinessObject). getContainer()); // which ever workflow you are working with you can give your item. here it is related with problem report.
wt.fc.PersistenceHelper.manager.save(document);
}
catch ( wt.util.WTException wex ) {
System.out.println( "Cannot create document "+((wt.change2.ChangeIssue)primaryBusinessObject).getDisplayIdentifier()+"because "+ wex.getLocalizedMessage( ));
}
}
else{
System.out.println( "Primary business object is NULL");
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi Nilesh,
you can check with this code.
System.out.println("document Creation Activity");
if (primaryBusinessObject !=null) {
try {
wt.doc.WTDocument document=wt.doc.WTDocument.newWTDocument();
document.setName("testpart02");
document.setNumber("testpart02");
document.setContainer(((wt.change2.ChangeIssue)primaryBusinessObject). getContainer()); // which ever workflow you are working with you can give your item. here it is related with problem report.
wt.fc.PersistenceHelper.manager.save(document);
}
catch ( wt.util.WTException wex ) {
System.out.println( "Cannot create document "+((wt.change2.ChangeIssue)primaryBusinessObject).getDisplayIdentifier()+"because "+ wex.getLocalizedMessage( ));
}
}
else{
System.out.println( "Primary business object is NULL");
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi Vijayan,
This worked for me... Thanks a ton for your great help. I was able to almost get it, but your help made it perfectly correct.
Regards,
Nilesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi Vijayan,
my problem is relatively similar to the one Nilesh has, except that my workflow is not assigned to a primary business object (pbo). That value is zero. I tried to modify the code, but it didn't work. Most of all, I was not able to modify the phrase "document.setContainer(((wt.change2.ChangeIssue)primaryBusinessObject).getContainer())". How can I do that?
Furthermore, I would like to create a document within a workflow and decline this document as pbo. The problem is, I don't quite know how to do that. Can you give me some advice on that?
Thank you for your help.
Best Regards,
Willi
