Example #1
0
        public static DataModel KoopmanCTO()
        {
            var doc = new DataModel()
            {
                Namespace = "org.digitalcmr"
            };

            DataModelDemo.TransportOrder(doc);
            DataModelDemo.ECMR(doc);
            DataModelDemo.Entity(doc);
            doc.AddComponent(new MyAsset("LegalOwnerOrg")
            {
                Parent = "Entity"
            });
            doc.AddComponent(new MyAsset("CompoundOrg")
            {
                Parent = "Entity"
            });
            doc.AddComponent(new MyAsset("CarrierOrg")
            {
                Parent = "Entity"
            });
            doc.AddComponent(new MyAsset("RecipientOrg")
            {
                Parent = "Entity"
            });
            DataModelDemo.Vehicle(doc);

            DataModelDemo.User(doc);
            doc.AddComponent(new MyParticipant("LegalOwnerAdmin")
            {
                Parent = "User"
            });
            doc.AddComponent(new MyParticipant("CompoundAdmin")
            {
                Parent = "User"
            });
            doc.AddComponent(new MyParticipant("CarrierAdmin")
            {
                Parent = "User"
            });
            doc.AddComponent(new MyParticipant("CarrierMember")
            {
                Parent = "User"
            });
            doc.AddComponent(new MyParticipant("RecipientAdmin")
            {
                Parent = "User"
            });
            doc.AddComponent(new MyParticipant("RecipientMember")
            {
                Parent = "User"
            });

            DataModelDemo.Address(doc);
            DataModelDemo.Delivery(doc);
            DataModelDemo.Loading(doc);
            DataModelDemo.Creation(doc);
            DataModelDemo.Cancellation(doc);
            DataModelDemo.Good(doc);
            DataModelDemo.Remark(doc);
            DataModelDemo.Signature(doc);
            DataModelDemo.DateWindow(doc);

            DataModelDemo.EcmrStatus(doc);
            DataModelDemo.OrderStatus(doc);

            return(doc);
        }
Example #2
0
        public static DataModel Example3()
        {
            var doc = new DataModel();

            doc.AddComponent(new MyParticipant("User")
            {
                Identifier = "Id",
                Abstract   = true,
                Components = new List <Variable>()
                {
                    new Variable("String", "Id", Variable.RELATION.variable),
                    new Variable("String", "firstName", Variable.RELATION.variable),
                    new Variable("String", "lastName", Variable.RELATION.variable),
                }
            });
            doc.AddComponent(new MyParticipant("CompoundMember")
            {
                Parent     = "User",
                Components = new List <Variable>()
                {
                    new Variable("CompoundOrganisation", "organisation", Variable.RELATION.reference)
                }
            });
            doc.AddComponent(new MyParticipant("CarrierMember")
            {
                Parent     = "User",
                Components = new List <Variable>()
                {
                    new Variable("CarrierOrganisation", "organisation", Variable.RELATION.reference)
                }
            });
            doc.AddComponent(new MyParticipant("RecipientMember")
            {
                Parent     = "User",
                Components = new List <Variable>()
                {
                    new Variable("RecipientOrganisation", "organisation", Variable.RELATION.reference)
                }
            });

            doc.AddComponent(new MyAsset("Organisation")
            {
                Identifier = "Id",
                Abstract   = true,
                Components = new List <Variable>()
                {
                    new Variable("String", "Id", Variable.RELATION.variable),
                    new Variable("String", "name", Variable.RELATION.variable)
                }
            });
            doc.AddComponent(new MyAsset("LegalOwnerOrganisation")
            {
                Parent = "Organisation"
            });
            doc.AddComponent(new MyAsset("CarrierOrganisation")
            {
                Parent = "Organisation"
            });
            doc.AddComponent(new MyAsset("RecipientOrganisation")
            {
                Parent = "Organisation"
            });
            doc.AddComponent(new MyAsset("CompoundOrganisation")
            {
                Parent = "Organisation"
            });

            DataModelDemo.EcmrStatus(doc);
            DataModelDemo.OrderStatus(doc);

            doc.AddComponent(new MyConcept("Address")
            {
                Components = new List <Variable>()
                {
                    new Variable("String", "street", Variable.RELATION.variable),
                    new Variable("String", "houseNumber", Variable.RELATION.variable),
                    new Variable("String", "city", Variable.RELATION.variable),
                    new Variable("String", "zipCode", Variable.RELATION.variable),
                    new Variable("String", "country", Variable.RELATION.variable)
                }
            });
            doc.AddComponent(new MyConcept("DateWindow")
            {
                Components = new List <Variable>()
                {
                    new Variable("DateTime", "start", Variable.RELATION.variable),
                    new Variable("DateTime", "end", Variable.RELATION.variable)
                }
            });

            doc.AddComponent(new MyAsset("Vehicle")
            {
                Identifier = "vin",
                Components = new List <Variable>()
                {
                    new Variable("String", "vin", Variable.RELATION.variable),
                    new Variable("String", "plateNumber", Variable.RELATION.variable)
                }
            });
            doc.AddComponent(new MyConcept("Signature")
            {
                Components = new List <Variable>()
                {
                    new Variable("User", "user", Variable.RELATION.reference),
                    new Variable("DateTime", "timestamp", Variable.RELATION.variable),
                    new Variable("String", "remark", Variable.RELATION.variable)
                    {
                        Optional = true
                    }
                }
            });
            doc.AddComponent(new MyConcept("Good")
            {
                Components = new List <Variable>()
                {
                    new Variable("Vehicle", "vehicle", Variable.RELATION.variable),
                    new Variable("Address", "loadingAddress", Variable.RELATION.variable),
                    new Variable("Address", "deliveryAddress", Variable.RELATION.variable),
                    new Variable("DateWindow", "pickupWindow", Variable.RELATION.variable),
                    new Variable("DateWindow", "deliveryWindow", Variable.RELATION.variable),
                }
            });

            doc.AddComponent(new MyAsset("TransportOrder")
            {
                Identifier = "íd",
                Components = new List <Variable>()
                {
                    new Variable("String", "id", Variable.RELATION.variable),
                    new Variable("LegalOwnerOrganisation", "owner", Variable.RELATION.reference),
                    new Variable("CarrierOrganisation", "carrier", Variable.RELATION.reference),
                    new Variable("ECMR", "ecmrs", Variable.RELATION.reference)
                    {
                        List = true
                    },
                    new Variable("OrderStatus", "status", Variable.RELATION.variable),
                }
            });
            doc.AddComponent(new MyAsset("ECMR")
            {
                Identifier = "id",
                Components = new List <Variable>()
                {
                    new Variable("String", "id", Variable.RELATION.variable),
                    new Variable("TransportOrder", "transportOrder", Variable.RELATION.reference),
                    new Variable("CompoundOrganisation", "source", Variable.RELATION.reference),
                    new Variable("RecipientOrganisation", "recipient", Variable.RELATION.reference),
                    new Variable("Signature", "compoundSignature", Variable.RELATION.variable)
                    {
                        Optional = true
                    },
                    new Variable("Signature", "carrierLoadingSignature", Variable.RELATION.variable)
                    {
                        Optional = true
                    },
                    new Variable("Signature", "carrierDeliverySignature", Variable.RELATION.variable)
                    {
                        Optional = true
                    },
                    new Variable("Signature", "recipientSignature", Variable.RELATION.variable)
                    {
                        Optional = true
                    },
                    new Variable("Good", "good", Variable.RELATION.variable),
                    new Variable("EcmrStatus", "status", Variable.RELATION.variable),
                }
            });

            return(doc);
        }