Ticket #180 (closed enhancement: completed)

Opened 16 months ago

Last modified 14 months ago

Call-method command

Reported by: peterfarrell Owned by: kurtwiersma
Priority: critical Milestone: Mach-II 1.8.0 alpha
Component: framework - core Version: 1.8.0 - Framework
Keywords: call-method, call, method Cc:
Blocking: Blocked By:

Description

Often when writing Mach II applications the developer is required to create a method in a listener that simply calls a method in the application's service layer with out any additional logic. This requires the developer to write extra listener methods that don't really serve any purpose. Mach II should make this easier by providing a command that can be used in the Mach II configuration file to allow the framework to call a method in the service layer and optionally put the result in a event argument. Simple argument passing should be allow via the use of the new expression syntax for access elements in the event or properties objects.

M2SFP Call-Method Command

Attachments

Change History

Changed 15 months ago by peterfarrell

  • summary changed from Call-method commans to Call-method command

This has been implemented in the BER of Mach-II 1.8.

Changed 14 months ago by peterfarrell

I have added configurableCommandTargets to the command loader base with the ColdSpring property can then ask for to autowire.

Changed 14 months ago by peterfarrell

  • status changed from new to closed
  • resolution set to fixed

(In [1259]) - Closes #180

Changed 14 months ago by peterfarrell

  • status changed from closed to reopened
  • resolution fixed deleted

I've been using this command quite a bit and I've found that my arguments attribute can get pretty long which become unmanageable. Example:

<call-method bean="assessmentService" 
  method="getRecommendedAssessmentsByJobProfileTemplateId"
  arguments="${event.assessmentBattery.jobProfile.jobProfileTemplateId},${event.assessmentBattery.jobProfile.companyId}"
  resultArg="recommendedAssessments"/>

I was thinking that we should continue to support the current attribute, but optionally support this as well (positional arguments):

<call-method bean="assessmentService" 
  method="getRecommendedAssessmentsByJobProfileTemplateId"
  resultArg="recommendedAssessments">
  <argument value="${event.assessmentBattery.jobProfile.jobProfileTemplateId}"/>
  <argument value="${event.assessmentBattery.jobProfile.companyId}"/>
</call-method>

Or the same thing using named arguments:

<call-method bean="assessmentService" 
  method="getRecommendedAssessmentsByJobProfileTemplateId"
  resultArg="recommendedAssessments">
  <argument name="jobProfileId" value="${event.assessmentBattery.jobProfile.jobProfileTemplateId}"/>
  <argument name="companyId" value="${event.assessmentBattery.jobProfile.companyId}"/>
</call-method>

Thoughts?

Changed 14 months ago by kurtwiersma

Yes I agree this would be a nice addition.

Changed 14 months ago by peterfarrell

Kurt, I assume you'll take on this task? The other option we need to consider is would we allow people to nest arguments between the call-method tags and use the arguments attribute as well? I would think you could only use one or the other.

Changed 14 months ago by kurtwiersma

  • hours set to 0
  • estimatedhours set to 0
  • totalhours set to 0
  • billable set to 1

Yes I have actually already started working on this addition to this ticket.

Changed 14 months ago by peterfarrell

Ok, good to know. Cannot wait to play with it as I'm already sick of mile long arguments attributes in my applications. Oh, be sure to update the wiki documentation on this when you are done so it's up to date (both the M2SPF and the xml syntax reference).

Changed 14 months ago by peterfarrell

I think we should rename the arguments attribute to args so it remains inline with the args attribute of the redirect command. Thoughts?

Changed 14 months ago by kurtwiersma

  • status changed from reopened to closed
  • resolution set to completed

Add/Change #180 (Call-method command)

Author


E-mail address and user name can be saved in the Preferences.


Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.