Skip to main content

Address and Customer Example Project

Example project

In this example project, we have created a localhost SQL Server with schema pii_tables and the two tables Address and Customer.

It demonstrate similarities and differences between update and create Work Tasks, and their rules.

The Database Creation, DDL Export and ANO File

The tables Address and Customer are created in a SQL Server schema of name pii_tables, using the following SQL Statements.

--drop table pii_tables.Customer;
--drop table pii_tables.Address;

CREATE TABLE pii_tables.Address (
addressNo BIGINT not null,
homeAddress varchar(50) null ,
postalCode varchar(10) null,
created datetime null,
CONSTRAINT Address_PK PRIMARY KEY (addressNo),
);

CREATE TABLE pii_tables.Customer (
ID int NOT NULL identity(1,1),
addressNo BIGINT not null,
email varchar(50) null ,
name varchar(50) null,
created datetime null,
CONSTRAINT Customer_PK PRIMARY KEY (ID),
FOREIGN KEY (addressNo) REFERENCES pii_tables.Address(addressNo)
);

INSERT INTO pii_tables.Address (addressNo, homeAddress, postalCode, created) VALUES (372036854775807, 'Prod Address 1', '1234', '2020-01-28 12:24:06');
INSERT INTO pii_tables.Address (addressNo, homeAddress, postalCode, created) VALUES (137862354775678, 'Prod Address 2', '6542', '2020-07-15 16:35:13');
INSERT INTO pii_tables.Address (addressNo, homeAddress, postalCode, created) VALUES (825675368758452, 'Prod Address 3', '1008', '2021-01-01 14:05:34');
INSERT INTO pii_tables.Address (addressNo, homeAddress, postalCode, created) VALUES (265736898756443, 'Prod Address 4', '4064', '2021-12-21 08:57:30');

INSERT INTO pii_tables.Customer (addressNo,email,name,created) VALUES (372036854775807,'jean.smith@mail.com', null, '2020-01-28 12:24:06');
INSERT INTO pii_tables.Customer (addressNo,email,name,created) VALUES (137862354775678,'m.simmons@somemail.com','Mark Simmons', '2020-07-15 16:35:13');
INSERT INTO pii_tables.Customer (addressNo,email,name,created) VALUES (825675368758452,null,'Edward Snake', '2021-01-01 14:05:34');
INSERT INTO pii_tables.Customer (addressNo,email,name,created) VALUES (265736898756443,'mary.lake@foomail.com','Mary Lake', '2021-12-21 08:57:30');

Setting up and running the project

Now that we have written the Tasks and Rules Section in the address_customer.ano file, we follow the steps in From ANO to Task Execution to get the java project.