Announcement Announcement Module
No announcement yet.
Pointcut Is Not Matching Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Pointcut Is Not Matching

    I have a Grails application (1.3.7) that is using AOP to manage some workflow functionality. The application processes various types of electronically submitted archives and/or XML messages and uses Quartz to facilitate notification and processing of artifacts from a gateway. Previously, the workflow aspect worked fine (and still works on other annotated methods) but after making some recent modifications it now skips one of the annotated methods, as if the signature no longer matches. I'm fairly new to AOP syntax, but to me it looks correct. The only difference I've noticed is that this method is also annotated with @Transactional and others are not. I've tried removing the @Transactional, as well as modifying the pointcut syntax to include it and it still doesn't work. Any advice would be helpful, the code including the pointcut and signatures is below.

    class SubmissionWorkflowAspect {
    	def dataSource
    	@Pointcut("@annotation(SubmissionWorkflowActivity) && args(submission,..)")
    	def workflowActivity(Submission submission){}
    	def processWorkflowActivities(ProceedingJoinPoint joinPoint, Submission submission)
            // logic in here, excluded for brevity
    Custom Annotation
    import java.lang.annotation.ElementType;
    import java.lang.annotation.RetentionPolicy;
    import java.lang.annotation.Retention;
    import java.lang.annotation.Target;
    public @interface SubmissionWorkflowActivity {
    Target Class and Code:
    The method parseSubmissionXML is not getting @Around advice applied.
    import java.util.List
    import org.springframework.transaction.annotation.Propagation
    import org.springframework.transaction.annotation.Transactional
    import aspects.SubmissionWorkflowActivity
    class ParseSubmissionService {	
    	def storedProcedureService
    	def stagingService
    	def loaderProperties
    	def parseSubmissions() 
    		List<Submission> submissions = Submission.findAllByStatus(SubmissionStatus.PARSING)
    		for(Submission submission : submissions) {
    			def submissionDirectory = Utils.createStagingAreaPath (submission.stagingArea, submission.receiptDate, submission.coreId)
    			List<SubmissionDocument> submissionDocuments = stagingService.extractSubmission(submission, Notify.findByCoreId(submission.coreId), submissionDirectory)
    			try {
    				parseSubmissionXML(submission, submissionDocuments)
    			} catch(ex) {
    				submission.status = SubmissionStatus.PARSING_FAILED
    					submission.errors.allErrors.each {
    						println it
    	def parseSubmissionXML(Submission submission, List<SubmissionDocument> submissionDocuments)
              // logic in here, excluded for brevity