Skip to main content
1-Visitor
May 8, 2014
Question

Workflow Notifications, dynamic "sender" address?

  • May 8, 2014
  • 8 replies
  • 2175 views

Hello Gurus,


scenario:


I am facing a problem with the behavior of the notifications from workflows, when you have notifications in the WF, the sender (from) of the notification is always the creator of the document, my problem is that the actors in some of the workflows cannot interact with each other, actually they can't even know each other.


For example in a particular workflow theres the internal engineering team, in the other side theres the suppliers and subcontractors (external users), and in the middle there's the procurement team, each action from one side to another pass trough procurement so engineering and suppliers can't interact directly, but now we have this problem that the mail notifications of documents created by suppliers are being sent to the engineering team with the supplier as the sender and vice versa, but contractually that can't happen.


Requirement:


With that being said I would like to know if is there a way to change this behavior of the notifications so the mail is sent with the sender as the participant who completed the activity before that notification.



Guilherme Rocha


8 replies

22-Sapphire I
May 8, 2014
Who would you propose that the email come from?

- The system

- The initiator of the workflow process (various mechanisms involved for this)

- Someone who has completed a Task already in the Process

- Someone from a specific Role on the Context team

- Other

We've struggled with this many times also - especially when Tasks are re-assigned, people in team instances are swapped out, users leave, the user who revises and starts a new process is not the "creator " etc., etc.

Would be interesting to have a discussion on this with others' viewpoints.

We're leaning toward having all emails from "the system" actually being the least confusing.

grocha1-VisitorAuthor
1-Visitor
May 8, 2014
In the particular cases affected by this which I have so far all requires
that the person who completed the activity before the notification must be
the sender of the mails.



As a temporary solution I could use the sender of everything as the system,
but I could not find any way to achieve it either, do you have any advice on
that?







Estou a disposição para qualquer esclarecimento.






22-Sapphire I
May 8, 2014
Not aware of any way for the system to send emails based on the person who completed the previous Task. Complex because there may be situations where this is ambiguous:

- Could be multiple approvers in parallel and an AND at the end of that before the current Task

- Could be a branch based on a conditional between the last completed Task and the current one

- Etc.

Doesn't seem like something that really can be developed easily.

If really needed, I would focus on an expression robot that manipulates the team instance (e.g. populate a Role from which email will be sent) at the needed point(s) in the process. Then configure the notification robot(s) to send from that Role. May need to have multiple sets of these. If it's important that the Task be from someone, can't select to use the Notification checkmark for the Task - which then has the disadvantage that users don't have a link to their Task.

Seems simple but not so much 🙂
12-Amethyst
May 19, 2014

"...disadvantage that users don't have a link to their Task"



1-Visitor
May 19, 2014
These all require customization
or system level configuration, but they are
possible if one really wants to pursue it.



When a work item is reassigned – you can develop a listener, a queue, or
workflow that doesn’t terminate that queries for reassigned items and sends
email.



The other issue on sender address is readily solved by using JavaMail for
programming or the mail API in PTC’s code (not supported officially) or
using a third party operating system level script to intercept the emails
via a email proxy server and adjusting applicable emails before they are
routed off to their actual destination.










12-Amethyst
May 19, 2014

David,


suspected these would be reasonably involved customizations. Thanks for the tips.


Darren

1-Visitor
May 19, 2014

All,


Many people are requesting for custom workflow notifications in many posts. I am attaching the java code as well as a test workflow for your help.


This code can be used even in Sub process Level. Ofcourse it is not supported by PTC and involved customization to trick the system. If you have time, you can go through the code and re use some part to customize such as Sender etc..



As of now , I didn't incorporate it for reassign. You can achieve the same



Best Regards


Prajeesh Kumar



The Zip file contain the workflow zip file and Java code. There is a property file inside com.generic package

1-Visitor
May 19, 2014

Hi,


I forgot to attach two more java files. I am adding that to the zip file. Please use the attached one


Sorry for the inconvenience


Best Regards


Prajeesh Kumar