Examples of routeSpecification()


Examples of org.qi4j.sample.dcicargo.sample_a.data.shipping.cargo.Cargo.routeSpecification()

            assertThat( "First load location equals origin location.",
                        itinerary.firstLeg().loadLocation().get(),
                        is( equalTo( cargo.routeSpecification().get().origin().get() ) ) );
            assertThat( "Last unload location equals destination location.",
                        itinerary.lastLeg().unloadLocation().get(),
                        is( equalTo( cargo.routeSpecification().get().destination().get() ) ) );
            assertThat( "Cargo will be delivered in time.",
                        itinerary.finalArrivalDate().before( cargo.routeSpecification().get().arrivalDeadline().get() ),
                        is( equalTo( true ) ) );
        }
    }
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_a.data.shipping.cargo.Cargo.routeSpecification()

                        is( equalTo( cargo.routeSpecification().get().origin().get() ) ) );
            assertThat( "Last unload location equals destination location.",
                        itinerary.lastLeg().unloadLocation().get(),
                        is( equalTo( cargo.routeSpecification().get().destination().get() ) ) );
            assertThat( "Cargo will be delivered in time.",
                        itinerary.finalArrivalDate().before( cargo.routeSpecification().get().arrivalDeadline().get() ),
                        is( equalTo( true ) ) );
        }
    }

    @Test
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_a.data.shipping.cargo.Cargo.routeSpecification()

        public List<IModel<Itinerary>> routeCandidates( final String trackingIdString )
            throws FoundNoRoutesException
        {
            Cargo cargo = uowf.currentUnitOfWork().get( Cargo.class, trackingIdString );
            List<Itinerary> routes = routingService.fetchRoutesForSpecification( cargo.routeSpecification().get() );

            List<IModel<Itinerary>> modelList = new ArrayList<IModel<Itinerary>>();
            for( Itinerary itinerary : routes )
            {
                modelList.add( JSONModel.of( itinerary ) );
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_b.communication.query.dto.CargoDTO.routeSpecification()

                CargoDTO cargo = item.getModelObject();
                String trackingId = cargo.trackingId().get().id().get();
                String origin = cargo.origin().get().getCode();

                // Route specification
                RouteSpecification routeSpec = cargo.routeSpecification().get();
                String destination = routeSpec.destination().get().getCode();
                Date deadline = routeSpec.arrivalDeadline().get();

                // Routing status
                Delivery delivery = cargo.delivery().get();
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_b.communication.query.dto.CargoDTO.routeSpecification()

        {
            CommonQueries fetch = new CommonQueries();
            CargoDTO cargo = fetch.cargo( trackingId ).getObject();
            List<String> locations = fetch.unLocodes();

            origin = cargo.routeSpecification().get().origin().get().getCode();
            oldDestination = destination = cargo.routeSpecification().get().destination().get().getCode();

            final FeedbackPanel feedback = new FeedbackPanel( "usecaseFeedback" );
            final SelectorInForm destinationSelector = new SelectorInForm(
                "destination", "Destination", locations, this, "origin" );
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_b.communication.query.dto.CargoDTO.routeSpecification()

            CommonQueries fetch = new CommonQueries();
            CargoDTO cargo = fetch.cargo( trackingId ).getObject();
            List<String> locations = fetch.unLocodes();

            origin = cargo.routeSpecification().get().origin().get().getCode();
            oldDestination = destination = cargo.routeSpecification().get().destination().get().getCode();

            final FeedbackPanel feedback = new FeedbackPanel( "usecaseFeedback" );
            final SelectorInForm destinationSelector = new SelectorInForm(
                "destination", "Destination", locations, this, "origin" );
            final ComponentFeedbackPanel destinationFeedback = new ComponentFeedbackPanel(
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_b.communication.query.dto.CargoDTO.routeSpecification()

        IModel<CargoDTO> cargoModel = new CommonQueries().cargo( trackingId );
        CargoDTO cargo = cargoModel.getObject();
        Delivery delivery = cargo.delivery().get();
        TransportStatus transportStatus = delivery.transportStatus().get();
        RouteSpecification routeSpecification = cargo.routeSpecification().get();
        final RoutingStatus routingStatus = delivery.routingStatus().get();
        boolean isMisrouted = routingStatus == MISROUTED;
        boolean isReRouted = !cargo.origin().get().getCode().equals( routeSpecification.origin().get().getCode() );

        add( new PrevNext( "prevNext", CargoDetailsPage.class, trackingId ) );
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_b.communication.query.dto.CargoDTO.routeSpecification()

                }
                add( new Label( "transportStatus", new StringResourceModel(
                    "transportStatus.${status}", this, new Model<ValueMap>( map ) ) ) );

                // ETA ----------------------------------------------------------------------
                String destination = cargo.routeSpecification().get().destination().get().getString();
                Date eta = cargo.delivery().get().eta().get();
                String etaString = eta == null ? "?" : new SimpleDateFormat( "yyyy-MM-dd" ).format( eta );
                add( new Label( "eta", new StringResourceModel(
                    "eta", this, null, Model.of( destination ), Model.of( etaString ) ) ) );
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_b.communication.query.dto.CargoDTO.routeSpecification()

        Label label = new Label( "text", new StringResourceModel(
            "nextEvent.${nextEvent}", this, new Model<ValueMap>( map ) ) );
        add( label );

        CargoDTO cargo = cargoModel.getObject();
        Location destination = cargo.routeSpecification().get().destination().get();

        if( cargo.itinerary().get() == null )
        {
            map.put( "nextEvent", "ROUTE" );
            return;
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_b.communication.query.dto.CargoDTO.routeSpecification()

        HandlingEvent previousEvent = cargo.delivery().get().lastHandlingEvent().get();
        if( previousEvent == null )
        {
            map.put( "nextEvent", "RECEIVE" );
            map.put( "location", cargo.routeSpecification().get().origin().get().getString() );
            return;
        }

        Location lastLocation = previousEvent.location().get();
        if( previousEvent.handlingEventType().get() == HandlingEventType.CLAIM && lastLocation == destination )
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.