You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@isis.apache.org by Cesar Lugo <ce...@sisorg.com.mx> on 2015/11/04 22:50:01 UTC

Metamodel validation

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

Re: Metamodel validation

Posted by Óscar Bou - GOVERTIS <o....@govertis.com>.
Hi Cesar.

"disable" is a reserved prefix in Isis.

When present Isis evaluate it I order to programmatically determine if a given property or action must be disabled.

As it is finding a method named "disableXXX" it's trying to find a property whose name is XXX in order to know for which one this method is associated to.

As there's no property or action named "assignForDelivery" it fails.

See [1] for more info.

HTH,

Oscar 

[1] https://isis.apache.org/guides/rg.html#3.2.2.-disable()



> El 4 nov 2015, a las 22:50, Cesar Lugo <ce...@sisorg.com.mx> escribió:
> 
> disableAssignForDelivery() {