isis-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Haywood <...@haywood-associates.co.uk>
Subject Re: Metamodel validation
Date Wed, 04 Nov 2015 22:16:35 GMT
In 1.9.0 the disable method must match the parameters of the action.

So action:

    public CustomerOrder assignForDelivery(Deliverer deliverer)

should have a disable method of:

   public String disableAssignForDelivery(Deliverer deliverer).


I must admit I am always making this mistake myself, so in 1.10.0-SNAPSHOT
the framework will also accept the no-arg version (as you've written it).

HTH
Dan



On 4 November 2015 at 21:50, Cesar Lugo <cesar.lugo@sisorg.com.mx> wrote:

> Hello,
>
>
>
> I have  a metamodel validation and I cant find what the issue is.
>
>
>
> My code is the following:
>
>
>
>    //region > assignForDelivery (action)
>
>     @MemberOrder(name="status",sequence = "1")
>
>     @ActionLayout(position = ActionLayout.Position.PANEL_DROPDOWN)
>
>     public CustomerOrder assignForDelivery(
>
>             final @ParameterLayout(named = "Delivered By") Deliverer
> deliverer
>
>     ) {
>
>         setDeliveredBy(deliverer);
>
>         setAssignedForDeliveryTime(clockService.nowAsDateTime());
>
>         setStatus(CustomerOrderStatus.ASSIGNED_FOR_DELIVERY);
>
>         return this;
>
>     }
>
>
>
>     // disable action dependent on state of object
>
>     public String disableAssignForDelivery() {
>
>         return status.equals(CustomerOrderStatus.ASSIGNED_FOR_DELIVERY) ?
> "Customer order is already assigned for delivery" : null;
>
>     }
>
>     //endregion
>
>
>
> Then I get the following metamodel validation error:
>
>
>
> domainapp.dom.simple.customerorders.CustomerOrder#disableAssignForDelivery:
> has prefix disable, is probably a supporting method for a property,
> collection or action.  If the method is intended to be an action, then
> rename and use @ActionLayout(named="...") or ignore completely using
> @Programmatic
>
>
>
> I have even changed the name of the method and still get the same error.
>
>
>
> Cesar.
>
>
>
>
>
> ---
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message