Backend
Backend copied to clipboard
The supply-chain management for ship spare parts (SSP)
README
Table Of Contents
- Video
- Run in Intellij IDEA (recommend)
- Run in Spring Tool Suite
Repo tree
com/zbq/ # Implementation of global cache and message queue
├── ACTFEvent.java
├── EventType.java
├── GlobalEventQueue.java
├── GlobalVariables.java
└── VWFEvent.java
supplychain/activiti # Closely related to the activiti engine our bussiness process execution.
├── conf # Java configuration files including configuring activiti engine and web context.
│ ├── ActivitiEngineConfiguration.java
│ ├── AsyncConfiguration.java
│ ├── Bootstrapper.java
│ ├── ContentStorageConfiguration.java
│ ├── CustomSecurityConfig.java
│ ├── DatabaseConfiguration.java
│ ├── EmailConfiguration.java
│ ├── JacksonConfiguration.java
│ ├── MyApplicationConfiguration.java
│ ├── MyCorsRegistration.java
│ ├── RestApiConfiguration.java
│ ├── RestTemplateConfiguration.java
│ └── SchedulingConfiguration.java
├── coord # Impletation of 4 Coordinator Service , among them , VWC is the most complex one.
│ ├── MSCoordinator.java
│ ├── SWCoordinator.java
│ ├── VMCoordinator.java
│ └── VWCoordinator.java
├── listener # Some of the exection/task listeners set in process model.
│ ├── AnchorStartListener.java
│ ├── DockTaskEndListener.java
│ ├── FlowIntoVoyaListener.java
│ ├── InitListener.java
│ ├── InitWeagonListener.java
│ ├── RunEndListener.java
│ ├── RunListener.java
│ ├── SendArraInfoToSWC.java
│ ├── SendMsgToVWC.java
│ ├── SendOrderToMSC.java
│ ├── VoyagingListener.java
│ └── VoyaTaskStartListener.java
├── rest
│ └── service
│ └── api # Some convertors between custom type defined by myself and RestVariable Type build in engine.
│ ├── CustomActivitiTaskActionService.java
│ ├── CustomArrayListRestVariableConverter.java
│ ├── CustomBaseExcutionVariableResource.java
│ ├── CustomBaseVariableCollectionResource.java
│ ├── CustomDateRestVariableConverter.java
│ ├── CustomRestResponseFactory.java
│ ├── LocationRestVariableConverter.java
│ ├── VPortRestVariableConverter.java
│ ├── WeagonRestVariableConverter.java
│ └── WPortRestVariableConverter.java
├── service # Some JavaDelegate Class bound to Service Task in process.
│ ├── CustomActivitiTaskFormService.java
│ ├── SendApplyToVMCService.java
│ ├── SendMsgToAWSService.java
│ ├── SendMsgToWVCService.java
│ ├── UpdateVesselInfoService.java
│ └── UpdateWeagonInfoService.java
└── servlet # About other web configuration
├── MyApiDispatcherServletConfiguration.java #servlet dispatcher for url pattern /api/*
├── MyCorsFilter.java # used to solve CORS problem.
├── MyWebConfigurer.java # configure two servlet dispatcher , respectively for '/api/*' and '/app/*'.
├── SystemWebSocketHandler.java # websocket haven't been used , you can ignore them.
└── WebsocketHandshakeInterceptor.java
supplychain/web/ # Implementation of REST interfaces to provide endpoints to front-end or AWS to access.
├── AbstractController.java
├── CoordController.java
├── ProcessInstancesResource.java
├── TaskController.java
├── TaskFormResource.java
├── VesselController.java
└── VesselProcessInstanceVariableDataResource.java
supplychain/entity/ # Some custom Types for process model.
├── IotVessel.java
├── Location.java
├── Path.java
├── VesselVariablesResponse.java
├── VPort.java
├── Weagon.java
└── WPort.java
Video
Run in Intellij IDEA
-
Download development tool:
IDE: Intellij IDEA
Web Container: Tomcat
Database: MYSQL
-
Clone Source Code:
git clone --recursive [email protected]:sonnyhcl/Backend.git -
Import Project in IDEA:
-
Choose
Import Project.
-
Choose the
directory pathwhich you clone the source code -
Choose import project from external model
maven -
Pass
select profiles -
Pass
select maven projects to import. -
Carefully choose
project JDK -
Finish -
Wait for IDEA to download maven dependencies
-
-
Configure Mysql
First make sure you have installed
mysqland your mysql has a empty database calledact6Or you can edit your own mysql
databasename/username/passwordin activiti-app.properties -
Configure Tomcat:
-
Click
Run
-
Edit
Run Configuration -
Click the
plusin left-up corner -
Choose
Tomcat Server -
Choose
local -
Configure tomcat in idea

-
Configure artifact

-
Configure application-context:
/activiti-app
-
-
Run Activiti
Run Activiti and visit https://localhost:8080/activiti-app in the browser
username: admin password: test
-
Import bpmn:
After running the project and logging in the system , upload process models under the root directory
src/main/resources, such asSupply_Chain_pool.bpmn,Weagon_Test.bpmn, then create app for it and publish your app, then go to processes page to start the selected process.
Run in Spring Tool Suite
-
Download development tool:
IDE: Spring-Tool-Suite-3.9.0.RELEASE
Web Container: Tomcat
Database: Mysql
-
Clone Source Code:
git clone --recursive [email protected]:sonnyhcl/Backend.git -
Import Project:
To import Backend as a Maven project in IDEA, follow the steps below :
File -> Import -> Maven -> Existing Maven Projects -> Select Root Directory -> Finish -
Update Maven Dependencies:
Right click the project name
activiti-app, then enter ->Maven->Update Project, waiting to load dependencies.
-
Configure Tomcat:
After loading is completed, right-click the project name, followed by
Run As->Run On Server->choose Tomcat Server->Finish.

-
Configure Mysql
First make sure you have installed mysql. You can edit your own mysql
databasename/username/passwordin activiti-app.properties -
Run Activiti
Visit https://localhost:8080/activiti-app in the browser, enter the login page,
username: admin password: test
-
Develop:
After running the project and logging in the system , upload process models under the root directory
src/main/resources, such as Supply_Chain_pool.bpmn20.xml, then create app for it and publish your app, then go to processes page to start the selected process.
Dependencies
Vessel FrontendAttention: In order to perform as demo shows, The
Activiti Backendproject must be coordinated with theVessel Frontendproject.