{"id":24658408,"url":"https://github.com/bigraph-toolkit-suite/bigraphs-by-examples.vendingmachine-webservice","last_synced_at":"2026-05-09T06:04:56.229Z","repository":{"id":203766613,"uuid":"627430041","full_name":"bigraph-toolkit-suite/bigraphs-by-examples.vendingmachine-webservice","owner":"bigraph-toolkit-suite","description":"Object-oriented Bigraphs","archived":false,"fork":false,"pushed_at":"2025-02-20T10:41:51.000Z","size":932,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-21T04:41:23.021Z","etag":null,"topics":["bigraphs","cdo","object-oriented-programming","vending-machine"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bigraph-toolkit-suite.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-13T13:00:13.000Z","updated_at":"2025-02-20T10:41:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"ada5f5d3-93ea-43c2-afeb-8d47976432bc","html_url":"https://github.com/bigraph-toolkit-suite/bigraphs-by-examples.vendingmachine-webservice","commit_stats":null,"previous_names":["bigraph-toolkit-suite/bigraphs-by-examples.bigraph-vendingmachine-webservice","bigraph-toolkit-suite/bigraphs-by-examples.vendingmachine-webservice"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bigraph-toolkit-suite/bigraphs-by-examples.vendingmachine-webservice","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigraph-toolkit-suite%2Fbigraphs-by-examples.vendingmachine-webservice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigraph-toolkit-suite%2Fbigraphs-by-examples.vendingmachine-webservice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigraph-toolkit-suite%2Fbigraphs-by-examples.vendingmachine-webservice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigraph-toolkit-suite%2Fbigraphs-by-examples.vendingmachine-webservice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bigraph-toolkit-suite","download_url":"https://codeload.github.com/bigraph-toolkit-suite/bigraphs-by-examples.vendingmachine-webservice/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigraph-toolkit-suite%2Fbigraphs-by-examples.vendingmachine-webservice/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265888888,"owners_count":23844525,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bigraphs","cdo","object-oriented-programming","vending-machine"],"created_at":"2025-01-26T01:18:54.351Z","updated_at":"2026-05-09T06:04:56.223Z","avatar_url":"https://github.com/bigraph-toolkit-suite.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bigraphs by Examples: A RESTful Vending Machine\n\nThis project is a template for building **database-driven, object-oriented bigraphical applications**  \nwith execution logic defined by **formally verified bigraphs**. \nIt bridges **analysis and execution** by using bigraphical model checking to verify system behavior before deployment.\n\n#### Screenshots\n\n| \u003cimg src=\"etc/screenshot-ui.png\" style=\"zoom:40%;\" /\u003e                         | \u003cimg src=\"etc/screenshot-of-eclipse-cdo.png\" style=\"zoom:50%;\" /\u003e                  |\n|-------------------------------------------------------------------------------|------------------------------------------------------------------------------------|\n| Screenshot of the UI: The web UI allows interaction with the vending machine. | Screenshot of the CDO Explorer: Bigraphs are stored as Ecore models in a database. |\n\n## Features\n\n**Bigraph-centric Design**\n- All application data and logic are modeled and stored as bigraphs (Ecore format) in a CDO-based in-memory database\n\n**Integration of Formal Verification**\n- The system behavior is subject to model checking\n- Results of this analysis influence the application logic (e.g., web endpoints)\n\n**Reactive via Web Endpoints**\n- Bigraphical reactions (i.e. state transitions of the application) are triggered through RESTful API calls\n- Ideal for interfacing with external systems or simulations\n\n**Model-Based State Evolution**\n- Design-time configuration: The initial state, rules, and predicates are set by placing the corresponding bigraph files in `src/main/resources`. These files are the output of formal analysis as implemented in [`Analysis.java`](src/test/java/org.example/Analysis.java).\n- Runtime modification: The application behavior can be changed dynamically by editing the model in the CDO database (e.g., add a coin, or change the effect of a rule)\n\n\n## Getting Started\n\n### Via the IDE (Eclipse, IntelliJ IDEA, Visual Code, ...)\n\n- Run the class `src/main/java/org/example/Application.java`\n- Wait until you see in the terminal: \"Application has successfully started ...\"\n\n### Via the Terminal\nUsing Maven, issue the following command:\n```shell\n$ mvn clean package -DskipTests\n```\n\nThe JAR file is created within the `target` folder of the project's root folder.\n\nTo run the application JAR file, execute the following command:\n```shell\n$ java -jar ./target/code-samples-1.0-SNAPSHOT.jar\n\n# To change the server port\n$ java -jar ./target/code-samples-1.0-SNAPSHOT.jar --server.port=9090\n```\n\n- Wait until you see in the terminal: `Application has successfully started ...`\n\n\n### Open the Browser\n\nAfterward, open any browser and go to the following URL: [http://localhost:8080/](http://localhost:8080/)\n\nIf the bigraph doesn't appear to reflect the current state, simply refresh the page (press \u003ckbd\u003eF5\u003c/kbd\u003e or \u003ckbd\u003eCtrl+R\u003c/kbd\u003e) to update it.\n\n**Database Explorer (Optional):**\nTo view and modify the bigraph within the database, download CDO Explorer via the [Eclipse Installer](https://www.eclipse.org/downloads/packages/installer).\nUse Eclipse Version 2025-12 (4.38.0), which supports CDO protocol version *54*.\n\n## Remarks\n\n### Software Stack\n\n- Java \u003e=21\n- Maven 3.8.7\n- Spring 3.3.5\n- [Bigraph Framework](https://github.com/bigraph-toolkit-suite/bigraphs.bigraph-framework) 2.4.0\n- [BDSL Grammar](https://github.com/bigraph-toolkit-suite/bigraphs.bdsl-grammar) 2.0.1 and [Interpreter](https://github.com/bigraph-toolkit-suite/bigraphs.bdsl-interpreter-parent) 2.2.1\n- [Spring Data CDO](https://github.com/bigraph-toolkit-suite/spring-data-cdo) 0.8.0\n\n\n### Database \u0026 Configuration\n\n- The database configuration file is stored here: `src/main/resources/config/cdo-server.xml`\n- Every time the application starts, a fresh in-memory CDO database is created\n- The state of the program is not persisted, when the application is shut down\n- Listeners for concrete objects in CDO can be attached _before_ they are stored in the database (it is recommended to register listeners after)\n  - See: [`VendingMachineObject`](src/main/java/org/example/domain/data/VendingMachineObject.java) and [`VMRuleSet`](src/main/java/org/example/domain/behavior/VMRuleSet.java)\n\n### Analysis\n\n- Analysis is placed in the `./src/test` folder of this project\n- Execute the unit tests to perform the analysis\n- With the IDE or via Maven `mvn -Dtest=Analysis test` \n\n- The results are stored in the resource folder\n  - Rules, predicates and the metamodel\n- The results are re-used for the implementation\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigraph-toolkit-suite%2Fbigraphs-by-examples.vendingmachine-webservice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbigraph-toolkit-suite%2Fbigraphs-by-examples.vendingmachine-webservice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigraph-toolkit-suite%2Fbigraphs-by-examples.vendingmachine-webservice/lists"}