Examples of lastHandlingEvent()


Examples of org.qi4j.sample.dcicargo.sample_a.data.shipping.delivery.Delivery.lastHandlingEvent()

        Delivery delivery = new BuildDeliverySnapshot( cargo, handlingEvent ).get();

        assertThat( delivery.isMisdirected().get(), is( equalTo( false ) ) );
        assertThat( delivery.routingStatus().get(), is( equalTo( RoutingStatus.ROUTED ) ) );
        assertThat( delivery.transportStatus().get(), is( equalTo( TransportStatus.IN_PORT ) ) );
        assertThat( delivery.lastHandlingEvent().get(), is( equalTo( handlingEvent ) ) );
        assertThat( delivery.lastKnownLocation().get(), is( equalTo( STOCKHOLM ) ) );
        assertThat( delivery.currentVoyage().get(), is( equalTo( null ) ) );

        // Cargo has arrived at destination location
        assertThat( delivery.isUnloadedAtDestination().get(), is( equalTo( true ) ) );
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_a.data.shipping.delivery.Delivery.lastHandlingEvent()

        Delivery delivery = new BuildDeliverySnapshot( cargo, handlingEvent ).get();

        assertThat( delivery.isMisdirected().get(), is( equalTo( false ) ) );
        assertThat( delivery.routingStatus().get(), is( equalTo( RoutingStatus.ROUTED ) ) );
        assertThat( delivery.transportStatus().get(), is( equalTo( TransportStatus.IN_PORT ) ) );
        assertThat( delivery.lastHandlingEvent().get(), is( equalTo( handlingEvent ) ) );
        assertThat( delivery.lastKnownLocation().get(), is( equalTo( STOCKHOLM ) ) );
        assertThat( delivery.currentVoyage().get(), is( equalTo( null ) ) );

        // Cargo might be at destination, but the last handling event wasn't unloading
        assertThat( delivery.isUnloadedAtDestination().get(), is( equalTo( true ) ) );
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_a.data.shipping.delivery.Delivery.lastHandlingEvent()

        assertThat( delivery.nextExpectedHandlingEvent().get(), is( equalTo( null ) ) );
        assertThat( delivery.eta().get(), is( equalTo( null ) ) );

        assertThat( delivery.routingStatus().get(), is( equalTo( RoutingStatus.ROUTED ) ) );
        assertThat( delivery.transportStatus().get(), is( equalTo( TransportStatus.CLAIMED ) ) );
        assertThat( delivery.lastHandlingEvent().get(), is( equalTo( handlingEvent ) ) );
        assertThat( delivery.lastKnownLocation().get(), is( equalTo( HELSINKI ) ) );
        assertThat( delivery.currentVoyage().get(), is( equalTo( null ) ) );

        // Cargo is claimed but has not arrived yet in destination port
        assertThat( delivery.isUnloadedAtDestination().get(), is( equalTo( false ) ) );
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_a.data.shipping.delivery.Delivery.lastHandlingEvent()

        Delivery delivery = new BuildDeliverySnapshot( cargo, handlingEvent ).get();

        assertThat( delivery.isMisdirected().get(), is( equalTo( false ) ) );
        assertThat( delivery.routingStatus().get(), is( equalTo( RoutingStatus.ROUTED ) ) );
        assertThat( delivery.transportStatus().get(), is( equalTo( TransportStatus.CLAIMED ) ) );
        assertThat( delivery.lastHandlingEvent().get(), is( equalTo( handlingEvent ) ) );
        assertThat( delivery.lastKnownLocation().get(), is( equalTo( STOCKHOLM ) ) );
        assertThat( delivery.currentVoyage().get(), is( equalTo( null ) ) );

        // Cargo is claimed in destination port
        assertThat( delivery.isUnloadedAtDestination().get(), is( equalTo( true ) ) );
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_a.data.shipping.delivery.Delivery.lastHandlingEvent()

                                                                      .arrivalDeadline()
                                                                      .get() ) ) );

                item.add( new Label( "routingStatus", routingStatus.toString() ).add( new ErrorColor( routingStatus == RoutingStatus.MISROUTED ) ) );

                Boolean inCustoms = delivery.lastHandlingEvent().get() != null
                                    && delivery.lastHandlingEvent()
                                           .get()
                                           .handlingEventType()
                                           .get() == HandlingEventType.CUSTOMS;
                String customsLabel = delivery.transportStatus().get().name() + ( inCustoms ? " (CUSTOMS)" : "" );
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_a.data.shipping.delivery.Delivery.lastHandlingEvent()

                                                                      .get() ) ) );

                item.add( new Label( "routingStatus", routingStatus.toString() ).add( new ErrorColor( routingStatus == RoutingStatus.MISROUTED ) ) );

                Boolean inCustoms = delivery.lastHandlingEvent().get() != null
                                    && delivery.lastHandlingEvent()
                                           .get()
                                           .handlingEventType()
                                           .get() == HandlingEventType.CUSTOMS;
                String customsLabel = delivery.transportStatus().get().name() + ( inCustoms ? " (CUSTOMS)" : "" );
                item.add( new Label( "transportStatus", customsLabel ) );
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_a.data.shipping.delivery.Delivery.lastHandlingEvent()

        else
        {
            throw new RuntimeException( "Unknown routing status." );
        }

        if( delivery.lastHandlingEvent().get() == null )
        {
            add( new Label( "handlingHistoryPanel" ) );
        }
        else
        {
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_b.data.structure.delivery.Delivery.lastHandlingEvent()

                TransportStatus transportStatus = delivery.transportStatus().get();
                boolean isHiJacked = transportStatus.equals( UNKNOWN );

                // Delivery status
                boolean isMisdirected = delivery.isMisdirected().get();
                HandlingEvent event = delivery.lastHandlingEvent().get();
                boolean inCustoms = event != null && event.handlingEventType().get() == CUSTOMS;

                // Output

                item.add( new LinkPanel( "trackingId", CargoDetailsPage.class, trackingId ) );
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_b.data.structure.delivery.Delivery.lastHandlingEvent()

            add( new LinkPanel( "routingAction", ReRouteCargoPage.class, trackingId, "Re-route" ) );
            add( new DeliveryFragment( delivery ) );
            add( new ItineraryFragment( cargoModel, routingStatus ) );
        }

        if( delivery.lastHandlingEvent().get() == null )
        {
            add( new Label( "handlingHistoryPanel" ) );
        }
        else
        {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.