Skip to main content
10-Marble
April 18, 2013
Solved

Auto Create wt.document

  • April 18, 2013
  • 1 reply
  • 2470 views

Hi all,

I want to use robot in workflow, which will generate wt.document of specific type. Kindly help me in doing so..

Best answer by vmg

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");

}

1 reply

vmg1-VisitorAnswer
1-Visitor
April 19, 2013

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");

}

10-Marble
April 19, 2013

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