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

Workflow notification to Object creator

khimani_mohiki
14-Alexandrite

Workflow notification to Object creator

Hi, Im trying to make a very simple workflow to manage a sort of data submission queue for 3D printing. I need to send an email to the creator of the Document when the queue manager changes the state of the document to "complete", I have the email trigger set up to send to "creator" but that only send to the person changing the state, I cant see an obvious way to send it to the priarybusinessobject "created by" user, how can I get this info and hook it into the workflow notification?

2 REPLIES 2
Florent
14-Alexandrite
(To:khimani_mohiki)

Hello,

why don't you insert a notification task in the workflow itself.

In the recipient, you can put a variable that has previously been set to the document creator using

either wtDoc.getCreator() or wtDoc.getCreatorEMail().

 

Florent

Florent ROUSSEL
www.4cad.ca

I ended up writing some code like this in a workflow expression:

 

//Find the document creator

String usermail = ((wt.enterprise.RevisionControlled)primaryBusinessObject).getCreatorEMail();

//Find the Document number

String docNumber = ((wt.doc.WTDocument)primaryBusinessObject).getNumber();

//Instantiate a new SendMail task

com.infoengine.SAK.Task newmail = new com.infoengine.SAK.Task("wt/mail/SendMail.xml");

//Set parameters . Modify as needed

newmail.addParam("FROM",me@mycompany.co.uk);

newmail.addParam("TO",usermail);

newmail.addParam("SUBJECT", docNumber);

newmail.addParam("CONTENT", docNumber);

//Send the mail

System.out.println("sending email");

newmail.invoke();   

 In the end I actually put some conditional statements in there to send different emails depending on what the state of the object was. I found most of what I needed in the knowledge base and the Java API documentation

Top Tags