Package org.qi4j.sample.dcicargo.sample_b.data.structure.delivery

Examples of org.qi4j.sample.dcicargo.sample_b.data.structure.delivery.NextHandlingEvent.location()


                    // RECEIVE
                    if( i > 13 )
                    {
                        nextEvent = cargo.delivery().get().nextHandlingEvent().get();
                        port = nextEvent.location().get().getCode();
                        final Date mockTime = new Date();
                        registerEvent( mockTime, mockTime, trackingId, RECEIVE, port, null );
                    }

                    // MISDIRECT: LOAD onto wrong carrier
View Full Code Here


                    // MISDIRECT: LOAD onto wrong carrier
                    if( i == 15 )
                    {
                        nextEvent = cargo.delivery().get().nextHandlingEvent().get();
                        time = nextEvent.time().get();
                        port = nextEvent.location().get().getCode();
                        voyageNumber = nextEvent.voyage().get().voyageNumber().get().number().get();

                        // Find earliest wrong carrier movement (voyage) with same departure location
                        final Query<Voyage> voyages = module.currentUnitOfWork()
                            .newQuery( module.newQueryBuilder( Voyage.class ) );
View Full Code Here

                    // LOAD
                    if( i > 15 )
                    {
                        nextEvent = cargo.delivery().get().nextHandlingEvent().get();
                        time = nextEvent.time().get();
                        port = nextEvent.location().get().getCode();
                        voyageNumber = nextEvent.voyage().get().voyageNumber().get().number().get();
                        registerEvent( time, time, trackingId, LOAD, port, voyageNumber );

                        // Cargo is now on board carrier
                        nextEvent = cargo.delivery().get().nextHandlingEvent().get();
View Full Code Here

                        // Cargo is now on board carrier
                        nextEvent = cargo.delivery().get().nextHandlingEvent().get();
                        time = nextEvent.time().get();
                        type = nextEvent.handlingEventType().get();
                        port = nextEvent.location().get().getCode();
                        voyageNumber = nextEvent.voyage().get().voyageNumber().get().number().get();
                    }

                    // MISDIRECT: UNLOAD from carrier in wrong location
                    if( i == 17 )
View Full Code Here

                    // UNLOAD
                    if( i > 17 )
                    {
                        nextEvent = cargo.delivery().get().nextHandlingEvent().get();
                        time = nextEvent.time().get();
                        port = nextEvent.location().get().getCode();
                        voyageNumber = nextEvent.voyage().get().voyageNumber().get().number().get();
                        registerEvent( time, time, trackingId, UNLOAD, port, voyageNumber );

                        // Cargo is now in midpoint location
                        nextEvent = cargo.delivery().get().nextHandlingEvent().get();
View Full Code Here

                        // Cargo is now in midpoint location
                        nextEvent = cargo.delivery().get().nextHandlingEvent().get();
                        time = nextEvent.time().get();
                        type = nextEvent.handlingEventType().get();
                        port = nextEvent.location().get().getCode();
                    }

                    // CUSTOMS: Customs handling in midpoint location (doesn't affect misdirection status)
                    if( i == 19 )
                    {
View Full Code Here

                            voyageNumber = nextEvent.voyage().get().voyageNumber().get().number().get();
                            registerEvent( time, time, trackingId, type, port, voyageNumber );

                            nextEvent = cargo.delivery().get().nextHandlingEvent().get();
                            time = nextEvent.time().get();
                            port = nextEvent.location().get().getCode();
                            type = nextEvent.handlingEventType().get();
                        }
                        while( type != HandlingEventType.CLAIM );
                    }
View Full Code Here

        handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY1, DAY1, trackingId, RECEIVE, HONGKONG, noVoyage );
        new InspectReceivedCargo( cargo, handlingEvent ).inspect();

        // Itinerary calculations
        NextHandlingEvent nextLoad = cargo.delivery().get().nextHandlingEvent().get();
        assertThat( nextLoad.location().get(), is( equalTo( itinerary.firstLeg().loadLocation().get() ) ) );
        assertThat( nextLoad.time().get(), is( equalTo( itinerary.firstLeg().loadTime().get() ) ) );
        assertThat( nextLoad.voyage().get(), is( equalTo( itinerary.firstLeg().voyage().get() ) ) );

        assertDelivery( RECEIVE, HONGKONG, DAY1, noVoyage,
                        IN_PORT, notArrived,
View Full Code Here

            label.add( new AttributeModifier( "class", "errorColor" ) );
            return;
        }

        map.put( "nextEvent", nextEvent.handlingEventType().get().name() );
        map.put( "location", nextEvent.location().get().getString() );

        if( nextEvent.time() != null )
        {
            map.put( "time", new SimpleDateFormat( "yyyy-MM-dd" ).format( nextEvent.time().get() ) );
        }
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.