public class GenerateEmailWithAttachmentAction extends AbstractSimpleDecisionAction
AbstractSimpleDecisionAction.TransitionmodelService, processParameterHelperERROR_RETURN_CODE, RETRY_RETURN_CODE| Constructor and Description |
|---|
GenerateEmailWithAttachmentAction() |
| Modifier and Type | Method and Description |
|---|---|
protected EmailAttachmentModel |
castMedialModelToEmailAttachmentModel(MediaModel mediaModel,
java.lang.String attachmentName)
Creates
EmailAttachmentModel with proper name and MediaModel |
protected EmailAttachmentModel |
createReturnMediaAttachment(BusinessProcessModel businessProcessModel,
java.lang.String propertyName)
Creates
EmailAttachmentModel. |
AbstractSimpleDecisionAction.Transition |
executeAction(BusinessProcessModel businessProcessModel)
Executes this
Action's business logic working on the given BusinessProcessModel. |
protected boolean |
generateEmail(BusinessProcessModel businessProcessModel,
EmailMessageModel emailMessageModel)
Generates the email or sends warning to the console
|
protected AbstractSimpleDecisionAction.Transition |
generateEmailContent(BusinessProcessModel businessProcessModel,
CatalogVersionModel contentCatalogVersion)
Checks whether or not the email content is to be generated
|
protected CMSEmailPageService |
getCmsEmailPageService() |
protected ProcessContextResolutionStrategy |
getContextResolutionStrategy() |
protected java.lang.String |
getEmailAttachmentName(java.lang.String propertyName)
Gets proper attachment name depending on given
ReturnRequestModel static field. |
protected EmailGenerationService |
getEmailGenerationService() |
protected EmailService |
getEmailService() |
protected java.lang.String |
getFrontendTemplateName() |
protected KeyGenerator |
getGuidKeyGenerator() |
protected MediaService |
getMediaService() |
protected MediaModel |
getOrCreateMediaModelForProcessModel(ReturnProcessModel returnProcessModel,
java.lang.String propertyName)
Retrieves
MediaModel from ReturnRequestModel.RETURNFORM or ReturnRequestModel.RETURNLABEL for the given ReturnProcessModel Or generates one if property is empty. |
protected PrintMediaService |
getPrintMediaService() |
protected java.lang.String |
getProperDocumentTemplateName(java.lang.String documentTemplateName)
Gets proper document template name depends on given parameter.
|
protected java.lang.String |
getReturnFormAttachmentName() |
protected java.lang.String |
getReturnFormDocumentTemplateName() |
protected java.lang.String |
getReturnLabelAttachmentName() |
protected java.lang.String |
getReturnLabelDocumentTemplateName() |
protected void |
saveReturnLabelAndReturnFormAttachments(EmailAttachmentModel returnLabelAttachmentModel,
EmailAttachmentModel returnFormAttachmentModel,
EmailMessageModel emailMessageModel,
BusinessProcessModel businessProcessModel)
Saves for given
BusinessProcessModel. |
void |
setCmsEmailPageService(CMSEmailPageService cmsEmailPageService) |
void |
setContextResolutionStrategy(ProcessContextResolutionStrategy contextResolutionStrategy) |
void |
setEmailGenerationService(EmailGenerationService emailGenerationService) |
void |
setEmailService(EmailService emailService) |
void |
setFrontendTemplateName(java.lang.String frontendTemplateName) |
void |
setGuidKeyGenerator(KeyGenerator guidKeyGenerator) |
void |
setMediaService(MediaService mediaService) |
void |
setPrintMediaService(PrintMediaService printMediaService) |
void |
setReturnFormAttachmentName(java.lang.String returnFormAttachmentName) |
void |
setReturnFormDocumentTemplateName(java.lang.String returnFormDocumentTemplateName) |
void |
setReturnLabelAttachmentName(java.lang.String returnLabelAttachmentName) |
void |
setReturnLabelDocumentTemplateName(java.lang.String returnLabelDocumentTemplateName) |
protected void |
validatePropertyName(java.lang.String propertyName)
Validates if passed parameter is either returnLabel or returnForm property.
|
execute, getTransitionscreateTransitions, getModelService, getProcessParameterHelper, getProcessParameterValue, refresh, save, setModelService, setOrderStatus, setProcessParameterHelperclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetCurrentActionDefinitionContextpublic AbstractSimpleDecisionAction.Transition executeAction(BusinessProcessModel businessProcessModel) throws RetryLaterException
AbstractSimpleDecisionActionAction's business logic working on the given BusinessProcessModel.executeAction in class AbstractSimpleDecisionActionbusinessProcessModel - The process context to work on.RetryLaterExceptionprotected AbstractSimpleDecisionAction.Transition generateEmailContent(BusinessProcessModel businessProcessModel, CatalogVersionModel contentCatalogVersion)
businessProcessModel - the BusinessProcessModel for which to check if an email has to be generatedcontentCatalogVersion - the CatalogVersionModel for which to check if an email has to be generatedprotected boolean generateEmail(BusinessProcessModel businessProcessModel, EmailMessageModel emailMessageModel)
businessProcessModel - the BusinessProcessModel to interact withemailMessageModel - the EmailMessageModel to be generatedprotected EmailAttachmentModel createReturnMediaAttachment(BusinessProcessModel businessProcessModel, java.lang.String propertyName)
EmailAttachmentModel.businessProcessModel - BusinessProcessModel, for which attachment will be created and savedpropertyName - property of ReturnRequestModel, for which MediaModel needs to be foundEmailAttachmentModel with with proper media savedprotected void saveReturnLabelAndReturnFormAttachments(EmailAttachmentModel returnLabelAttachmentModel, EmailAttachmentModel returnFormAttachmentModel, EmailMessageModel emailMessageModel, BusinessProcessModel businessProcessModel)
BusinessProcessModel.returnLabelAttachmentModel - generated as ReturnRequestModel.RETURNLABEL, with proper media filereturnFormAttachmentModel - generated as ReturnRequestModel.RETURNFORM with proper media fileemailMessageModel - EmailMessageModel which will be used to send email to userbusinessProcessModel - BusinessProcessModel for which attachments should be savedprotected MediaModel getOrCreateMediaModelForProcessModel(ReturnProcessModel returnProcessModel, java.lang.String propertyName)
MediaModel from ReturnRequestModel.RETURNFORM or ReturnRequestModel.RETURNLABEL for the given ReturnProcessModel returnProcessModel - ReturnProcessModelpropertyName - Describes which MediaModel should be found. Must be either ReturnRequestModel.RETURNFORM or ReturnRequestModel.RETURNLABELMediaModel property if exists, generate one otherwiseprotected java.lang.String getProperDocumentTemplateName(java.lang.String documentTemplateName)
documentTemplateName - should be returnLabel or returnForm - static fields of ReturnRequestModel classGenerateEmailWithAttachmentAction
classprotected void validatePropertyName(java.lang.String propertyName)
propertyName - should be returnLabel or returnForm - static field of ReturnRequestModel classprotected EmailAttachmentModel castMedialModelToEmailAttachmentModel(MediaModel mediaModel, java.lang.String attachmentName)
EmailAttachmentModel with proper name and MediaModelmediaModel - MediaModel which will be attachedattachmentName - the name for the attached MediaModelEmailAttachmentModel with proper media file and nameprotected java.lang.String getEmailAttachmentName(java.lang.String propertyName)
ReturnRequestModel static field.propertyName - should be one of ReturnRequestModel static field - returnLabel or returnFormprotected CMSEmailPageService getCmsEmailPageService()
public void setCmsEmailPageService(CMSEmailPageService cmsEmailPageService)
protected java.lang.String getFrontendTemplateName()
public void setFrontendTemplateName(java.lang.String frontendTemplateName)
protected ProcessContextResolutionStrategy getContextResolutionStrategy()
public void setContextResolutionStrategy(ProcessContextResolutionStrategy contextResolutionStrategy)
protected EmailGenerationService getEmailGenerationService()
public void setEmailGenerationService(EmailGenerationService emailGenerationService)
protected EmailService getEmailService()
public void setEmailService(EmailService emailService)
protected PrintMediaService getPrintMediaService()
public void setPrintMediaService(PrintMediaService printMediaService)
protected MediaService getMediaService()
public void setMediaService(MediaService mediaService)
protected java.lang.String getReturnLabelDocumentTemplateName()
public void setReturnLabelDocumentTemplateName(java.lang.String returnLabelDocumentTemplateName)
protected java.lang.String getReturnFormDocumentTemplateName()
public void setReturnFormDocumentTemplateName(java.lang.String returnFormDocumentTemplateName)
protected KeyGenerator getGuidKeyGenerator()
public void setGuidKeyGenerator(KeyGenerator guidKeyGenerator)
protected java.lang.String getReturnFormAttachmentName()
public void setReturnFormAttachmentName(java.lang.String returnFormAttachmentName)
protected java.lang.String getReturnLabelAttachmentName()
public void setReturnLabelAttachmentName(java.lang.String returnLabelAttachmentName)
Copyright © 2018 SAP SE. All Rights Reserved.