Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Custom Email have degraded CLM Performance (while Saving Work Items)

 We have introduced a plugin which will trigger customized emails to specific users (for any change within Work Items)


This has degraded the performance of CLM server. I mean, It is taking around 5 to 8 minutes for saving the changes.

Can anyone plz help me to rectify this issue (We are on CLM 5.0.1)

0 votes



4 answers

Permanent link

 Step 1: Upgrade your serve to 6.0.6, which is a long term supported release. There is no reason to be on that old of a version.


Step 2: Update your plugin for the new version of CLM 6.0.6

Step 3: Scan your plugin for performance errors, or post your code for others to review. The problem is likely within the code, and we will not be able to help you without it. 

1 vote

Comments

plus it is possible to debug the code of your custom extension. That way it is possible to find out where the time is wasted and analyze why. 


Permanent link

 







 Thanks for your quick reply Kenny & Ralph.

Kindly find the below code

public void automaticemailtoFPMContentTeam(IWorkItem workingCopy1,
IMailerService mailService, IWorkItemServer wis,
IWorkItemCommon wiCommon, IParticipantInfoCollector collector) {
// TODO Auto-generated method stub
try
{
IWorkItem workingCopy = (IWorkItem) wis.getAuditableCommon().resolveAuditable(workingCopy1, IWorkItem.FULL_PROFILE,null).getWorkingCopy();  
IProjectAreaHandle iProjectAreaHandle =  workingCopy.getProjectArea();
IProjectArea iProjectArea=(IProjectArea)wis.getAuditableCommon().resolveAuditable(iProjectAreaHandle, ItemProfile.PROJECT_AREA_DEFAULT, null);
String emailsubject=null;
String emailBody=null;
IAttribute attribute_packstatus=wis.findAttribute(workingCopy.getProjectArea(), "PackStatus", null);
IEnumeration packstatusenum1 =wis.resolveEnumeration(attribute_packstatus, null);
Identifier<? extends ILiteral> iliteral_packstatus= (Identifier<? extends ILiteral>) workingCopy.getValue(attribute_packstatus);
List literal_all = packstatusenum1.getEnumerationLiterals(); 
String PackStatus = null;
            for (Iterator iterator = literal_all.iterator(); iterator.hasNext();) 
            { 
                ILiteral iLiteral = (ILiteral) iterator.next(); 
                if (iLiteral.getIdentifier2().equals(iliteral_packstatus)) 
                { 
                PackStatus = iLiteral.getName(); 
                    //System.out.println("its value is "+displayvalue); 
                } 
            } 
   emailsubject="Frontend Pack Master state Change Notification";
   IContributorHandle Ownedbyhandle=workingCopy.getOwner();
   IContributor contributor = (IContributor)wis.getAuditableCommon().resolveAuditable(Ownedbyhandle, ItemProfile.CONTRIBUTOR_DEFAULT, null);
   String projectarea11=iProjectArea.getName();
   String projarea=projectarea11.replaceAll(" ", "");
//  System.out.println(projarea);
   long datecur= System.currentTimeMillis();
   Timestamp mdate = new Timestamp(datecur);
   emailBody = "A new workitem pack (Task):"+workingCopy.getHTMLSummary().getPlainText()";
List<ICategory> findCategories=wis.findCategories(iProjectAreaHandle, ICategory.FULL_PROFILE, null);
for (ICategory category11 : findCategories) { 
ICategory catttt=category11;
// System.out.println(catttt);
  String catname = catttt.getName();
//  System.out.println(catname);
  if(catname.equalsIgnoreCase("Pending with EMS") || catname.equalsIgnoreCase("Pending with Dev") ||catname.equalsIgnoreCase("Pending with "))
  {
  List<ITeamAreaHandle> allteamareas=catttt.getAssociatedTeamAreas();
  for(ITeamAreaHandle teamAreaHandle : allteamareas)
{
  ITeamArea allteamarea11=(ITeamArea) wis.getAuditableCommon().resolveAuditable(teamAreaHandle, ItemProfile.TEAM_AREA_DEFAULT, null);
// System.out.println(allteamarea11);
  IContributorHandle[] teammembers1=allteamarea11.getMembers();
// System.out.println(teammembers1);
  for(IContributorHandle memberHandle : teammembers1)
{
IContributor teamMember= (IContributor)wis.getAuditableCommon().resolveAuditable(memberHandle, ItemProfile.CONTRIBUTOR_DEFAULT, null);
String mailAddress = teamMember.getEmailAddress();
//System.out.println(mailAddress1);
mailService.sendMail(mailService.getDefaultSender(), mailAddress,emailsubject, emailBody ,null);
            }
}

0 votes


Permanent link

@ Ralph I checked the above plugin code on Jetty its taking much time while sending mail using below code:

 mailService.sendMail(mailService.getDefaultSender(), mailAddress,emailsubject, emailBody ,null);

 Kindly help us.

0 votes


Permanent link

I can not help with that. 

I don't know how long "much time" is. 
I don't know how long it is expected/supposed to take to send such a mail and how to know this is too long. 

I would try to check if there is a problem with the connection to the mail server. Create a test mail server and check if that is faster.

You have to also be aware that the follow up action blocks the UI thread. The built in mail service is not implemented as a follow up action, as far as I know. It is running in the background.

Consider to change your design to decouple the save from the mail sending and do that in the background similar to the built in service.

Last but not least, I think to send mail to all team members is not a good design. In addition your code seems to always run and send e-mail - on every singe work item save. If this is indeed the case, the whole extension is questionable in my view. 

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,937

Question asked: Sep 25 '18, 2:53 a.m.

Question was seen: 2,408 times

Last updated: Sep 26 '18, 5:17 a.m.

Confirmation Cancel Confirm