Uploaded image for project: 'Isis'
  1. Isis
  2. ISIS-801

Action method taking domain object paramater gets triggered automatically whenever instances of that object type is accessed




      I have application security service which creates permission to manage particular entity(OmSite). Its action method is:

      @MemberOrder(sequence = "9")
      @Named("Create Site Permission")
      public OmPermission createSitePermission(final @Named("Choose a site") OmSite site)

      { final OmPermission obj = newTransientInstance(OmPermission.class); obj.setPermission(SecurityUtil.formatSitePermission(site.getOrgId(), site.getSiteId())); obj.setSite(site); persistIfNotAlready(obj); return obj; }

      As you can see this method takes OmSite instance to create a permission to that instance. And OmPermission has foreign key to OmSite. This action is displayed in service menu and its working fine.

      But the problem I am facing is when I access the list of OmSite objects in other UI pages. This action method is getting triggered automatically and inserts bulk OmPermissions for all those List<OmSite> objects.

      This action method createSitePermission should be invoked only if it is clicked manually, but it gets triggered automatically whenever OmSite is accesed in some other places.

      For ex:
      an action that returns a list of these OmSite,
      when OmSite is in a collection of some other entity,
      When new OmSite is created.

      Workaround for this issue is annotate @NotContributed to that action method, it will prevent from invoking this method whenever its parameter instance is accessed.

      Ranganath Varma

      Could you please look into this issue.




            • Assignee:
              danhaywood Daniel Keir Haywood
              ranganath.chittari Ranganath Chittari
            • Votes:
              0 Vote for this issue
              4 Start watching this issue


              • Created: