Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NO-ISSUE: Make examples better reflect their domain and contain more focused code #2726

Merged
merged 37 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion .github/supporting-files/ci/partitions/partition1.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@kie-tools-examples/sonataflow-greeting-quarkus-example
@kie-tools-examples/sonataflow-greeting
@kie-tools-examples/serverless-workflow-editor-standalone-on-webapp
@kie-tools/serverless-logic-web-tools-swf-builder-image
@kie-tools/serverless-logic-web-tools
@kie-tools/serverless-logic-web-tools-base-builder-image
Expand Down
40 changes: 20 additions & 20 deletions .rat-excludes
Original file line number Diff line number Diff line change
Expand Up @@ -20,41 +20,41 @@ pnpm-lock.yaml
pnpm-workspace.yaml
# _intellij-project/[email protected]
[email protected]
# examples/base64png-editor-vscode-extension/.vscodeignore
# examples/micro-frontends-multiplying-architecture-base64png-editor-vscode-extension/.vscodeignore
.vscodeignore
# examples/commit-message-validation-service/go.mod
# examples/kie-sandbox-commit-message-validation-service/go.mod
go.mod
# examples/commit-message-validation-service/go.sum
# examples/kie-sandbox-commit-message-validation-service/go.sum
go.sum
# examples/drools-process-usertasks-quarkus-example/drools-process-usertasks-quarkus-example.iml
drools-process-usertasks-quarkus-example.iml
# examples/drools-process-usertasks-quarkus-example/src/main/docker/Dockerfile.jvm
# examples/process-user-tasks-subsystem/process-user-tasks-subsystem.iml
process-user-tasks-subsystem.iml
# examples/process-user-tasks-subsystem/src/main/docker/Dockerfile.jvm
Dockerfile.jvm
# examples/drools-process-usertasks-quarkus-example/src/main/docker/Dockerfile.native
# examples/process-user-tasks-subsystem/src/main/docker/Dockerfile.native
Dockerfile.native
# examples/jbpm-compact-architecture-example/.gitignore
# examples/process-compact-architecture/.gitignore
.gitignore
# examples/jbpm-compact-architecture-example/jbpm-compact-architecture-quarkus-example.iml
jbpm-compact-architecture-quarkus-example.iml
# examples/jbpm-compact-architecture-example/docker-compose/startContainers.sh
# examples/process-compact-architecture/process-compact-architecture.iml
process-compact-architecture.iml
# examples/process-compact-architecture/docker-compose/startContainers.sh
startContainers.sh
# examples/jbpm-compact-architecture-example/docker-compose/pgadmin/pgpass
# examples/process-compact-architecture/docker-compose/pgadmin/pgpass
pgpass
# examples/jbpm-compact-architecture-example/docker-compose/sql/init.sql
# examples/process-compact-architecture/docker-compose/sql/init.sql
init.sql
# examples/ping-pong-view-angular/src/assets/.gitkeep
# examples/micro-frontends-multiplying-architecture-ping-pong-view-in-angular/src/assets/.gitkeep
.gitkeep
# examples/sonataflow-greeting-quarkus-example/sonataflow-greeting-quarkus-example.iml
sonataflow-greeting-quarkus-example.iml
# examples/todo-list-view-vscode-extension/.vscodeignore
sonataflow-greeting.iml
# examples/micro-frontends-multiplying-architecture-todo-list-view-vscode-extension/.vscodeignore
.vscodeignore
# examples/webapp/static/examples/dorinha.base64png
# examples/micro-frontends-multiplying-architecture-base64png-editor-on-webapp/static/examples/dorinha.base64png
dorinha.base64png
# examples/webapp/static/examples/luiz.base64png
# examples/micro-frontends-multiplying-architecture-base64png-editor-on-webapp/static/examples/luiz.base64png
luiz.base64png
# examples/webapp/static/examples/sample.base64png
# examples/micro-frontends-multiplying-architecture-base64png-editor-on-webapp/static/examples/sample.base64png
sample.base64png
# examples/webapp/static/examples/tiago.base64png
# examples/micro-frontends-multiplying-architecture-base64png-editor-on-webapp/static/examples/tiago.base64png
tiago.base64png
# packages/bpmn-marshaller/src/schemas/bpmn-2_0/BPMN20.xsd
BPMN20.xsd
Expand Down
6 changes: 3 additions & 3 deletions _intellij-project/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions _intellij-project/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# KIE Tools :: Examples

This directory contains packages that showcase features, tools, complete apps, and use-cases for packages hosted in the [packages](../packages) directory.

Building packages in this directory is toggled by the `KIE_TOOLS_BUILD__buildExamples` (true/false) Environment Variable. Default is `false`.
60 changes: 60 additions & 0 deletions examples/bpmn-editor-classic-on-webapp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

# Example :: BPMN Editor (classic) on webapp

This package contains a web application that features the BPMN Editor (classic) as a wrapped inside a Micro-frontend Multiplying Architecture Envelope.

### Building the dependencies

Before running this example, building its dependencies is required. Run the following command on a Terminal:

```shell script
KIE_TOOLS_BUILD__buildExamples=true pnpm -F @kie-tools-examples/bpmn-editor-classic-on-webapp^... build:dev
```

### Running

```shell script
pnpm start
```

---

Apache KIE (incubating) is an effort undergoing incubation at The Apache Software
Foundation (ASF), sponsored by the name of Apache Incubator. Incubation is
required of all newly accepted projects until a further review indicates that
the infrastructure, communications, and decision making process have stabilized
in a manner consistent with other successful ASF projects. While incubation
status is not necessarily a reflection of the completeness or stability of the
code, it does indicate that the project has yet to be fully endorsed by the ASF.

Some of the incubating project’s releases may not be fully compliant with ASF
policy. For example, releases may have incomplete or un-reviewed licensing
conditions. What follows is a list of known issues the project is currently
aware of (note that this list, by definition, is likely to be incomplete):

- Hibernate, an LGPL project, is being used. Hibernate is in the process of
relicensing to ASL v2
- Some files, particularly test files, and those not supporting comments, may
be missing the ASF Licensing Header

If you are planning to incorporate this work into your product/project, please
be aware that you will need to conduct a thorough licensing review to determine
the overall implications of including this work. For the current status of this
project through the Apache Incubator visit:
https://incubator.apache.org/projects/kie.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@ module.exports = composeEnv([require("@kie-tools/root-env/env")], {
vars: varsWithName({}),
get env() {
return {
exampleChromeExtension: {
envelope: {
port: 9101,
},
bpmnEditorClassicOnWebappExample: {
port: 7771,
},
};
},
Expand Down
37 changes: 37 additions & 0 deletions examples/bpmn-editor-classic-on-webapp/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"private": true,
"name": "@kie-tools-examples/bpmn-editor-classic-on-webapp",
"version": "0.0.0",
"license": "Apache-2.0",
"scripts": {
"build": "rimraf dist && webpack",
"build:dev": "run-script-if --bool \"$(build-env examples.build)\" --then \"pnpm build --env dev\"",
"build:prod": "run-script-if --bool \"$(build-env examples.build)\" --then \"pnpm build\"",
"start": "webpack serve --host 0.0.0.0 --env dev"
},
"devDependencies": {
"@kie-tools-core/editor": "workspace:*",
"@kie-tools-core/envelope-bus": "workspace:*",
"@kie-tools-core/patternfly-base": "workspace:*",
"@kie-tools-core/react-hooks": "workspace:*",
"@kie-tools-core/webpack-base": "workspace:*",
"@kie-tools/kie-bc-editors": "workspace:*",
"@kie-tools/root-env": "workspace:*",
"@kie-tools/stunner-editors": "workspace:*",
"@kie-tools/tsconfig": "workspace:*",
"@patternfly/react-core": "^4.276.6",
"@patternfly/react-icons": "^4.93.6",
"@types/react": "^17.0.6",
"@types/react-dom": "^17.0.5",
"copy-webpack-plugin": "^11.0.0",
"process": "^0.11.10",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"rimraf": "^3.0.2",
"typescript": "^5.5.3",
"webpack": "^5.94.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.15.1",
"webpack-merge": "^5.9.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@
* under the License.
*/

import { ChannelType, EnvelopeContentType } from "@kie-tools-core/editor/dist/api";
import * as React from "react";
import { ChannelType, EnvelopeContentType } from "@kie-tools-core/editor/dist/api";
import { EditorEnvelopeLocator, EnvelopeMapping } from "@kie-tools-core/editor/dist/api";
import { useMemo, useState } from "react";
import { Page } from "@patternfly/react-core/dist/js/components/Page";
import { EmbeddedEditor, useEditorRef } from "@kie-tools-core/editor/dist/embedded";
import { EmbeddedEditorFile } from "@kie-tools-core/editor/dist/channel";
import { Brand } from "@patternfly/react-core/dist/js/components/Brand";
import { Page, PageSection, PageHeader } from "@patternfly/react-core/dist/js/components/Page";
import { Sidebar } from "./Sidebar";

export function BpmnPage() {
export function BpmnEditorClassicPage() {
/**
* The reference of the Editor. It allows us to access/modify the Editor properties imperatively.
*/
Expand All @@ -53,31 +54,35 @@ export function BpmnPage() {
new EnvelopeMapping({
type: "bpmn",
filePathGlob: "**/*.bpmn?(2)",
resourcesPathPrefix: "../bpmn-editor/bpmn/",
envelopeContent: { type: EnvelopeContentType.PATH, path: "envelope/bpmn-editor.html" },
resourcesPathPrefix: "../bpmn-editor-classic/",
envelopeContent: { type: EnvelopeContentType.PATH, path: "bpmn-editor-classic-envelope.html" },
}),
]);
}, []);

return (
<Page>
<div className={"webapp--page-main-div"}>
<Page
header={<PageHeader logo={<Brand src={"logo.png"} alt="Logo" />} />}
sidebar={
<Sidebar
editor={editor}
editorEnvelopeLocator={editorEnvelopeLocator}
file={file}
setFile={setFile}
fileExtension={"bpmn"}
accept={".bpmn, .bpmn2"}
accept={".bpmn"}
/>
}
>
<PageSection padding={{ default: "noPadding" }}>
<EmbeddedEditor
ref={editorRef}
file={file}
editorEnvelopeLocator={editorEnvelopeLocator}
channelType={ChannelType.EMBEDDED}
locale={"en"}
/>
</div>
</PageSection>
</Page>
);
}
Loading
Loading