Examples of BookNewCargo


Examples of org.qi4j.sample.dcicargo.sample_a.context.shipping.booking.BookNewCargo

        NEWYORK = uow.get( Location.class, USNYC.code().get() );
        DALLAS = uow.get( Location.class, USDAL.code().get() );
        V100S = uow.get( Voyage.class, "V100S" );
        V200T = uow.get( Voyage.class, "V200T" );
        V300A = uow.get( Voyage.class, "V300A" );
        trackingId = new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, day( 17 ) ).createCargo( "ABC" );
        cargo = uow.get( Cargo.class, trackingId.id().get() );
        Itinerary itinerary = itinerary(
              leg( V100S, HONGKONG, NEWYORK, day( 1 ), day( 8 ) ),
              leg( V200T, NEWYORK, DALLAS, day( 9 ), day( 12 ) ),
              leg( V300A, DALLAS, STOCKHOLM, day( 13 ),
                   arrival = day( 16 ) )
        );
        new BookNewCargo( cargo, itinerary ).assignCargoToRoute();
        time = day( 1 );
        trackId = trackingId.id().get();
    }
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_a.context.shipping.booking.BookNewCargo

    }

    @Test
    public void deviation_3c_CargoNotRoutedYet() throws Exception
    {
        TrackingId nonRoutedTrackingId = new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, day( 17 ) ).createCargo( "NonRoutedCargo" );
        String nonRouted = nonRoutedTrackingId.id().get();

        msg = register( time, time, nonRouted, "RECEIVE", "CNHKG", null );
        assertThat( msg, is( equalTo( "Can't create handling event for non-routed cargo '" + nonRouted + "'." ) ) );
    }
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_a.context.shipping.booking.BookNewCargo

        Voyage V100S = uow.get( Voyage.class, "V100S" );
        V200T = uow.get( Voyage.class, "V200T" );
        V300A = uow.get( Voyage.class, "V300A" );

        // Create cargo
        trackingId = new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, day( 17 ) ).createCargo( "ABC" );
        cargo = uow.get( Cargo.class, trackingId.id().get() );
        Itinerary itinerary = itinerary(
            leg( V100S, HONGKONG, NEWYORK, day( 1 ), day( 8 ) ),
            leg( V200T, NEWYORK, DALLAS, day( 9 ), day( 12 ) ),
            leg( V300A, DALLAS, STOCKHOLM, day( 13 ), day( 16 ) )
        );

        // Route cargo
        new BookNewCargo( cargo, itinerary ).assignCargoToRoute();
    }
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_a.context.shipping.booking.BookNewCargo

                    // BOOK cargo with no handling (i == 11)

                    // ROUTE
                    if( i > 11 )
                    {
                        Itinerary itinerary = new BookNewCargo( cargo ).routeCandidates().get( 0 );
                        new BookNewCargo( cargo, itinerary ).assignCargoToRoute();
                    }

                    // RECEIVE
                    if( i > 12 )
                    {
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_a.context.shipping.booking.BookNewCargo

                    // Build sortable random tracking ids
                    uuid = UUID.randomUUID().toString().toUpperCase();
                    id = ( i + 11 ) + "-" + uuid.substring( 0, uuid.indexOf( "-" ) );

                    new BookNewCargo( cargos, origin, destination, deadline ).createCargo( id );
                }
                uow.complete();
            }
            catch( Exception e )
            {
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_a.context.shipping.booking.BookNewCargo

                protected void onSubmit( AjaxRequestTarget target, Form<?> form )
                {
                    try
                    {
                        // Perform use case
                        TrackingId trackingId = new BookNewCargo( origin, destination, deadline ).book();

                        // Add new tracking id to list in session
                        PrevNext.addId( Session.get(), trackingId.id().get() );

                        // Show created cargo
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_a.context.shipping.booking.BookNewCargo

            protected void onSubmit( AjaxRequestTarget target, Form<?> form )
            {
                try
                {
                    // The candidate route is sent as the chosen Itinerary
                    new BookNewCargo( trackingIdString, candidateRouteModel.getObject() ).assignCargoToRoute();
                    setResponsePage( CargoDetailsPage.class, new PageParameters().set( 0, trackingIdString ) );
                }
                catch( Exception e )
                {
                    String msg = "Problem assigning this route to cargo: " + e.getMessage();
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_a.context.shipping.booking.BookNewCargo

                        {
                            throw new IllegalArgumentException( "Please select a new destination." );
                        }

                        // Perform use case
                        new BookNewCargo( trackingId ).changeDestination( destination );

                        // Show updated cargo
                        setResponsePage( CargoDetailsPage.class, new PageParameters().set( 0, trackingId ) );
                    }
                    catch( Exception e )
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_b.context.interaction.booking.BookNewCargo

                protected void onSubmit( AjaxRequestTarget target, Form<?> form )
                {
                    try
                    {
                        // Perform use case
                        TrackingId trackingId = new BookNewCargo( origin, destination, deadline ).getTrackingId();

                        // Add new tracking id to list in session
                        PrevNext.addId( Session.get(), trackingId.id().get() );

                        // Show created cargo
View Full Code Here

Examples of org.qi4j.sample.dcicargo.sample_b.context.interaction.booking.BookNewCargo

                    // Build sortable random tracking ids
                    uuid = UUID.randomUUID().toString().toUpperCase();
                    id = ( i + 11 ) + "-" + uuid.substring( 0, uuid.indexOf( "-" ) );

                    new BookNewCargo( cargos, origin, destination, deadline ).withTrackingId( id );
                }
                uow.complete();
            }
            catch( Exception e )
            {
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.