Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
The macro workflow itself is not huge at all, the problem is the amount of conditionals I have to create.
The basic flow of the WTDocuments is: After creation, depending on the metadata of the document, one or more people has to comment the document, then a consolidator has to consolidate the comments and send it outside the company, the same will repeat when a new revision of the document is created.
The problem is that depending on 4 attributes combined- one of them with 119 different possible values - a document may pass through too many different routes, as the company is huge and theres a lot of people involved in this process, this would work almost like the "subscription" function by user, there's so many people that I probably can't create so many roles to handle it.
It would be like:
"attr1-attr2-attr3-attr4-COMENTATOR" multiplied by the number of possible combinations...
"attr2-CONSOLIDATOR"multiplied by the number of possible combinations, less consolidators at least...
The problem is this distribution of commenting activities, and to make things worst, there may be more than one person commenting documents per combination and it's an "AND" conditional, that means wathever the amount of people commenting that combination, all of them has to pass to the consolidator.
I'm trying to think outside of the box to solve this with less effort possible and making the maintenance of it easy too, any ideas will be greatly appreciated
Guilherme Rocha
Thank you all for the ideas,
I ended up narrowing down the process and reducing the amount of groups needed.
As a regular user is who will keep the people to be notified up to date, I opted to use roles other than groups as it’s easier for she to manage the roles, 314 roles where created.
We created a jar file containing code which reads a text file containing the rules of the distribution in the format “attr1|attr2=role” and keeps it in cache for 5 minutes then re-reads the file again (this is to reduce impact in processing).
The text file containing the “from-to” rules ended up like this:
attr1|attr2=role
attr1|attr2=role
attr1|attr2=role
…
This way the code required in the workflow to perform the route is minimal, I just read the attribute using the new “PersistableAdapter” to get the attributes, pass it to the method in the jar which returns me the result of the conditional directly, this result is the internal name of the role which will receive the notification and activity, I put it in a variable and use it in a notification and an activity.
It was fun.
Guilherme Rocha